| @@ 2-16 (lines=15) @@ | ||
| 1 | <?php declare(strict_types=1); |
|
| 2 | if ( ! function_exists('glob_recursive')) |
|
| 3 | { |
|
| 4 | // Does not support flag GLOB_BRACE |
|
| 5 | function glob_recursive($pattern, $flags = 0) |
|
| 6 | { |
|
| 7 | $files = glob($pattern, $flags); |
|
| 8 | ||
| 9 | foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) |
|
| 10 | { |
|
| 11 | $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); |
|
| 12 | } |
|
| 13 | ||
| 14 | return $files; |
|
| 15 | } |
|
| 16 | } |
|
| 17 | ||
| 18 | /** |
|
| 19 | * This is project's console commands configuration for Robo task runner. |
|
| @@ 10-25 (lines=16) @@ | ||
| 7 | 'Robofile.php' |
|
| 8 | ]; |
|
| 9 | ||
| 10 | if ( ! function_exists('glob_recursive')) |
|
| 11 | { |
|
| 12 | // Does not support flag GLOB_BRACE |
|
| 13 | ||
| 14 | function glob_recursive($pattern, $flags = 0) |
|
| 15 | { |
|
| 16 | $files = glob($pattern, $flags); |
|
| 17 | ||
| 18 | foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) |
|
| 19 | { |
|
| 20 | $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags)); |
|
| 21 | } |
|
| 22 | ||
| 23 | return $files; |
|
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| 27 | function get_text_to_replace($tokens) |
|
| 28 | { |
|