$errors[] =
$directory;
return $errors;
} return $errors;
} private function fixDirectoryPermission(\SplFileInfo
$fileInfo): void
{ try { $permission =
mb_substr(sprintf('%o',
$fileInfo->
getPerms()), -4
);
} catch (\Exception
$e) { // cannot get permissions...
return;
} $newPermission =
$permission;
// set owner-bit to writable
$newPermission[1
] = '7';
// set group-bit to writable
$newPermission[2
] = '7';
$newPermission =
octdec($newPermission);
chmod($fileInfo->
getPathname(),
(int) $newPermission);