mirror of
https://github.com/bitinflow/bunny-cli.git
synced 2026-03-13 21:55:54 +00:00
first commit
This commit is contained in:
23
app/Bunny/Filesystem/LocalStorage.php
Normal file
23
app/Bunny/Filesystem/LocalStorage.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user