This is necessory to close all handlers on the directory and than it is
possible to rmdir the directory without a 'permission denied' on a
windows machine.
Corresponding unit test failure:
1) FileBackendTest::testRecursiveClean
Dir mwstore://localtesting/unittest-cont1/e/a no longer exists
(FSFileBackend).
Failed asserting that true matches expected false.
Change-Id: Ide58c6d0ec101bf0ddcd6b7414c51075fc28825b
$subDir = $params['dir'] . "/{$subDirRel}"; // full path
$status->merge( $this->doClean( array( 'dir' => $subDir ) + $params ) );
}
$subDir = $params['dir'] . "/{$subDirRel}"; // full path
$status->merge( $this->doClean( array( 'dir' => $subDir ) + $params ) );
}
+ unset( $subDirsRel ); // free directory for rmdir() on Windows (for FS backends)
$base = self::baseStorePath();
$dirs = array(
$base = self::baseStorePath();
$dirs = array(
+ "$base/unittest-cont1",
+ "$base/unittest-cont1/e",
"$base/unittest-cont1/e/a",
"$base/unittest-cont1/e/a/b",
"$base/unittest-cont1/e/a/b/c",
"$base/unittest-cont1/e/a",
"$base/unittest-cont1/e/a/b",
"$base/unittest-cont1/e/a/b/c",
foreach ( $iter as $file ) {
$this->backend->quickDelete( array( 'src' => "$base/$container/$file" ) );
}
foreach ( $iter as $file ) {
$this->backend->quickDelete( array( 'src' => "$base/$container/$file" ) );
}
+ // free the directory, to avoid Permission denied under windows on rmdir
+ unset( $iter );
}
$this->backend->clean( array( 'dir' => "$base/$container", 'recursive' => 1 ) );
}
}
$this->backend->clean( array( 'dir' => "$base/$container", 'recursive' => 1 ) );
}