Files
bunny-cli/app/Bunny/Filesystem/LocalStorage.php
René Preuß f42347aa99 first commit
2021-07-19 20:55:01 +02:00

24 lines
601 B
PHP

<?php
namespace App\Bunny\Filesystem;
class LocalStorage
{
function allFiles($dir, &$results = array())
{
$files = scandir($dir);
foreach ($files as $value) {
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
if (!is_dir($path)) {
$results[] = new LocalFile($path, strtoupper(hash_file('sha256', $path)));
} else if ($value != "." && $value != "..") {
$results[] = new LocalFile($path, null);
$this->allFiles($path, $results);
}
}
return $results;
}
}