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