From 2aa7504c19c62245a3cfaebb12beffde40d1cf57 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 4 Mar 2015 20:06:57 +0100 Subject: [PATCH] fix issue #1 --- bin/pharext | Bin 29701 -> 29985 bytes src/pharext/Installer.php | 27 ++++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/bin/pharext b/bin/pharext index 9439186529697a6fc84028ece078cbe847c6609b..4076d33167d62fae46ff122d9bef32a31e93b150 100755 GIT binary patch delta 545 zcmZpD!MN}h%qvMgZoSt(7X zlJLntq;x@)y0kusijW5L+NJeCyzSCPAnG+lPDTbKxYu;}X0bwEeu+Y6oK0ue>Ka=ed-*O=c<`;E94g` zRFxF#0wsXrj*~^yokXD;bdwcyb;~nLGIY~&64QaQ%9|_IpKFieT|0>7 znh@<+^utsDH7e;RW#;KCfs6oJV-2*f7Kn>dOG=CKz(SM#4d)3$?FKnb2^g$Onv=DR zY*mzinjnq>OXw!&=cQ$)D`|p^RRBr?4dUFq%E;bPX4}eh-iy{xTx)o2m&}zgwe;ti O1`|v> delta 332 zcmZ4Zim~+tG~xsW>ftdu5` zVd&%^Qo0~YU0NSRMM#5r?b3Q6-gapt5cL`&CnEzA-0UOsi<2`YvnVyWB)_O~@YQAYj~VsZDpjkLWMmfW+9ejH1IdD- z)U?csTK%NVJbhG|YW3v&+}!*;-MqxyRQ1~0%&JtS$*IP+&Zx?WH$XQzKQApaT|r4t oVe>I#dq)`wj+Vs>Up`Z3+Y~at@{{1?_rePqnHU%t+?{-#01X##7ytkO diff --git a/src/pharext/Installer.php b/src/pharext/Installer.php index d8c7feb..0e7cce4 100644 --- a/src/pharext/Installer.php +++ b/src/pharext/Installer.php @@ -26,13 +26,12 @@ class Installer implements Command CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["q", "quiet", "Less output", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], - ["p", "prefix", "PHP installation directory", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG, - "/usr"], - ["n", "common-name", "PHP common program name, e.g. php5", + ["p", "prefix", "PHP installation prefix if phpize is not in \$PATH, e.g. /opt/php7", + CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], + ["n", "common-name", "PHP common program name, e.g. php5 or zts-php", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG, "php"], - ["c", "configure", "Additional extension configure flags", + ["c", "configure", "Additional extension configure flags, e.g. -c --with-flag", CliArgs::OPTIONAL|CliArgs::MULTI|CliArgs::REQARG], ["s", "sudo", "Installation might need increased privileges", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::OPTARG, @@ -141,13 +140,27 @@ class Installer implements Command $this->info("OK\n"); } + /** + * Construct a command from prefix common-name and suffix + * @param type $suffix + * @return string + */ + private function php($suffix) { + $cmd = $this->args["common-name"] . $suffix; + if (isset($this->args->prefix)) { + $cmd = $this->args->prefix . "/bin/" . $cmd; + } + return $cmd; + } + /** * Prepares, configures, builds and installs the extension */ private function installPackage() { $this->extract(); - $this->exec("phpize", "{$this->args->prefix}/bin/{$this->args->{'common-name'}}ize"); - $this->exec("configure", "./configure --with-php-config={$this->args->prefix}/bin/{$this->args->{'common-name'}}-config ". implode(" ", (array) $this->args->configure)); + $this->exec("phpize", $this->php("ize")); + $this->exec("configure", "./configure --with-php-config=". $this->php("-config") . " ". + implode(" ", (array) $this->args->configure)); $this->exec("make", "make -sj3"); $this->exec("install", "make -s install", true); } -- 2.30.2