Finished work on Catalog::verify
This commit is contained in:
@@ -16,7 +16,7 @@ trait Files
|
||||
if (is_null($option['file']) AND is_null($option['dir']))
|
||||
abort(500,'Missing filename, please use --file= OR --dir=');
|
||||
|
||||
Log::info(sprintf('%s: Processing: %s',__METHOD__,($option['file'] ? $option['file'] : $option['dir'])));
|
||||
Log::debug(sprintf('%s: Processing: %s',__METHOD__,($option['file'] ? $option['file'] : $option['dir'])));
|
||||
|
||||
$files = collect();
|
||||
$dir = '';
|
||||
@@ -26,7 +26,7 @@ trait Files
|
||||
$dir = preg_replace('/\/$/','',$option['dir']);
|
||||
|
||||
// Exclude . & .. from the path.
|
||||
$files = $files->merge(array_diff(scandir($dir),array('.','..')));
|
||||
$files = $files->merge(array_filter(array_diff(scandir($dir),array('.','..')),function($item) use ($dir) { return is_file($dir.'/'.$item); }));
|
||||
|
||||
} elseif ($option['file'] AND ! is_dir($option['file']) AND file_exists($option['file'])) {
|
||||
$dir = dirname($option['file']);
|
||||
@@ -43,7 +43,7 @@ trait Files
|
||||
return sprintf('%s/%s',$dir,$value);
|
||||
});
|
||||
|
||||
Log::info(sprintf('%s: Processing: %s (%s)',__METHOD__,($option['file'] ? $option['file'] : $option['dir']),count($files)));
|
||||
Log::debug(sprintf('%s: Processing: %s (%s)',__METHOD__,($option['file'] ? $option['file'] : $option['dir']),count($files)));
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
Reference in New Issue
Block a user