getCurrentBuildDir() public static method

public static getCurrentBuildDir ( )
Example #1
0
 public function prepare()
 {
     parent::prepare();
     $buildDir = Config::getCurrentBuildDir();
     $extDir = $buildDir . DIRECTORY_SEPARATOR . 'ext';
     if (!is_dir($extDir)) {
         $this->logger->error("Error: The ext directory '{$extDir}' does not exist.");
         $this->logger->error("It looks like you don't have the PHP source in {$buildDir} or you didn't extract the tarball.");
         $this->logger->error("Suggestion: Please install at least one PHP with your prefered version and switch to it.");
         return false;
     }
     return true;
 }
Example #2
0
 public function execute()
 {
     $buildDir = Config::getCurrentBuildDir();
     $extDir = $buildDir . DIRECTORY_SEPARATOR . 'ext';
     // list for extensions which are not enabled
     $extensions = array();
     $extensionNames = array();
     // some extension source not in root directory
     $lookupDirectories = array('', 'ext', 'extension');
     if (file_exists($extDir) && is_dir($extDir)) {
         $this->logger->debug("Scanning {$extDir}...");
         foreach (scandir($extDir) as $extName) {
             if ($extName == "." || $extName == "..") {
                 continue;
             }
             $dir = $extDir . DIRECTORY_SEPARATOR . $extName;
             foreach ($lookupDirectories as $lookupDirectory) {
                 $extensionDir = $dir . (empty($lookupDirectory) ? '' : DIRECTORY_SEPARATOR . $lookupDirectory);
                 if ($m4files = ExtensionFactory::configM4Exists($extensionDir)) {
                     $this->logger->debug("Loading extension information {$extName} from {$extensionDir}");
                     foreach ($m4files as $m4file) {
                         try {
                             $ext = ExtensionFactory::createM4Extension($extName, $m4file);
                             // $ext = ExtensionFactory::createFromDirectory($extName, $dir);
                             $extensions[$ext->getExtensionName()] = $ext;
                             $extensionNames[] = $extName;
                             break;
                         } catch (Exception $e) {
                         }
                     }
                     break;
                 }
             }
         }
     }
     $this->logger->info('Loaded extensions:');
     foreach ($extensions as $extName => $ext) {
         if (extension_loaded($extName)) {
             $this->describeExtension($ext);
         }
     }
     $this->logger->info('Available local extensions:');
     foreach ($extensions as $extName => $ext) {
         if (extension_loaded($extName)) {
             continue;
         }
         $this->describeExtension($ext);
     }
 }
Example #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');
 }
Example #4
0
 public function execute($name)
 {
     switch ($name) {
         case 'root':
             echo Config::getRoot();
             break;
         case 'home':
             echo Config::getHome();
             break;
         case 'config-scan':
             echo Config::getCurrentPhpConfigScanPath();
             break;
         case 'dist':
             echo Config::getDistFileDir();
             break;
         case 'build':
             echo Config::getCurrentBuildDir();
             break;
         case 'bin':
             echo Config::getCurrentPhpBin();
             break;
         case 'include':
             echo Config::getVersionInstallPrefix(Config::getCurrentPhpName()) . DIRECTORY_SEPARATOR . 'include';
             break;
         case 'extension-src':
         case 'ext-src':
             echo Config::getCurrentBuildDir() . DIRECTORY_SEPARATOR . 'ext';
             break;
         case 'extension-dir':
         case 'ext-dir':
         case 'ext':
             echo ini_get('extension_dir');
             break;
         case 'etc':
             echo Config::getVersionInstallPrefix(Config::getCurrentPhpName()) . DIRECTORY_SEPARATOR . 'etc';
             break;
     }
 }