MDL-32149 significantly faster database reset, "util.php --drop" can now be interrupted at any time

This commit is contained in:
Petr Skoda
2012-04-03 22:30:54 +02:00
parent dbf5a44798
commit 728eadac78
2 changed files with 85 additions and 34 deletions
+3 -1
View File
@@ -225,7 +225,9 @@ function phpunit_bootstrap_error($text, $errorcode = 1) {
function phpunit_bootstrap_initdataroot($dataroot) {
global $CFG;
file_put_contents("$dataroot/phpunittestdir.txt", 'Contents of this directory are used during tests only, do not delete this file!');
if (!file_exists("$dataroot/phpunittestdir.txt")) {
file_put_contents("$dataroot/phpunittestdir.txt", 'Contents of this directory are used during tests only, do not delete this file!');
}
chmod("$dataroot/phpunittestdir.txt", $CFG->filepermissions);
if (!file_exists("$CFG->phpunit_dataroot/phpunit")) {
mkdir("$CFG->phpunit_dataroot/phpunit", $CFG->directorypermissions);