mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
use rename() on windows when moving an extension to its final destination
This commit is contained in:
parent
15c5ef1441
commit
f97c42f9b7
|
@ -565,12 +565,16 @@ class SeedDMS_Extension_Mgr {
|
|||
* location and leave the extracted archive in place. The next time an
|
||||
* extension is imported the last extracted archive will be removed.
|
||||
*/
|
||||
// if(!rename($newdir, $this->extdir ."/". $extname)) {
|
||||
if(false === exec('mv '.escapeshellarg($newdir).' '.escapeshellarg($this->extdir."/".$extname))) {
|
||||
if(strpos(PHP_OS, 'WIN') === 0)
|
||||
$ret = rename($newdir, $this->extdir ."/". $extname);
|
||||
else
|
||||
$ret = exec('mv '.escapeshellarg($newdir).' '.escapeshellarg($this->extdir."/".$extname));
|
||||
if(false === $ret) {
|
||||
/* If copy didn't succeed, then there is probably nothing to delete,
|
||||
* but do it anyway, just to be sure not just parts of the extension
|
||||
* has been copied.
|
||||
*/
|
||||
$this->errmsgs[] = "Cannot move temp. extension directory to final destination";
|
||||
$this->rrmdir($this->extdir ."/". $extname);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user