mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-42973 fix multiple addon update issues
This commit is contained in:
parent
c36a2401ab
commit
fc28111316
5 changed files with 151 additions and 137 deletions
28
mdeploy.php
28
mdeploy.php
|
@ -780,17 +780,25 @@ class worker extends singleton_pattern {
|
|||
$this->log('Current plugin code location: '.$sourcelocation);
|
||||
$this->log('Moving the current code into archive: '.$backuplocation);
|
||||
|
||||
// We don't want to touch files unless we are pretty sure it would be all ok.
|
||||
if (!$this->move_directory_source_precheck($sourcelocation)) {
|
||||
throw new backup_folder_exception('Unable to backup the current version of the plugin (source precheck failed)');
|
||||
}
|
||||
if (!$this->move_directory_target_precheck($backuplocation)) {
|
||||
throw new backup_folder_exception('Unable to backup the current version of the plugin (backup precheck failed)');
|
||||
}
|
||||
if (file_exists($sourcelocation)) {
|
||||
// We don't want to touch files unless we are pretty sure it would be all ok.
|
||||
if (!$this->move_directory_source_precheck($sourcelocation)) {
|
||||
throw new backup_folder_exception('Unable to backup the current version of the plugin (source precheck failed)');
|
||||
}
|
||||
if (!$this->move_directory_target_precheck($backuplocation)) {
|
||||
throw new backup_folder_exception('Unable to backup the current version of the plugin (backup precheck failed)');
|
||||
}
|
||||
|
||||
// Looking good, let's try it.
|
||||
if (!$this->move_directory($sourcelocation, $backuplocation, true)) {
|
||||
throw new backup_folder_exception('Unable to backup the current version of the plugin (moving failed)');
|
||||
// Looking good, let's try it.
|
||||
if (!$this->move_directory($sourcelocation, $backuplocation, true)) {
|
||||
throw new backup_folder_exception('Unable to backup the current version of the plugin (moving failed)');
|
||||
}
|
||||
|
||||
} else {
|
||||
// Upgrading missing plugin - this happens often during upgrades.
|
||||
if (!$this->create_directory_precheck($sourcelocation)) {
|
||||
throw new filesystem_exception('Unable to prepare the plugin location (cannot create new directory)');
|
||||
}
|
||||
}
|
||||
|
||||
// Unzip the plugin package file into the target location.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue