本文整理汇总了PHP中PhpBrew\Config::getVersionBinPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getVersionBinPath方法的具体用法?PHP Config::getVersionBinPath怎么用?PHP Config::getVersionBinPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpBrew\Config
的用法示例。
在下文中一共展示了Config::getVersionBinPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($version = null)
{
// get current version
if (!$version) {
$version = getenv('PHPBREW_PHP');
}
// $currentVersion;
$root = Config::getPhpbrewRoot();
$home = Config::getPhpbrewHome();
$lookup = getenv('PHPBREW_LOOKUP_PREFIX');
// $versionBuildPrefix = Config::getVersionBuildPrefix($version);
// $versionBinPath = Config::getVersionBinPath($version);
echo "export PHPBREW_ROOT={$root}\n";
echo "export PHPBREW_HOME={$home}\n";
echo "export PHPBREW_LOOKUP_PREFIX={$lookup}\n";
if ($version !== false) {
// checking php version exists
$version = Utils::findLatestPhpVersion($version);
$targetPhpBinPath = Config::getVersionBinPath($version);
if (!is_dir($targetPhpBinPath)) {
throw new Exception("# php version: " . $version . " not exists.");
}
echo 'export PHPBREW_PHP=' . $version . "\n";
echo 'export PHPBREW_PATH=' . ($version ? Config::getVersionBinPath($version) : '') . "\n";
}
}
示例2: execute
public function execute($buildName = NULL)
{
// get current version
if (!$buildName) {
$buildName = getenv('PHPBREW_PHP');
}
// $currentVersion;
$root = Config::getPhpbrewRoot();
$home = Config::getPhpbrewHome();
$lookup = getenv('PHPBREW_LOOKUP_PREFIX');
$this->logger->writeln("export PHPBREW_ROOT={$root}");
$this->logger->writeln("export PHPBREW_HOME={$home}");
$this->logger->writeln("export PHPBREW_LOOKUP_PREFIX={$lookup}");
if ($buildName !== false) {
// checking php version existence
$targetPhpBinPath = Config::getVersionBinPath($buildName);
if (is_dir($targetPhpBinPath)) {
echo 'export PHPBREW_PHP=' . $buildName . "\n";
echo 'export PHPBREW_PATH=' . ($buildName ? Config::getVersionBinPath($buildName) : '') . "\n";
}
}
}