mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
remove left overs from last installation, check if renaming succeeded
This commit is contained in:
parent
ec9ad49791
commit
459883748e
|
@ -348,6 +348,10 @@ class SeedDMS_Extension_Mgr {
|
|||
public function updateExtension($file) { /* {{{ */
|
||||
/* unzip the extension in a temporary directory */
|
||||
$newdir = $this->cachedir ."/ext.new";
|
||||
/* First remove a left over from a previous extension */
|
||||
if(file_exists($newdir)) {
|
||||
self::rrmdir($newdir);
|
||||
}
|
||||
if(!mkdir($newdir, 0755)) {
|
||||
$this->errmsgs[] = "Cannot create temp. extension directory";
|
||||
return false;
|
||||
|
@ -375,7 +379,10 @@ class SeedDMS_Extension_Mgr {
|
|||
$this->rrmdir($this->extdir ."/". $extname);
|
||||
}
|
||||
/* Move the temp. created ext directory to the final location */
|
||||
rename($newdir, $this->extdir ."/". $extname);
|
||||
if(!rename($newdir, $this->extdir ."/". $extname)) {
|
||||
$this->rrmdir($this->extdir ."/". $extname);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user