本文整理汇总了PHP中KunenaAccess::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaAccess::instance方法的具体用法?PHP KunenaAccess::instance怎么用?PHP KunenaAccess::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaAccess
的用法示例。
在下文中一共展示了KunenaAccess::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
static public function getInstance($integration = null) {
KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
if (self::$instance === false) {
if (! $integration) {
$integration = KunenaFactory::getConfig ()->integration_access;
}
self::$instance = KunenaIntegration::initialize ( 'access', $integration );
// Load administrators and moderators
$cache = JFactory::getCache('com_kunena', 'output');
$data = $cache->get(self::$cacheKey, 'com_kunena');
if ($data) {
$data = unserialize($data);
self::$adminsByCatid = (array)$data['ac'];
self::$adminsByUserid = (array)$data['au'];
self::$moderatorsByCatid = (array)$data['mc'];
self::$moderatorsByUserid = (array)$data['mu'];
}
//$my = JFactory::getUser();
// If values were not cached (or users permissions have been changed), force reload
if (!$data) { // || ($my->id && $my->authorize('com_kunena', 'administrator') == empty(self::$adminsByUserid[$my->id][0]) )) {
self::$instance->clearCache();
}
}
KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
return self::$instance;
}
示例2: getInstance
public static function getInstance() {
KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
if (!self::$instance) {
self::$instance = new KunenaAccess();
}
KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
return self::$instance;
}
示例3: getInstance
public static function getInstance($integration = null)
{
if (self::$instance === false) {
$config = KunenaFactory::getConfig();
if (!$integration) {
$integration = $config->integration_access;
}
self::$instance = KunenaIntegration::initialize('access', $integration);
}
return self::$instance;
}