use new Seeddms\Seeddms\Utilities

This commit is contained in:
Uwe Steinmann 2025-11-14 16:54:58 +01:00
parent b7bd251bc6
commit 25dd7873c9

View File

@ -16,6 +16,8 @@
namespace Seeddms\Seeddms; namespace Seeddms\Seeddms;
use Seeddms\Seeddms\Utilities;
/** /**
* Class to represent an extension manager * Class to represent an extension manager
* *
@ -519,7 +521,7 @@ $EXT_CONF = '.var_export($EXT_CONF, true).';');
$newdir = addDirSep($this->cachedir)."ext.new"; $newdir = addDirSep($this->cachedir)."ext.new";
/* First remove a left over from a previous extension */ /* First remove a left over from a previous extension */
if(file_exists($newdir)) { if(file_exists($newdir)) {
SeedDMS_Utils::rrmdir($newdir); Utilities::rrmdir($newdir);
} }
if(!mkdir($newdir, 0755)) { if(!mkdir($newdir, 0755)) {
$this->errmsgs[] = "Cannot create temp. extension directory"; $this->errmsgs[] = "Cannot create temp. extension directory";
@ -539,7 +541,7 @@ $EXT_CONF = '.var_export($EXT_CONF, true).';');
/* Check if extension is complete and fullfills the constraints */ /* Check if extension is complete and fullfills the constraints */
if(!self::checkExtensionByDir($newdir)) { if(!self::checkExtensionByDir($newdir)) {
SeedDMS_Utils::rrmdir($newdir); Utilities::rrmdir($newdir);
return false; return false;
} }
@ -550,11 +552,11 @@ $EXT_CONF = '.var_export($EXT_CONF, true).';');
if(!is_dir($this->extdir)) { if(!is_dir($this->extdir)) {
if(!mkdir($this->extdir, 0755)) { if(!mkdir($this->extdir, 0755)) {
$this->errmsgs[] = "Cannot create extension directory"; $this->errmsgs[] = "Cannot create extension directory";
SeedDMS_Utils::rrmdir($newdir); Utilities::rrmdir($newdir);
return false; return false;
} }
} elseif(is_dir($this->extdir ."/". $extname)) { } elseif(is_dir($this->extdir ."/". $extname)) {
SeedDMS_Utils::rrmdir($this->extdir ."/". $extname); Utilities::rrmdir($this->extdir ."/". $extname);
} }
/* Move the temp. created ext directory to the final location */ /* Move the temp. created ext directory to the final location */
/* rename() may fail if dirs are moved from one device to another. /* rename() may fail if dirs are moved from one device to another.
@ -576,7 +578,7 @@ $EXT_CONF = '.var_export($EXT_CONF, true).';');
* has been copied. * has been copied.
*/ */
$this->errmsgs[] = "Cannot move temp. extension directory to final destination"; $this->errmsgs[] = "Cannot move temp. extension directory to final destination";
SeedDMS_Utils::rrmdir($this->extdir ."/". $extname); Utilities::rrmdir($this->extdir ."/". $extname);
return false; return false;
} }