X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FInstaller.php;h=589abd611a3384d888826271324cb3aba08d5dfd;hb=3fdb14986895701ae19b30197cbe4247f15b2ca1;hp=7ff112a38c391ae65bd0d36b46a7d176d910c9e6;hpb=4aa1e062368f8ee8e792951d675a811dd97f8699;p=pharext%2Fpharext diff --git a/src/pharext/Installer.php b/src/pharext/Installer.php index 7ff112a..589abd6 100644 --- a/src/pharext/Installer.php +++ b/src/pharext/Installer.php @@ -3,6 +3,8 @@ namespace pharext; use Phar; +use pharext\Cli\Args as CliArgs; +use pharext\Cli\Command as CliCommand; /** * The extension install command executed by the extension phar @@ -73,7 +75,7 @@ class Installer implements Command $phars[$this->tmp] = $phar; foreach ($phars as $phar) { - if (($hook = $phar["pharext_install.php"])) { + if (isset($phar["pharext_install.php"])) { $callable = include $phar["pharext_install.php"]; if (is_callable($callable)) { $recv[] = $callable($this); @@ -120,22 +122,6 @@ class Installer implements Command } } - /** - * Create a new temp directory - * @param string $prefix - * @return string - */ - private function newtemp($prefix) { - $temp = $this->tempname($prefix); - if (!is_dir($temp)) { - if (!mkdir($temp, 0750, true)) { - $this->error(null); - exit(3); - } - } - return $temp; - } - /** * Prepares, configures, builds and installs the extension */ @@ -178,25 +164,6 @@ class Installer implements Command } } - /** - * rm -r - * @param string $dir - */ - private function rm($dir) { - foreach (scandir($dir) as $entry) { - if ($entry === "." || $entry === "..") { - continue; - } elseif (is_dir("$dir/$entry")) { - $this->rm("$dir/$entry"); - } elseif (!unlink("$dir/$entry")) { - $this->error(null); - } - } - if (!rmdir($dir)) { - $this->error(null); - } - } - /** * Execute a program with escalated privileges handling interactive password prompt * @param string $command