當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。