public function check(Build $build) { $apxs = $build->getVariant('apxs2'); // trying to find apxs binary in case it wasn't explicitly specified (+apxs variant without path) if ($apxs === true) { $apxs = Utils::findbin('apxs'); $this->logger->debug("Found apxs2 binary: {$apxs}"); } if (!is_executable($apxs)) { throw new Exception("apxs binary is not executable: {$apxs}"); } // use apxs to check module dir permission if ($apxs && ($libdir = trim(Utils::pipeExecute("{$apxs} -q LIBEXECDIR")))) { if (false === is_writable($libdir)) { throw new Exception("Apache module dir {$libdir} is not writable.\nPlease consider using chmod or sudo."); } } if ($apxs && ($confdir = trim(Utils::pipeExecute("{$apxs} -q SYSCONFDIR")))) { if (false === is_writable($confdir)) { $msg = array(); $msg[] = "Apache conf dir {$confdir} is not writable for phpbrew."; $msg[] = "Please consider using chmod or sudo: "; $msg[] = " \$ sudo chmod -R og+rw {$confdir}"; throw new Exception(join("\n", $msg)); } } }
public function check(Build $build) { $apxs = $build->getVariant('apxs2'); // trying to find apxs binary in case it wasn't explicitly specified (+apxs variant without path) if ($apxs === true) { $apxs = Utils::findbin('apxs'); $this->logger->debug("Found apxs2 binary: {$apxs}"); } if (!is_executable($apxs)) { throw new Exception("apxs binary is not executable: {$apxs}"); } // use apxs to check module dir permission if ($apxs && ($libdir = trim(Utils::pipeExecute("{$apxs} -q LIBEXECDIR")))) { if (false === is_writable($libdir)) { $this->logger->error("Apache module dir {$libdir} is not writable.\nPlease consider using chmod to change the folder permission:"); $this->logger->error(" \$ sudo chmod -R oga+rw {$libdir}"); $this->logger->error("Warnings: the command above is not safe for public systems. please use with discretion."); throw new Exception(); } } if ($apxs && ($confdir = trim(Utils::pipeExecute("{$apxs} -q SYSCONFDIR")))) { if (false === is_writable($confdir)) { $this->logger->error("Apache conf dir {$confdir} is not writable for phpbrew."); $this->logger->error("Please consider using chmod to change the folder permission: "); $this->logger->error(" \$ sudo chmod -R oga+rw {$confdir}"); $this->logger->error("Warnings: the command above is not safe for public systems. please use with discretion."); throw new Exception(); } } }
public function check(Build $build) { $apxs = $build->getVariant('apxs2'); if (!$apxs) { $apxs = Utils::findbin('apxs'); } $this->logger->debug("Found apxs2 sbin: {$apxs}"); // use apxs to check module dir permission if ($apxs && ($libdir = trim(Utils::pipeExecute("{$apxs} -q LIBEXECDIR")))) { if (false === is_writable($libdir)) { $msg = array(); throw new Exception("Apache module dir {$libdir} is not writable.\nPlease consider using chmod or sudo."); } } if ($apxs && ($confdir = trim(Utils::pipeExecute("{$apxs} -q SYSCONFDIR")))) { if (false === is_writable($confdir)) { $msg = array(); $msg[] = "Apache conf dir {$confdir} is not writable for phpbrew."; $msg[] = "Please consider using chmod or sudo: "; $msg[] = " \$ sudo chmod -R og+rw {$confdir}"; throw new Exception(join("\n", $msg)); } } }
protected function isCurlCommandAvailable() { return Utils::findbin('curl'); }
public function hasSupport($requireSsl) { return Utils::findbin('curl'); }