commit
7e76de099d
|
@ -268,7 +268,7 @@ class Filesystem {
|
|||
/**
|
||||
* Get Size of file or directory in bytes
|
||||
* @param [string] $fileOrDirectory
|
||||
* @return [int|bool [bytes or false on error]
|
||||
* @return [int|bool] [bytes or false on error]
|
||||
*/
|
||||
public static function getSize($fileOrDirectory) {
|
||||
// Files
|
||||
|
@ -278,9 +278,11 @@ class Filesystem {
|
|||
// Directories
|
||||
if (file_exists($fileOrDirectory)) {
|
||||
$size = 0;
|
||||
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fileOrDirectory)) as $file){
|
||||
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fileOrDirectory, FilesystemIterator::SKIP_DOTS)) as $file){
|
||||
if (file_exists($file)) {
|
||||
$size += $file->getSize();
|
||||
}
|
||||
}
|
||||
return $size;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -116,7 +116,7 @@ class Text {
|
|||
$characteres = "1234567890abcdefghijklmnopqrstuvwxyz!@#%^&*";
|
||||
$text = '';
|
||||
for($i=0; $i<$length; $i++) {
|
||||
$text .= $characteres{rand(0,41)};
|
||||
$text .= $characteres[rand(0,41)];
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue