當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::getVersionInstallPrefix方法代碼示例

本文整理匯總了PHP中PhpBrew\Config::getVersionInstallPrefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::getVersionInstallPrefix方法的具體用法?PHP Config::getVersionInstallPrefix怎麽用?PHP Config::getVersionInstallPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhpBrew\Config的用法示例。


在下文中一共展示了Config::getVersionInstallPrefix方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 public function execute()
 {
     $versions = Config::getInstalledPhpVersions();
     $currentVersion = Config::getCurrentPhpName();
     if (empty($versions)) {
         return $this->logger->notice("Please install at least one PHP with your prefered version.");
     }
     if ($currentVersion === false or !in_array($currentVersion, $versions)) {
         $this->logger->writeln("* (system)");
     }
     foreach ($versions as $version) {
         $versionPrefix = Config::getVersionInstallPrefix($version);
         if ($currentVersion == $version) {
             $this->logger->writeln($this->formatter->format(sprintf('* %-15s', $version), 'bold'));
         } else {
             $this->logger->writeln($this->formatter->format(sprintf('  %-15s', $version), 'bold'));
         }
         if ($this->options->dir) {
             $this->logger->writeln(sprintf("    Prefix:   %s", $versionPrefix));
         }
         // TODO: use Build class to get the variants
         if ($this->options->variants && file_exists($versionPrefix . DIRECTORY_SEPARATOR . 'phpbrew.variants')) {
             $info = unserialize(file_get_contents($versionPrefix . DIRECTORY_SEPARATOR . 'phpbrew.variants'));
             echo "    Variants: ";
             echo wordwrap(VariantParser::revealCommandArguments($info), 75, " \\\n              ");
             echo "\n";
         }
     }
 }
開發者ID:WebDevJL,項目名稱:phpbrew,代碼行數:29,代碼來源:ListCommand.php

示例2: execute

 public function execute($buildName)
 {
     $prefix = Config::getVersionInstallPrefix($buildName);
     if (!file_exists($prefix)) {
         throw new Exception("{$prefix} does not exist.");
     }
     $prompter = new \CLIFramework\Prompter();
     $answer = $prompter->ask("Are you sure to delete {$buildName}?", array('Y', 'n'), 'Y');
     if (strtolower($answer) == "y") {
         Utils::recursive_unlink($prefix, $this->logger);
         $this->logger->info("{$buildName} is removed.  I hope you're not surprised. :)");
     } else {
         $this->logger->info("Let me guess, you drunk tonight.");
     }
 }
開發者ID:WebDevJL,項目名稱:phpbrew,代碼行數:15,代碼來源:RemoveCommand.php

示例3: 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

示例4: findByName

 /**
  * Find a installed build by name,
  * currently a $name is a php version, but in future we may have customized
  * name for users.
  *
  * @param  string $name
  * @return Build
  */
 public static function findByName($name)
 {
     $prefix = Config::getVersionInstallPrefix($name);
     if (file_exists($prefix)) {
         // a installation exists
         return new self($name, NULL, $prefix);
     }
     return null;
 }
開發者ID:nanasess,項目名稱:phpbrew,代碼行數:17,代碼來源:Build.php

示例5: removeByVersion

 public function removeByVersion($version, $verbose = false)
 {
     $home = Config::getPhpbrewRoot();
     $buildPrefix = Config::getVersionInstallPrefix($version);
     $this->remove($buildPrefix);
 }
開發者ID:WebDevJL,項目名稱:phpbrew,代碼行數:6,代碼來源:RemoveTask.php


注:本文中的PhpBrew\Config::getVersionInstallPrefix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。