本文整理汇总了PHP中XenForo_Application::setSimpleCacheData方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Application::setSimpleCacheData方法的具体用法?PHP XenForo_Application::setSimpleCacheData怎么用?PHP XenForo_Application::setSimpleCacheData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Application
的用法示例。
在下文中一共展示了XenForo_Application::setSimpleCacheData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _set
protected function _set($users, $time = null)
{
if ($time == NULL) {
$time = XenForo_Application::$time;
}
XenForo_Application::setSimpleCacheData(self::CACHE_KEY, array($time, $users));
}
示例2: verifyOption
public static function verifyOption(array &$values, XenForo_DataWriter $dw, $fieldName)
{
if (!$values) {
XenForo_Application::setSimpleCacheData('xengalleryStatisticsCache', false);
}
return true;
}
示例3: runCron
public static function runCron()
{
$Model = XenForo_Model::create('Turki_Adv_Model_View');
$Advs = $Model->getAllAdvHooks();
$adv_xenforo = array("AdvsHook" => $Advs);
XenForo_Application::setSimpleCacheData('adv_xenforo', $adv_xenforo);
}
示例4: verifyOption
public static function verifyOption(&$value, XenForo_DataWriter $dw, $fieldName)
{
XenForo_Application::setSimpleCacheData('taigachat_lastUpdate', XenForo_Application::$time);
/** @var Dark_TaigaChat_Model_TaigaChat */
$taigaModel = XenForo_Model::create("Dark_TaigaChat_Model_TaigaChat");
$taigaModel->regeneratePublicHtml($value);
return true;
}
示例5: removeCopyrightNotice
/**
*
* @param array $matches
* @return string
*/
public static function removeCopyrightNotice(array $matches)
{
$copyrightModification = XenForo_Application::getSimpleCacheData(parent::COPYRIGHT_MODIFICATION_SIMPLE_CACHE_KEY);
if ($copyrightModification < XenForo_Application::$time) {
XenForo_Application::setSimpleCacheData(parent::COPYRIGHT_MODIFICATION_SIMPLE_CACHE_KEY, XenForo_Application::$time);
}
return $matches[0];
}
示例6: getAllCachedCollections
public function getAllCachedCollections()
{
$collections = XenForo_Application::getSimpleCacheData(self::$allCacheKey);
if (!$collections) {
$collections = $this->getCollections();
XenForo_Application::setSimpleCacheData(self::$allCacheKey, $collections);
}
return $collections;
}
示例7: getAllCachedFields
public function getAllCachedFields()
{
$fields = XenForo_Application::getSimpleCacheData(self::$allCacheKey);
if (!$fields) {
$fields = $this->getFields();
XenForo_Application::setSimpleCacheData(self::$allCacheKey, $fields);
}
return $fields;
}
示例8: rebuildUserBannerGroupCache
public function rebuildUserBannerGroupCache()
{
$userBannerGroups = $this->getUserBannerGroups();
if ($userBannerGroups) {
XenForo_Application::setSimpleCacheData('th_userBannerGroups', $userBannerGroups);
} elseif (XenForo_Application::getSimpleCacheData('th_userBannerGroups')) {
XenForo_Application::setSimpleCacheData('th_userBannerGroups', false);
}
return $userBannerGroups;
}
示例9: uninstall
public static function uninstall()
{
$db = XenForo_Application::get('db');
$db->query("DROP TABLE IF EXISTS bbm");
$db->query("DROP TABLE IF EXISTS bbm_buttons");
if ($db->fetchRow('SHOW COLUMNS FROM xf_forum WHERE Field = ?', 'bbm_bm_editor')) {
$db->query("ALTER TABLE xf_forum DROP bbm_bm_editor");
}
XenForo_Model::create('XenForo_Model_DataRegistry')->delete('bbm_buttons');
XenForo_Application::setSimpleCacheData('bbm_active', false);
}
示例10: getAllNodes
public function getAllNodes()
{
if ($this->_nodes === null) {
$nodes = XenForo_Application::getSimpleCacheData(self::$nodesCacheKey);
if ($nodes === false) {
$nodes = $this->_getNodeModel()->getAllNodes();
XenForo_Application::setSimpleCacheData(self::$nodesCacheKey, $nodes);
}
$this->_nodes = $nodes;
}
return $this->_nodes;
}
示例11: saveGroupPermDataCache
public function saveGroupPermDataCache()
{
$groups = $this->getGroups();
foreach ($groups as &$group) {
if (!is_array($group['permissions'])) {
$group['permissions'] = @unserialize($group['permissions']);
}
}
if (!defined('TEAM_DATAREGISTRY_KEY')) {
define('TEAM_DATAREGISTRY_KEY', 'Teams_group_perms');
}
XenForo_Application::setSimpleCacheData(TEAM_DATAREGISTRY_KEY, $groups);
return $groups;
}
示例12: runStatisticsUpdate
/**
* Updates statistics for XenForo Media Gallery.
*/
public static function runStatisticsUpdate()
{
/** @var $categoryModel XenGallery_Model_Category */
$categoryModel = XenForo_Model::create('XenGallery_Model_Category');
/** @var $albumModel XenGallery_Model_Album */
$albumModel = XenForo_Model::create('XenGallery_Model_Album');
/** @var $mediaModel XenGallery_Model_Media */
$mediaModel = XenForo_Model::create('XenGallery_Model_Media');
/** @var $commentModel XenGallery_Model_Comment */
$commentModel = XenForo_Model::create('XenGallery_Model_Comment');
$statisticsCache = array('category_count' => $categoryModel->getCategoryCount(), 'album_count' => $albumModel->countAlbums(), 'upload_count' => $mediaModel->countMedia(array('media_type' => array('image_upload', 'video_upload')), array('join' => XenGallery_Model_Media::FETCH_ALBUM)), 'embed_count' => $mediaModel->countMedia(array('media_type' => 'video_embed'), array('join' => XenGallery_Model_Media::FETCH_ALBUM)), 'comment_count' => $commentModel->countComments(), 'disk_usage' => $mediaModel->calculateMediaDiskUsage());
XenForo_Application::setSimpleCacheData('xengalleryStatisticsCache', $statisticsCache);
return true;
}
示例13: rebuildChildNodesCache
public static function rebuildChildNodesCache()
{
$nodeModel = XenForo_Model::create('XenForo_Model_Node');
$nodeId = WidgetFramework_Option::get('indexNodeId');
$childNodes = array();
if ($nodeId > 0) {
$widgetPage = $nodeModel->getNodeById($nodeId);
if (!empty($widgetPage)) {
$childNodes = $nodeModel->getChildNodes($widgetPage, true);
XenForo_Application::setSimpleCacheData(self::SIMPLE_CACHE_CHILD_NODES, $childNodes);
}
}
return $childNodes;
}
示例14: getShortUrlLengthHttps
public function getShortUrlLengthHttps($token)
{
$data = XenForo_Application::getSimpleCacheData(self::SIMPLE_CACHE_DATA_KEY_SHORT_URL_LENGTH_HTTPS);
if (empty($data) or XenForo_Application::$time - $data['timestamp'] > 86400) {
$response = bdSocialShare_Helper_Twitter::helpConfiguration($token['oauth_token'], $token['oauth_token_secret']);
if (!empty($response['short_url_length_https'])) {
$data = array('value' => $response['short_url_length_https'], 'timestamp' => time());
XenForo_Application::setSimpleCacheData(self::SIMPLE_CACHE_DATA_KEY_SHORT_URL_LENGTH_HTTPS, $data);
} else {
// for some reason we cannot get configuration from Twitter,
// return our best guess then: as of September 13, 2014 it is 23
return 30;
}
}
return $data['value'];
}
示例15: getInstances
public static function getInstances()
{
if (!self::$_instance) {
/* @var $self sonnbUpThread_Model_Up*/
$self = self::create('sonnbUpThread_Model_Up');
if (!$self->_nodes) {
$nodes = XenForo_Application::getSimpleCacheData($self->_nodesCacheKey);
if ($nodes === false) {
$nodes = $self->_getNodeModel()->getAllNodes();
XenForo_Application::setSimpleCacheData($self->_nodesCacheKey, $nodes);
}
$self->_nodes = $nodes;
}
self::$_instance = $self;
}
return self::$_instance;
}