weby sloth
1.0.0
이 PHP의 라이브러리는 간단한 데이터 Manipulaton 도구를 제공하며 간단한 데이터 분석, 변환 및보고에 사용될 수 있습니다. 예를 들어, 입력 데이터에 대한 "Group By", "Pivot"및이 작업에 적용될 수있는 추가 골재 기능을 제공합니다.
composer require weby/sloth:v0.1자세한 내용은 예제 폴더를 참조하십시오.
// examples/data.php:
$ data = [
[ ' foo ' => ' one ' , ' bar ' => ' A ' , ' baz ' => 1 ],
[ ' foo ' => ' one ' , ' bar ' => ' B ' , ' baz ' => 2 ],
[ ' foo ' => ' one ' , ' bar ' => ' C ' , ' baz ' => 3 ],
[ ' foo ' => ' two ' , ' bar ' => ' A ' , ' baz ' => 4 ],
[ ' foo ' => ' two ' , ' bar ' => ' B ' , ' baz ' => 5 ],
[ ' foo ' => ' two ' , ' bar ' => ' C ' , ' baz ' => 6 ],
]; // examples/group.php:
require_once ' ../vendor/autoload.php ' ;
use Weby Sloth Sloth ;
include_once ' data.php ' ;
Sloth:: from ( $ data )
-> group ( ' foo ' , ' baz ' )
-> count ()
-> sum ()
-> avg ()
-> print ();
// Outputs:
// foo count sum avg
// one 3 6 2
// two 3 15 5 // examples/pivot.php:
require_once ' ../vendor/autoload.php ' ;
use Weby Sloth Sloth ;
include_once ' data.php ' ;
Sloth:: from ( $ data )
-> pivot ( ' foo ' , ' bar ' , ' baz ' )
-> print ();
// Outputs:
// foo A B C
// one 1 2 3
// two 4 5 6 테스트 실행은 간단합니다.
vendor/bin/phpunit이 문서는이 저장소의 위키에 있습니다.
Weby Sloth는 MIT 라이센스에 따라 배포됩니다.