Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | function addDir($dir, $phar) |
||
33 | { |
||
34 | $code = realpath(__DIR__ . "/$dir/"); |
||
35 | $codeLength = strlen($code); |
||
36 | $directory = new RecursiveDirectoryIterator( |
||
37 | $code, |
||
38 | RecursiveDirectoryIterator::FOLLOW_SYMLINKS |
||
39 | ); |
||
40 | $iterator = new RecursiveIteratorIterator( |
||
41 | $directory, |
||
42 | 0, |
||
43 | RecursiveIteratorIterator::CATCH_GET_CHILD |
||
44 | ); |
||
45 | |||
46 | foreach ($iterator as $file) { |
||
47 | $fullPath = $file->getPathname(); |
||
48 | $path = $dir . substr($fullPath, $codeLength); |
||
49 | if (is_file($path)) { |
||
50 | $phar->addFile($path); |
||
51 | } |
||
54 |