protected function UnmanagedFilesService::getFileUris in Fancy File Delete 2.0.x
Answer an array of file URI's to match against the database.
Parameters
string $dir The file-system path of the directory.:
Return value
array
1 call to UnmanagedFilesService::getFileUris()
- UnmanagedFilesService::getFiles in src/
UnmanagedFilesService.php - Answer an array of unmanaged files contained in the directories provided.
File
- src/
UnmanagedFilesService.php, line 261
Class
- UnmanagedFilesService
- Class UnmanagedFilesService.
Namespace
Drupal\fancy_file_deleteCode
protected function getFileUris($dir) {
$file_check = [];
$files = $this->fileSystem
->scanDirectory($dir, '(.*?)', [
'recurse' => FALSE,
]);
// Go through each one and replace this with a proper uri.
foreach ($files as $file) {
if (!is_dir($this->fileSystem
->realpath($file->uri))) {
$file_check[] = $file->uri;
}
}
return $file_check;
}