本文整理汇总了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;
}
示例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);
}
}
示例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');
}
示例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;
}
}