本文整理汇总了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());
}
示例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))));
}
}