X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FTask%2FActivate.php;h=3d7e05f017604863a469042634a5e362a7d249c5;hb=337e76964be2ed6724633ac477affc3a28426c97;hp=1bbd9a86fc6200a00bd6ac8c2e7fcc542b4049ca;hpb=34284101c2aa60ec1e824a54de543148aaa28b58;p=pharext%2Fpharext diff --git a/src/pharext/Task/Activate.php b/src/pharext/Task/Activate.php index 1bbd9a8..3d7e05f 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,9 @@ class Activate implements Task } foreach ($this->inis as $file) { + if ($verbose) { + printf("Checking %s ...\n", $file); + } $temp = new Tempfile("phpini"); foreach (file($file) as $line) { if (preg_match("/^\s*{$this->type}\s*=\s*[\"']?{$pattern}[\"']?\s*(;.*)?\$/", $line)) { @@ -84,6 +90,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 +121,10 @@ class Activate implements Task $cmd->setSu($this->sudo); } $cmd->run([$path, $file]); + + if ($verbose) { + printf("Replaced %s ...\n", $file); + } return true; }