当前位置: 首页>>代码示例>>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;未经允许,请勿转载。