1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

E107Preparer: Clean up hidden files as well

Fixes test run cleanup errors that look like:

    In ErrorHandler.php line 83:

      rmdir(W:\www\e107v2/e107_system/000000test/): Directory not empty

Or:

    In E107Preparer.php line 27:

      E107Preparer couldn't delete W:\www\e107v2/e107_system/000000test
This commit is contained in:
Nick Liu
2019-12-30 11:15:19 +01:00
parent 8270c5cf42
commit d31f4cd45e

View File

@@ -35,26 +35,22 @@ class E107Preparer implements Preparer
if(!is_dir($dirPath))
{
// echo ($dirPath . "must be a directory");
return null;
}
if(substr($dirPath, strlen($dirPath) - 1, 1) != '/')
{
$dirPath .= '/';
}
$files = glob($dirPath . '*', GLOB_MARK);
$files = scandir($dirPath);
foreach($files as $file)
{
if(is_dir($file))
if ($file == "." || $file == "..") continue;
if(is_dir("$dirPath/$file"))
{
$this->deleteDir($file);
$this->deleteDir("$dirPath/$file");
}
else
{
unlink($file);
unlink("$dirPath/$file");
}
}