}
foreach (new \DirectoryIterator($path) as $file) {
- if($file->isDot()) {
+ if ($file->isDot()) {
continue;
}
if ($file->isFile()) {
unlink($file->getPathname());
- } elseif($file->isDir()) {
+ } elseif ($file->isDir()) {
$skipped = static::clearFolder($file->getRealPath(), true, $exclude) || $skipped;
}
}
*/
public static function isPathInShaarliFolder(string $path): bool
{
- $rootDirectory = dirname(dirname(__FILE__));
+ $rootDirectory = dirname(dirname(dirname(__FILE__)));
return strpos(realpath($path), $rootDirectory) !== false;
}