Prevent warnings when reading the directory fails
(There will still be error messages)pull/4/head
parent
cb8640195e
commit
ee02f08bdb
|
@ -1578,16 +1578,19 @@ Class H5PExport {
|
||||||
*/
|
*/
|
||||||
private static function populateFileList($dir, &$files, $relative = '') {
|
private static function populateFileList($dir, &$files, $relative = '') {
|
||||||
$strip = strlen($dir) + 1;
|
$strip = strlen($dir) + 1;
|
||||||
foreach (glob($dir . DIRECTORY_SEPARATOR . '*') as $file) {
|
$contents = glob($dir . DIRECTORY_SEPARATOR . '*');
|
||||||
$rel = $relative . substr($file, $strip);
|
if (!empty($contents)) {
|
||||||
if (is_dir($file)) {
|
foreach ($contents as $file) {
|
||||||
self::populateFileList($file, $files, $rel . '/');
|
$rel = $relative . substr($file, $strip);
|
||||||
}
|
if (is_dir($file)) {
|
||||||
else {
|
self::populateFileList($file, $files, $rel . '/');
|
||||||
$files[] = (object) array(
|
}
|
||||||
'absolutePath' => $file,
|
else {
|
||||||
'relativePath' => $rel
|
$files[] = (object) array(
|
||||||
);
|
'absolutePath' => $file,
|
||||||
|
'relativePath' => $rel
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue