当前位置: 首页>>代码示例>>PHP>>正文


PHP Config::getPHPReleaseListPath方法代码示例

本文整理汇总了PHP中PhpBrew\Config::getPHPReleaseListPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getPHPReleaseListPath方法的具体用法?PHP Config::getPHPReleaseListPath怎么用?PHP Config::getPHPReleaseListPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpBrew\Config的用法示例。


在下文中一共展示了Config::getPHPReleaseListPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute()
 {
     $releaseList = new ReleaseList();
     $releases = array();
     //always fetch list from remote when --old presents, because the local file may not contain the old versions
     // and --old is seldom used.
     if (!$releaseList->foundLocalReleaseList() || $this->options->update || $this->options->old) {
         $fetchTask = new FetchReleaseListTask($this->logger, $this->options);
         $releases = $fetchTask->fetch();
     } else {
         $this->logger->info(sprintf('Read local release list (last update: %s UTC).', gmdate('Y-m-d H:i:s', filectime(Config::getPHPReleaseListPath()))));
         $releases = $releaseList->loadLocalReleaseList();
         $this->logger->info('You can run `phpbrew update` or `phpbrew known --update` to get a newer release list.');
     }
     foreach ($releases as $majorVersion => $versions) {
         if (version_compare($majorVersion, '5.2', 'le') && !$this->options->old) {
             continue;
         }
         $versionList = array_keys($versions);
         if (!$this->options->more) {
             array_splice($versionList, 8);
         }
         $this->logger->writeln($this->formatter->format("{$majorVersion}: ", 'yellow') . wordwrap(implode(', ', $versionList), 80, "\n" . str_repeat(' ', 5)) . (!$this->options->more ? ' ...' : ''));
     }
     if ($this->options->old) {
         $this->logger->warn('phpbrew need php 5.3 or above to run. build/switch to versions below 5.3 at your own risk.');
     }
 }
开发者ID:phpbrew,项目名称:phpbrew,代码行数:28,代码来源:KnownCommand.php

示例2: save

 public function save()
 {
     $localFilepath = Config::getPHPReleaseListPath();
     $json = json_encode($this->releases, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
     if (false === file_put_contents($localFilepath, $json)) {
         throw new Exception("Can't store release json file");
     }
 }
开发者ID:cureoeu,项目名称:phpbrew,代码行数:8,代码来源:ReleaseList.php


注:本文中的PhpBrew\Config::getPHPReleaseListPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。