File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ composer.lock
4
4
diff.txt
5
5
phpmd.xml
6
6
phpmd-tests.xml
7
+ diffFilter.phar
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ chdir (__DIR__ );
4
+
3
5
$ pharName = 'diffFilter.phar ' ;
6
+
7
+ cleanUp ($ pharName );
8
+
4
9
$ pharFile = getcwd () . '/diffFilter.phar ' ;
5
10
6
11
if (file_exists ($ pharFile )) {
@@ -47,8 +52,20 @@ function addDir($dir, $phar)
47
52
foreach ($ iterator as $ file ) {
48
53
$ fullPath = $ file ->getPathname ();
49
54
$ path = $ dir . substr ($ fullPath , $ codeLength );
55
+
56
+ if (strpos ($ path , '/test/ ' ) !== false ) {
57
+ continue ;
58
+ }
59
+
50
60
if (is_file ($ path )) {
51
- $ phar ->addFile ($ path );
61
+ $ phar ->addFromString ($ path, php_strip_whitespace ( $ path ) );
52
62
}
53
63
}
54
64
}
65
+
66
+ function cleanUp ($ pharName )
67
+ {
68
+ shell_exec ("rm -rf vendor " );
69
+ shell_exec ("rm $ pharName " );
70
+ shell_exec ("composer install --no-dev -o " );
71
+ }
You can’t perform that action at this time.
0 commit comments