getVersionBinPath() public static method

public static getVersionBinPath ( $buildName )
Example #1
0
 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";
     }
 }
Example #2
0
 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";
         }
     }
 }