pharext\Task\Make::run PHP Method

run() public method

public run ( boolean $verbose = false )
$verbose boolean
    public function run($verbose = false)
    {
        if ($verbose !== false) {
            printf("Running make");
            if ($this->args) {
                foreach ($this->args as $arg) {
                    printf(" %s", $arg);
                }
            }
            printf(" ...\n");
        }
        $pwd = getcwd();
        if (!chdir($this->cwd)) {
            throw new Exception();
        }
        try {
            $cmd = new ExecCmd("make", $verbose);
            if (isset($this->sudo)) {
                $cmd->setSu($this->sudo);
            }
            $args = $this->args;
            if (!$verbose) {
                $args = array_merge((array) $args, ["-s"]);
            }
            $cmd->run($args);
        } finally {
            chdir($pwd);
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Phpize + trinity
  */
 private function install($temp)
 {
     // phpize
     $phpize = new Task\Phpize($temp, $this->args->prefix, $this->args->{"common-name"});
     $phpize->run($this->verbosity());
     // configure
     $configure = new Task\Configure($temp, $this->args->configure, $this->args->prefix, $this->args->{"common-name"});
     $configure->run($this->verbosity());
     // make
     $make = new Task\Make($temp);
     $make->run($this->verbosity());
     // install
     $sudo = isset($this->args->sudo) ? $this->args->sudo : null;
     $install = new Task\Make($temp, ["install"], $sudo);
     $install->run($this->verbosity());
 }