X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FTask%2FActivate.php;h=6a892e89741af32edcaa38077f6e1dfe6327d6b2;hb=718c0d224ba3ad3816c04a2b514fc011956c582f;hp=1bbd9a86fc6200a00bd6ac8c2e7fcc542b4049ca;hpb=34284101c2aa60ec1e824a54de543148aaa28b58;p=pharext%2Fpharext diff --git a/src/pharext/Task/Activate.php b/src/pharext/Task/Activate.php index 1bbd9a8..6a892e8 100644 --- a/src/pharext/Task/Activate.php +++ b/src/pharext/Task/Activate.php @@ -65,6 +65,9 @@ class Activate implements Task * @return boolean false, if extension was already activated */ public function run($verbose = false) { + if ($verbose !== false) { + printf("Running INI activation ...\n"); + } $extension = basename(current(glob("{$this->cwd}/modules/*.so"))); if ($this->type === "zend_extension") { @@ -74,6 +77,12 @@ class Activate implements Task } foreach ($this->inis as $file) { + if ($verbose) { + printf("Checking %s ...\n", $file); + } + if (!file_exists($file)) { + throw new Exception(sprintf("INI file '%s' does not exist", $file)); + } $temp = new Tempfile("phpini"); foreach (file($file) as $line) { if (preg_match("/^\s*{$this->type}\s*=\s*[\"']?{$pattern}[\"']?\s*(;.*)?\$/", $line)) { @@ -84,6 +93,9 @@ class Activate implements Task } /* not found; append to last processed file, which is the main by default */ + if ($verbose) { + printf("Activating in %s ...\n", $file); + } fprintf($temp->getStream(), $this->type . "=%s\n", $extension); $temp->closeStream(); @@ -112,6 +124,10 @@ class Activate implements Task $cmd->setSu($this->sudo); } $cmd->run([$path, $file]); + + if ($verbose) { + printf("Replaced %s ...\n", $file); + } return true; }