File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ pharName = 'diffFilter.phar ' ;
4
+ $ pharFile = getcwd () . '/diffFilter.phar ' ;
5
+
6
+ if (file_exists ($ pharFile )) {
7
+ unlink ($ pharFile );
8
+ }
9
+
10
+ $ phar = new Phar ($ pharFile , 0 , $ pharName );
11
+
12
+ $ phar ->addFile ('autoload.php ' );
13
+ $ phar ->addFile ('bin/diffFilter ' );
14
+
15
+ $ code = realpath (__DIR__ .'/src ' );
16
+ $ codeLength = strlen ($ code );
17
+ $ directory = new RecursiveDirectoryIterator (
18
+ $ code ,
19
+ RecursiveDirectoryIterator::FOLLOW_SYMLINKS
20
+ );
21
+ $ iterator = new RecursiveIteratorIterator (
22
+ $ directory ,
23
+ 0 ,
24
+ RecursiveIteratorIterator::CATCH_GET_CHILD
25
+ );
26
+
27
+ foreach ($ iterator as $ file ) {
28
+ $ fullPath = $ file ->getPathname ();
29
+ $ path = 'src ' . substr ($ fullPath , $ codeLength );
30
+
31
+ $ phar ->addFile ($ path );
32
+ }
33
+
34
+ $ phar ->setStub (
35
+ "#!/usr/bin/env php
36
+ <?php
37
+ require 'src/Runners/generic.php';
38
+ __HALT_COMPILER(); "
39
+ );
You can’t perform that action at this time.
0 commit comments