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


PHP Settings::getRevision方法代碼示例

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


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

示例1: testInstallMode

 /**
  * @covers \thebuggenie\core\framework\Context::isInstallmode
  * @covers \thebuggenie\core\framework\Context::checkInstallMode
  */
 public function testInstallMode()
 {
     $installed_file = THEBUGGENIE_PATH . 'installed';
     if (file_exists($installed_file)) {
         unlink($installed_file);
     }
     \thebuggenie\core\framework\Context::checkInstallMode();
     $this->assertTrue(\thebuggenie\core\framework\Context::isInstallmode());
     file_put_contents($installed_file, \thebuggenie\core\framework\Settings::getMajorVer() . "." . \thebuggenie\core\framework\Settings::getMinorVer() . "." . \thebuggenie\core\framework\Settings::getRevision() . ", installed today");
     \thebuggenie\core\framework\Context::checkInstallMode();
     $this->assertFalse(\thebuggenie\core\framework\Context::isInstallmode());
 }
開發者ID:founderio,項目名稱:thebuggenie,代碼行數:16,代碼來源:ContextTest.php

示例2: runCheckUpdates

 /**
  * check for updates
  *
  * @param framework\Request $request
  */
 public function runCheckUpdates(framework\Request $request)
 {
     $data = json_decode(file_get_contents('http://www.thebuggenie.com/updatecheck.php'));
     if (!is_object($data)) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('title' => framework\Context::getI18n()->__('Failed to check for updates'), 'message' => framework\Context::getI18n()->__('The response from The Bug Genie website was invalid')));
     }
     $outofdate = false;
     // major
     if ($data->maj > framework\Settings::getMajorVer()) {
         $outofdate = true;
     } elseif ($data->min > framework\Settings::getMinorVer() && $data->maj == framework\Settings::getMajorVer()) {
         $outofdate = true;
     } elseif ($data->rev > framework\Settings::getRevision() && $data->maj == framework\Settings::getMajorVer() && $data->min == framework\Settings::getMinorVer()) {
         $outofdate = true;
     }
     if (!$outofdate) {
         return $this->renderJSON(array('uptodate' => true, 'title' => framework\Context::getI18n()->__('The Bug Genie is up to date'), 'message' => framework\Context::getI18n()->__('The latest version is %ver', array('%ver' => $data->nicever))));
     } else {
         return $this->renderJSON(array('uptodate' => false, 'title' => framework\Context::getI18n()->__('The Bug Genie is out of date'), 'message' => framework\Context::getI18n()->__('The latest version is %ver. Update now from www.thebuggenie.com.', array('%ver' => $data->nicever))));
     }
 }
開發者ID:nrensen,項目名稱:thebuggenie,代碼行數:27,代碼來源:Main.php


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