File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 2121 exit (1 );
2222}
2323
24+ $ startTime = microtime (true );
25+
2426$ scripts = [
2527 'phpcs ' ,
2628 'phpcbf ' ,
5153 $ rdi = new \RecursiveDirectoryIterator ($ srcDir , \RecursiveDirectoryIterator::FOLLOW_SYMLINKS );
5254 $ di = new \RecursiveIteratorIterator ($ rdi , 0 , \RecursiveIteratorIterator::CATCH_GET_CHILD );
5355
56+ $ fileCount = 0 ;
5457 foreach ($ di as $ file ) {
5558 $ filename = $ file ->getFilename ();
5659
6669
6770 $ path = 'src ' .substr ($ fullpath , $ srcDirLen );
6871 $ phar ->addFile ($ fullpath , $ path );
69- }
72+
73+ ++$ fileCount ;
74+ }//end foreach
7075
7176 // Add autoloader.
7277 $ phar ->addFile (realpath (__DIR__ .'/../autoload.php ' ), 'autoload.php ' );
7580 $ phar ->addFile (realpath (__DIR__ .'/../licence.txt ' ), 'licence.txt ' );
7681
7782 echo 'done ' .PHP_EOL ;
83+ echo "\t Added " .$ fileCount .' files ' .PHP_EOL ;
7884
7985 /*
8086 Add the stub.
9399
94100 echo 'done ' .PHP_EOL ;
95101}//end foreach
102+
103+ $ timeTaken = ((microtime (true ) - $ startTime ) * 1000 );
104+ if ($ timeTaken < 1000 ) {
105+ $ timeTaken = round ($ timeTaken );
106+ echo "DONE in {$ timeTaken }ms " .PHP_EOL ;
107+ } else {
108+ $ timeTaken = round (($ timeTaken / 1000 ), 2 );
109+ echo "DONE in $ timeTaken secs " .PHP_EOL ;
110+ }
111+
112+ echo PHP_EOL ;
113+ echo 'Filesize generated phpcs.phar file: ' .filesize (dirname (__DIR__ ).'/phpcs.phar ' ).' bytes ' .PHP_EOL ;
114+ echo 'Filesize generated phpcs.phar file: ' .filesize (dirname (__DIR__ ).'/phpcbf.phar ' ).' bytes ' .PHP_EOL ;
You can’t perform that action at this time.
0 commit comments