__toString() public method

public __toString ( )
Ejemplo n.º 1
0
 public function execute()
 {
     $args = func_get_args();
     // $currentVersion;
     $root = Config::getPhpbrewRoot();
     $home = Config::getPhpbrewHome();
     $buildDir = Config::getBuildDir();
     $version = getenv('PHPBREW_PHP');
     // XXX: get source dir from current build information
     $sourceDir = $buildDir . DIRECTORY_SEPARATOR . $version;
     $this->logger->info($sourceDir);
     $cmd = new CommandBuilder('ctags');
     $cmd->arg('--recurse');
     $cmd->arg('-a');
     $cmd->arg('-h');
     $cmd->arg('.c.h.cpp');
     $cmd->arg($sourceDir . DIRECTORY_SEPARATOR . 'main');
     $cmd->arg($sourceDir . DIRECTORY_SEPARATOR . 'ext');
     $cmd->arg($sourceDir . DIRECTORY_SEPARATOR . 'Zend');
     foreach ($args as $a) {
         $cmd->arg($a);
     }
     $this->logger->info($cmd->__toString());
     $cmd->execute();
     $this->logger->info("Done");
 }
Ejemplo n.º 2
0
 public function build($build, $options)
 {
     $this->info("===> Building...");
     $cmd = new CommandBuilder('make');
     $cmd->append = true;
     if ($this->logPath) {
         $cmd->stdout = $this->logPath;
     }
     if ($options->nice) {
         $cmd->nice($options->nice);
     }
     if ($makeJobs = $options->{'make-jobs'}) {
         $cmd->addArg("-j{$makeJobs}");
     }
     $this->debug($cmd->__toString());
     if (!$options->dryrun) {
         $startTime = microtime(true);
         $cmd->execute() !== false or die('Make failed.');
         $buildTime = ceil((microtime(true) - $startTime) / 60);
         $this->info("Build finished: {$buildTime} minutes.");
     }
 }
Ejemplo n.º 3
0
 public function execute($versionName = null)
 {
     $args = func_get_args();
     array_shift($args);
     // $currentVersion;
     $root = Config::getRoot();
     $home = Config::getHome();
     if ($versionName) {
         $sourceDir = Config::getBuildDir() . DIRECTORY_SEPARATOR . $versionName;
     } else {
         if (!getenv('PHPBREW_PHP')) {
             $this->logger->error('Error: PHPBREW_PHP environment variable is not defined.');
             $this->logger->error('  This command requires you specify a PHP version from your build list.');
             $this->logger->error("  And it looks like you haven't switched to a version from the builds that were built with PHPBrew.");
             $this->logger->error('Suggestion: Please install at least one PHP with your prefered version and switch to it.');
             return false;
         }
         $sourceDir = Config::getCurrentBuildDir();
     }
     if (!file_exists($sourceDir)) {
         return $this->logger->error("{$sourceDir} does not exist.");
     }
     $this->logger->info('Scanning ' . $sourceDir);
     $cmd = new CommandBuilder('ctags');
     $cmd->arg('-R');
     $cmd->arg('-a');
     $cmd->arg('-h');
     $cmd->arg('.c.h.cpp');
     $cmd->arg($sourceDir . DIRECTORY_SEPARATOR . 'main');
     $cmd->arg($sourceDir . DIRECTORY_SEPARATOR . 'ext');
     $cmd->arg($sourceDir . DIRECTORY_SEPARATOR . 'Zend');
     foreach ($args as $a) {
         $cmd->arg($a);
     }
     $this->logger->debug($cmd->__toString());
     $cmd->execute();
     $this->logger->info('Done');
 }