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 21
21
exit (1 );
22
22
}
23
23
24
+ $ startTime = microtime (true );
25
+
24
26
$ scripts = [
25
27
'phpcs ' ,
26
28
'phpcbf ' ,
51
53
$ rdi = new \RecursiveDirectoryIterator ($ srcDir , \RecursiveDirectoryIterator::FOLLOW_SYMLINKS );
52
54
$ di = new \RecursiveIteratorIterator ($ rdi , 0 , \RecursiveIteratorIterator::CATCH_GET_CHILD );
53
55
56
+ $ fileCount = 0 ;
54
57
foreach ($ di as $ file ) {
55
58
$ filename = $ file ->getFilename ();
56
59
66
69
67
70
$ path = 'src ' .substr ($ fullpath , $ srcDirLen );
68
71
$ phar ->addFile ($ fullpath , $ path );
69
- }
72
+
73
+ ++$ fileCount ;
74
+ }//end foreach
70
75
71
76
// Add autoloader.
72
77
$ phar ->addFile (realpath (__DIR__ .'/../autoload.php ' ), 'autoload.php ' );
75
80
$ phar ->addFile (realpath (__DIR__ .'/../licence.txt ' ), 'licence.txt ' );
76
81
77
82
echo 'done ' .PHP_EOL ;
83
+ echo "\t Added " .$ fileCount .' files ' .PHP_EOL ;
78
84
79
85
/*
80
86
Add the stub.
93
99
94
100
echo 'done ' .PHP_EOL ;
95
101
}//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