Skip to content

Commit

Permalink
add rglob function
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanenko3 committed Aug 25, 2022
1 parent c2efd3e commit 37e7954
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
use Illuminate\Support\Facades\Storage;
use Ramsey\Uuid\Uuid;

if (!function_exists('rglob')) {
function rglob($pattern)
{
$files = glob($pattern);

foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
$files = array_merge(
[],
...[$files, rglob($dir . '/' . basename($pattern))],
);
}

return $files;
}
}

if (!function_exists('readableMemory')) {
/**
* readableMemory
Expand Down

0 comments on commit 37e7954

Please sign in to comment.