本文整理汇总了PHP中cleartemplatecache函数的典型用法代码示例。如果您正苦于以下问题:PHP cleartemplatecache函数的具体用法?PHP cleartemplatecache怎么用?PHP cleartemplatecache使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cleartemplatecache函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onCloudSetApps
public function onCloudSetApps($apps)
{
if (!is_array($apps)) {
return false;
}
$appService = Cloud::loadClass('Service_App');
$utilService = Cloud::loadClass('Service_Util');
$res = array();
$res['apiVersion'] = $utilService->getApiVersion();
foreach ($apps as $appName => $status) {
$res[$appName] = $appService->setCloudAppStatus($appName, $status, false, false);
}
try {
require_once libfile('function/cache');
updatecache(array('plugin', 'setting', 'styles'));
cleartemplatecache();
} catch (Exception $e) {
}
$res['siteInfo'] = $this->_getBaseInfo();
return $res;
}
示例2: setCloudAppStatus
public function setCloudAppStatus($appName, $status, $cache = true, $updateCache = true)
{
$method = '_' . strtolower($appName) . 'StatusCallback';
if (!method_exists($this, $method)) {
throw new Cloud_Service_AppException('Cloud callback: ' . $method . ' not exists!', 51001);
}
try {
$callbackRes = $this->{$method}($appName, $status);
} catch (Exception $e) {
throw new Cloud_Service_AppException($e);
}
if (!$callbackRes) {
throw new Cloud_Service_AppException('Cloud callback: ' . $method . ' error!', 51003);
}
$apps = $this->getCloudApps($cache);
$app = array('name' => $appName, 'status' => $status);
$apps[$appName] = $app;
C::t('common_setting')->update('cloud_apps', $apps);
if ($updateCache) {
require_once libfile('function/cache');
updatecache(array('plugin', 'setting', 'styles'));
cleartemplatecache();
}
return true;
}
示例3: exit
* This is NOT a freeware, use is subject to license terms
*
* $Id: misc_initsys.php 27433 2012-01-31 08:16:01Z monkey $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (!($_G['adminid'] == 1 && $_GET['formhash'] == formhash()) && $_G['setting']) {
exit('Access Denied');
}
require_once libfile('function/cache');
updatecache();
require_once libfile('function/block');
blockclass_cache();
if ($_G['config']['output']['tplrefresh']) {
cleartemplatecache();
}
$plugins = array('qqconnect', 'cloudstat', 'soso_smilies', 'cloudsearch', 'qqgroup', 'security', 'xf_storage', 'mobile');
$opens = array('mobile');
require_once libfile('function/plugin');
require_once libfile('function/admincp');
foreach ($plugins as $pluginid) {
$importfile = DISCUZ_ROOT . './source/plugin/' . $pluginid . '/discuz_plugin_' . $pluginid . '.xml';
if (!file_exists($importfile)) {
continue;
}
$importtxt = @implode('', file($importfile));
$pluginarray = getimportdata('Discuz! Plugin', $importtxt);
$plugin = C::t('common_plugin')->fetch_by_identifier($pluginid);
if ($plugin) {
$modules = unserialize($plugin['modules']);
示例4: pluginupgrade
function pluginupgrade($pluginarray, $installtype)
{
if (!$pluginarray || !$pluginarray['plugin']['identifier']) {
return false;
}
$plugin = C::t('common_plugin')->fetch_by_identifier($pluginarray['plugin']['identifier']);
if (!$plugin) {
return false;
}
if (is_array($pluginarray['var'])) {
$pluginvars = $pluginvarsnew = array();
foreach (C::t('common_pluginvar')->fetch_all_by_pluginid($plugin['pluginid']) as $pluginvar) {
$pluginvars[] = $pluginvar['variable'];
}
foreach ($pluginarray['var'] as $config) {
if (!in_array($config['variable'], $pluginvars)) {
$data = array('pluginid' => $plugin[pluginid]);
foreach ($config as $key => $val) {
$data[$key] = $val;
}
C::t('common_pluginvar')->insert($data);
} else {
$data = array();
foreach ($config as $key => $val) {
if ($key != 'value') {
$data[$key] = $val;
}
}
if ($data) {
C::t('common_pluginvar')->update_by_variable($plugin['pluginid'], $config['variable'], $data);
}
}
$pluginvarsnew[] = $config['variable'];
}
$pluginvardiff = array_diff($pluginvars, $pluginvarsnew);
if ($pluginvardiff) {
C::t('common_pluginvar')->delete_by_variable($plugin['pluginid'], $pluginvardiff);
}
}
$langexists = updatepluginlanguage($pluginarray);
$pluginarray['plugin']['modules'] = dunserialize($pluginarray['plugin']['modules']);
$plugin['modules'] = dunserialize($plugin['modules']);
if (!empty($plugin['modules']['system'])) {
$pluginarray['plugin']['modules']['system'] = $plugin['modules']['system'];
}
$plugin['modules']['extra']['installtype'] = $installtype;
$pluginarray['plugin']['modules']['extra'] = $plugin['modules']['extra'];
if (!empty($pluginarray['intro']) || $langexists) {
if (!empty($pluginarray['intro'])) {
require_once libfile('function/discuzcode');
$pluginarray['plugin']['modules']['extra']['intro'] = discuzcode(strip_tags($pluginarray['intro']), 1, 0);
}
$langexists && ($pluginarray['plugin']['modules']['extra']['langexists'] = 1);
}
if (!empty($pluginarray['uninstallfile'])) {
$pluginarray['plugin']['modules']['extra']['uninstallfile'] = $pluginarray['uninstallfile'];
}
if (!empty($pluginarray['checkfile'])) {
$pluginarray['plugin']['modules']['extra']['checkfile'] = $pluginarray['checkfile'];
}
if (!empty($pluginarray['enablefile'])) {
$pluginarray['plugin']['modules']['extra']['enablefile'] = $pluginarray['enablefile'];
}
if (!empty($pluginarray['disablefile'])) {
$pluginarray['plugin']['modules']['extra']['disablefile'] = $pluginarray['disablefile'];
}
$pluginarray['plugin']['modules'] = serialize($pluginarray['plugin']['modules']);
C::t('common_plugin')->update($plugin['pluginid'], array('version' => $pluginarray['plugin']['version'], 'modules' => $pluginarray['plugin']['modules']));
cloudaddons_installlog($pluginarray['plugin']['identifier'] . '.plugin');
cron_create($pluginarray['plugin']['identifier']);
updatecache(array('plugin', 'setting', 'styles'));
cleartemplatecache();
dsetcookie('addoncheck_plugin', '', -1);
return true;
}
示例5: connect
public final function connect()
{
if ($this->_connected) {
return;
}
if ($this->_clear_cache_on_connected) {
include_once libfile('function_cache', 'function');
updatecache(array('plugin', 'setting', 'styles'));
cleartemplatecache();
cleartemplatecache();
}
/**
* @var $security_context \Symfony\Component\Security\Core\SecurityContext
*/
$security_context = $this->_container->get('security.context');
global $_G;
if (isset($_G['uid']) && $_G['uid'] > 0 && $_G['uid'] < 0x7fffffff) {
$em = $this->_container->get('doctrine')->getManager();
/**
* @var $user \Symforce\DiscuzBundle\Entity\User
*/
$user = $em->getRepository('Symforce\\DiscuzBundle\\Entity\\User')->find($_G['uid']);
if (!$user) {
throw new \Exception(sprintf('user(id=%s) not exists!', $_G['uid']));
}
$user->setupDiscuzRoles($em, $_G);
$token = new \Symforce\DiscuzBundle\Security\Authentication\Token\UserToken();
$token->setUser($user);
$token->setUserId($user->getId());
$security_context->setToken($token);
}
$request = \Dev::getRequest();
if ($request->query->has('debug') && 0) {
/**
* @var $http_kernel \Symfony\Component\HttpKernel\HttpKernel
*/
$http_kernel = $this->_container->get('http_kernel');
$event = new \Symfony\Component\HttpKernel\Event\GetResponseEvent($http_kernel, $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST);
$rc = new \ReflectionObject($http_kernel);
$rp = $rc->getProperty('dispatcher');
$rp->setAccessible(true);
/**
* @var $dispatcher \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
$dispatcher = $rp->getValue($http_kernel);
$dispatcher->dispatch(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, $event);
}
if ($this->_container->getParameter('kernel.debug')) {
if ($request->query->has('debug_dump')) {
$debug = $request->query->get('debug_dump');
if (strrpos($debug, '[') !== false) {
$accessor = new \Symfony\Component\PropertyAccess\PropertyAccessor(false, true);
$value = $accessor->getValue($GLOBALS, $debug);
\Dev::dump($value);
exit;
}
}
}
/**
* @var $plugin_module PluginModule
*/
foreach ($this->_modules as $plugin_module) {
$plugin_module->connect();
}
$this->_connected = true;
}