本文整理汇总了PHP中Prefs::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::getInstance方法的具体用法?PHP Prefs::getInstance怎么用?PHP Prefs::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prefs
的用法示例。
在下文中一共展示了Prefs::getInstance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DEFINE
// comment this out for local debug copy
require_once 'Savant3.php';
# taken from http://stackoverflow.com/a/12583387/788054
# TBS cannot use DEFINE(), so these are variables
define('ABS_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
define('BASE_PATH', '/' . substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])) . '/');
# to be deprecated - currently strongly discouraged in official documentation -gg
#function __autoload($class) {
# require_once('lib/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php');
#}
# new style using spl_autoload_register:
spl_autoload_register(function ($class) {
require_once 'lib/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
});
Emdr::$regions = json_decode(file_get_contents(ABS_PATH . '/emdr/regions.json'), true);
Prefs::getInstance();
$tpl = new Savant3();
$tpl->addPath('template', 'templates/bootstrap');
$tpl->addPath('resource', 'lib');
$tpl->siteTime = new Timer();
$tpl->emdrDown = false;
# https://forums.eveonline.com/default.aspx?g=posts&m=2508255
$regions = json_decode(file_get_contents(dirname(__FILE__) . '/emdr/regions.json'), true);
Emdr::setRegion(Prefs::get('region'));
# If price of Tritanium is more than 12 hours old, then something has happened with EMDR consumer
# Set template variable to display warning to user when this happens
if (time() - (new Price(Emdr::get(34)))->generatedAt > 60 * 60 * 12) {
$tpl->emdrDown = true;
}
$tpl->webkitFix = preg_match("#.+WebKit/(\\H+)+\\s.+?#s", $_SERVER['HTTP_USER_AGENT'], $matches) && $matches[1] < 535 ? true : false;