当前位置: 首页>>代码示例>>PHP>>正文


PHP Config::getCurrentBuildDir方法代码示例

本文整理汇总了PHP中PhpBrew\Config::getCurrentBuildDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getCurrentBuildDir方法的具体用法?PHP Config::getCurrentBuildDir怎么用?PHP Config::getCurrentBuildDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpBrew\Config的用法示例。


在下文中一共展示了Config::getCurrentBuildDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prepare

 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;
 }
开发者ID:WebDevJL,项目名称:phpbrew,代码行数:13,代码来源:InstallCommand.php

示例2: execute

 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);
     }
 }
开发者ID:WebDevJL,项目名称:phpbrew,代码行数:49,代码来源:ExtensionCommand.php

示例3: execute

 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');
 }
开发者ID:phpbrew,项目名称:phpbrew,代码行数:38,代码来源:CtagsCommand.php

示例4: execute

 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;
     }
 }
开发者ID:phpbrew,项目名称:phpbrew,代码行数:38,代码来源:PathCommand.php


注:本文中的PhpBrew\Config::getCurrentBuildDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。