diff --git a/src/Base/Archive/PHPUnzipper.php b/src/Base/Archive/PHPUnzipper.php index 3f2957d9..5e62dcb5 100644 --- a/src/Base/Archive/PHPUnzipper.php +++ b/src/Base/Archive/PHPUnzipper.php @@ -68,6 +68,7 @@ public function __destruct() */ public function extractTo(string $path): void { + $this->zipArchive->extractTo($path); } } diff --git a/src/Console/Command/InstallerCommand.php b/src/Console/Command/InstallerCommand.php index 4da4f5a5..2875846b 100644 --- a/src/Console/Command/InstallerCommand.php +++ b/src/Console/Command/InstallerCommand.php @@ -140,13 +140,11 @@ protected function binaryInstallWindows($path, InputInterface $input, OutputInte $progress = new ProgressBar($output, 100); $inst->setProgress($progress); - $inst->setInput($input); $inst->setOutput($output); $inst->install(); $deps_handler = new Windows\DependencyLib($php); $deps_handler->setProgress($progress); - $deps_handler->setInput($input); $deps_handler->setOutput($output); $helper = $this->getHelperSet()->get('question'); diff --git a/src/Engine/PHP.php b/src/Engine/PHP.php index 9fde8ffa..70134b36 100644 --- a/src/Engine/PHP.php +++ b/src/Engine/PHP.php @@ -212,16 +212,18 @@ protected function getIniPathFromPhpInfo($info) $iniPath = ''; foreach ($info as $s) { - if (strpos($s, 'Loaded Configuration File') !== false) { + if ( + strpos($s, 'Loaded Configuration File') !== false + || strpos($s, 'Additional .ini files parsed') !== false + ) { [, $iniPath] = explode('=>', $s); - if ($iniPath === '(None)') { + if (strtolower(trim($iniPath)) === '(none)') { $iniPath = ''; + continue; } - break; } } - $iniPath = trim($iniPath); if ($iniPath == '') { throw new Exception('Cannot detect php.ini directory'); diff --git a/src/Package/PHP/Command/Install/Windows/Binary.php b/src/Package/PHP/Command/Install/Windows/Binary.php index 06d93927..5d857878 100644 --- a/src/Package/PHP/Command/Install/Windows/Binary.php +++ b/src/Package/PHP/Command/Install/Windows/Binary.php @@ -199,7 +199,7 @@ private function uncompress($zipFile) $this->createTempDir($this->extName); $this->cleanup(); $zipClass = Archive\Factory::getUnzipperClassName(); - $zipArchive = $zipClass($zipFile); + $zipArchive = new $zipClass($zipFile); /** @var \Pickle\Base\Interfaces\Archive\Unzipper $zipArchive */ $this->output->writeln('Extracting archives...'); $zipArchive->extractTo($this->tempDir); @@ -283,7 +283,7 @@ private function copyFiles() if (substr($basename, 0, 4) == 'php_') { $this->extDll[] = $basename; $this->output->writeln("copying {$dll} to " . $dest . "\n"); - $success = copy($dll, $this->php->getExtensionDir() . '/' . $basename); + $success = copy($dll, $dest); if (!$success) { throw new Exception('Cannot copy DLL <' . $dll . '> to <' . $dest . '>'); } diff --git a/src/Package/Util/Windows/DependencyLib.php b/src/Package/Util/Windows/DependencyLib.php index ce910d75..bc17fad6 100644 --- a/src/Package/Util/Windows/DependencyLib.php +++ b/src/Package/Util/Windows/DependencyLib.php @@ -193,7 +193,8 @@ private function fetchDllMap() private function checkDepListerExe() { - $ret = exec('deplister.exe ' . $this->php->getPath() . ' .'); + $deplister = dirname($this->php->getPath()) . DIRECTORY_SEPARATOR . 'deplister.exe '; + $ret = exec($deplister . $this->php->getPath() . ' .'); if (empty($ret)) { $depexe = @file_get_contents(self::DEPLISTER_URL); if (!$depexe) { @@ -210,7 +211,8 @@ private function checkDepListerExe() private function getDllsForBinary($binary) { $out = []; - $ret = exec('deplister.exe ' . escapeshellarg($binary) . ' .', $out); + $deplister = dirname($this->php->getPath()) . DIRECTORY_SEPARATOR . 'deplister.exe '; + $ret = exec($deplister . escapeshellarg($binary) . ' .', $out); if (empty($ret) || !$ret) { throw new RuntimeException('Error while running deplister.exe'); }