Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-36963 Do not attempt to remove the root folder of a plugin during…
… the update deployment

There is no need to move the root folder of a plugin during the update
deployment. We just need to operate with its contents. So the web server
process can have the write access for the plugin folder only.
  • Loading branch information
mudrd8mz authored and danpoltawski committed Dec 6, 2012
1 parent dabe5ac commit 8663b09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mdeploy.php
Expand Up @@ -754,7 +754,7 @@ public function execute() {
}

// Looking good, let's try it.
if (!$this->move_directory($sourcelocation, $backuplocation)) {
if (!$this->move_directory($sourcelocation, $backuplocation, true)) {
throw new backup_folder_exception('Unable to backup the current version of the plugin (moving failed)');
}

Expand Down Expand Up @@ -1282,8 +1282,8 @@ protected function unzip_plugin($ziplocation, $plugintyperoot, $expectedlocation

if (!$zip->extractTo($plugintyperoot)) {
$zip->close();
$this->remove_directory($expectedlocation); // just in case something was created
$this->move_directory($backuplocation, $expectedlocation);
$this->remove_directory($expectedlocation, true); // just in case something was created
$this->move_directory_into($backuplocation, $expectedlocation);
throw new zip_exception('Unable to extract the zip package');
}

Expand Down

0 comments on commit 8663b09

Please sign in to comment.