MDL-49008 lang: removed preemptive deleting of old language files

This commit is contained in:
Andrew Davis
2015-02-22 19:58:57 +01:00
parent 323f95b222
commit 4a85b4c0d0
2 changed files with 8 additions and 29 deletions
+8 -2
View File
@@ -323,8 +323,14 @@ class component_installer {
/// Move current revision to a safe place
$destinationdir = $CFG->dataroot.'/'.$this->destpath;
$destinationcomponent = $destinationdir.'/'.$this->componentname;
@remove_dir($destinationcomponent.'_old'); //Deleting possible old components before
@rename ($destinationcomponent, $destinationcomponent.'_old'); //Moving to a safe place
@remove_dir($destinationcomponent.'_old'); // Deleting a possible old version.
// Moving to a safe place.
$moveresult = rename($destinationcomponent, $destinationcomponent.'_old');
if (!$moveresult) {
debugging("Failed to rename {$destinationcomponent} to {$destinationcomponent}_old while installing a language");
}
/// Unzip new version
if (!unzip_file($zipfile, $destinationdir, false)) {
/// Error so, go back to the older