* @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") {
}
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)) {
}
/* 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();
$cmd->setSu($this->sudo);
}
$cmd->run([$path, $file]);
+
+ if ($verbose) {
+ printf("Replaced %s ...\n", $file);
+ }
return true;
}