当前位置: 首页>>代码示例>>PHP>>正文


PHP clearCache函数代码示例

本文整理汇总了PHP中clearCache函数的典型用法代码示例。如果您正苦于以下问题:PHP clearCache函数的具体用法?PHP clearCache怎么用?PHP clearCache使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了clearCache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     if (!pageArray(2)) {
         forward("admin/plugins");
     }
     $guid = pageArray(2);
     adminGateKeeper();
     $plugin = getEntity($guid);
     classGateKeeper($plugin, "Plugin");
     $plugin->status = "disabled";
     $plugin->save();
     Cache::clear();
     Cache::clear();
     Admintab::deleteAll();
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Systemvariable::set("setup_complete", false);
     $translations = getEntities(array("type" => "Translationentity"));
     if ($translations) {
         foreach ($translations as $translation) {
             $translation->delete();
         }
     }
     new SystemMessage("Your plugin has been disabled.");
     forward("admin/plugins");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:27,代码来源:DisablePluginActionHandler.php

示例2: clear_cache

 /**
  * function to clear all cache data
  * by default accessible only for admin
  *
  * @access Public
  * @return void
  */
 public function clear_cache()
 {
     $this->autoRender = false;
     Cache::clear();
     clearCache();
     $files = array();
     $files = array_merge($files, glob(CACHE . '*'));
     // remove cached css
     $files = array_merge($files, glob(CACHE . 'css' . DS . '*'));
     // remove cached css
     $files = array_merge($files, glob(CACHE . 'js' . DS . '*'));
     // remove cached js
     $files = array_merge($files, glob(CACHE . 'models' . DS . '*'));
     // remove cached models
     $files = array_merge($files, glob(CACHE . 'persistent' . DS . '*'));
     // remove cached persistent
     foreach ($files as $f) {
         if (is_file($f)) {
             unlink($f);
         }
     }
     if (function_exists('apc_clear_cache')) {
         apc_clear_cache();
         apc_clear_cache('user');
     }
     $this->set(compact('files'));
     $this->layout = 'ajax';
 }
开发者ID:Klaasie,项目名称:cakephp-twentywords,代码行数:35,代码来源:ToolsController.php

示例3: admin_upgrade

 function admin_upgrade($name = null)
 {
     if (empty($name)) {
         $this->Session->setFlash(__d('upgrader', 'Missing config name', true));
         $this->redirect('/admin');
     }
     clearCache(null, 'models');
     App::import('Lib', 'Upgrader.Upgrader');
     $upgrader = new Upgrader($name);
     $sErrors = $upgrader->check(true);
     if (!$sErrors) {
         $this->Session->setFlash(__d('upgrader', 'The database is valid', true));
         //$this->redirect(array('plugin'=>'upgrader','controller'=>'upgrader','action'=>'index'));
         $this->redirect('/admin');
     }
     $this->set('name', $name);
     //debug($sErrors);
     if (!empty($this->params['named']['start'])) {
         $error = array();
         $step = empty($this->params['named']['step']) ? 1 : $this->params['named']['step'];
         $res = $upgrader->run($error);
         if ($res === 'break') {
             $this->redirect(array('start' => '1', 'step' => $step++));
         }
         if ($res === true) {
             $this->Session->setFlash(__d('upgrader', 'The database has been fixed', true));
             //$this->redirect(array('plugin'=>'upgrader','controller'=>'upgrader','action'=>'index'));
             $this->redirect('/admin');
         } else {
             $this->Session->setFlash(__d('upgrader', 'An error occurred', true) . ' :<ul><li>' . implode('</li><li>', $error) . '</li></ul>');
         }
     }
 }
开发者ID:kevthunder,项目名称:cake-upgrader,代码行数:33,代码来源:upgrader_controller.php

示例4: __construct

 public function __construct()
 {
     $guid = pageArray(2);
     adminGateKeeper();
     $plugin = getEntity($guid);
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Cache::clear();
     if ($plugin->enable()) {
         new SystemMessage("Plugin Enabled");
         new Cache("enabled_plugins_", false, "site");
         new Cache("enabled_plugins_reversed", false, "site");
         Systemvariable::set("setup_complete", false);
         forward("admin/plugins");
     }
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Cache::clear();
     Admintab::deleteAll();
     $translations = getEntities(array("type" => "Translationentity"));
     if ($translations) {
         foreach ($translations as $translation) {
             $translation->delete();
         }
     }
     new SystemMessage("Your plugin can't be enabled.  Check requirements");
     forward("admin/plugins");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:30,代码来源:EnablePluginActionHandler.php

示例5: admin_clear_cache

 public static function admin_clear_cache()
 {
     $cachePaths = array('persistent');
     foreach ($cachePaths as $config) {
         clearCache(null, $config);
     }
 }
开发者ID:ivanbautsita,项目名称:gestion-escolar-campus-virtuales,代码行数:7,代码来源:Converter.php

示例6: index

 public function index()
 {
     //清除缓存
     clearCache();
     $this->home = HOME_PATH;
     $this->m = "../" . M_PATH;
     $this->display();
 }
开发者ID:echenxin-company,项目名称:YTBT,代码行数:8,代码来源:ClearcacheAction.class.php

示例7: insert

 public function insert()
 {
     foreach ($_POST["types"] as $k => $p) {
         if ($p) {
             clearCache($k);
         }
     }
 }
开发者ID:bqx619,项目名称:ones_dev,代码行数:8,代码来源:ClearCacheAction.class.php

示例8: clearProductCache

 /**
  * Clear product cache for Cake/App
  *
  * @param $marketId
  * @param $locale
  * @param $duration
  * @param $sku
  */
 public function clearProductCache($marketId, $locale, $duration, $sku)
 {
     $cache_key = strtolower('cake_' . $duration . '_' . preg_replace('/\\B([A-Z])/', '_$1', $marketId . $locale . $sku));
     /**
      * Clear Cache for sku
      */
     $success = clearCache($cache_key, '', '');
     $this->set(['success' => $success, 'result' => $cache_key, '_serialize' => ['success', 'result']]);
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:17,代码来源:UtilController.php

示例9: submit

 public function submit()
 {
     $dirs = $_POST['id'];
     //dump($dirs);
     foreach ($dirs as $value) {
         clearCache($type = 0, $path = $value);
         $say .= "清理缓存文件夹成功! " . $value . "</br>";
     }
     $this->success($say);
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:10,代码来源:CacheAction.class.php

示例10: admin_clearcache

 function admin_clearcache()
 {
     //debug($configure);
     if (clearCache()) {
         $this->Session->setFlash(__('CakePHPs Cache is cleared!', true));
     } else {
         $this->Session->setFlash(__('CakePHPs Cache was not cleared!', true));
     }
     $this->redirect('/admin/settings/');
 }
开发者ID:gerhardsletten,项目名称:settings,代码行数:10,代码来源:settings_controller.php

示例11: admin_upgrade

 function admin_upgrade()
 {
     clearCache(null, 'models');
     $sErrors = NewsletterUpgrade::check();
     if (!$sErrors) {
         $this->Session->setFlash(__d('newsletter', 'The database is valid', true));
         $this->redirect(array('plugin' => 'newsletter', 'controller' => 'newsletter', 'action' => 'index'));
     }
     //debug($sErrors);
     if (!empty($this->params['named']['start'])) {
         $error = array();
         $step = empty($this->params['named']['step']) ? 1 : $this->params['named']['step'];
         $res = NewsletterUpgrade::run($error);
         if ($res === 'break') {
             $this->redirect(array('start' => '1', 'step' => $step++));
         }
         if ($res === true) {
             $this->Session->setFlash(__d('newsletter', 'The database has been fixed', true));
             $this->redirect(array('plugin' => 'newsletter', 'controller' => 'newsletter', 'action' => 'index'));
         } else {
             $this->Session->setFlash(__d('newsletter', 'An error occurred', true) . ' :<ul><li>' . implode('</li><li>', $error) . '</li></ul>');
         }
         /*
         App::import('Lib', 'Newsletter.QueryUtil'); 
         if(!empty($sErrors['missing_table'])){
         	$this->_fix_missing_tables($sErrors,$error);
         }elseif(!empty($sErrors['field_mismatch'])){
         	if(in_array('NewsletterEmail.sendlist_id',$sErrors['field_mismatch']['fields'])){
         		$this->_fix_email_list_relation($sErrors,$error);
         	}
         	if(in_array('NewsletterSended.sendlist_id',$sErrors['field_mismatch']['fields'])){
         		$this->_fix_sended_tabled($sErrors,$error);
         	}
         	if(in_array('NewsletterSended.newsletter_variant_id',$sErrors['field_mismatch']['fields'])){
         		$this->_fix_sended_variant($sErrors,$error);
         	}
         	if(in_array('NewsletterSended.name',$sErrors['field_mismatch']['fields'])){
         		$this->_fix_sended_name($sErrors,$error);
         	}
         	clearCache(null, 'models');
         }
         if(!empty($error)){
         	$this->Session->setFlash(
         		__d('newsletter','An error occurred', true)
         		.' :<ul><li>'
         		.implode('</li><li>',$error)
         		.'</li></ul>'
         	);
         }else{
         	$this->Session->setFlash(__d('newsletter','The database has been fixed', true));
         	$this->redirect(array('plugin'=>'newsletter','controller'=>'newsletter','action'=>'index'));
         }
         */
     }
 }
开发者ID:kevthunder,项目名称:cake-newsletter,代码行数:55,代码来源:newsletter_upgrade_controller.php

示例12: delComment

 function delComment(&$Model, $c_id, $u_id)
 {
     $owner = $Model->Comment->read('name', $c_id);
     if ($u_id == $owner['Comment']['name']) {
         # clear cache
         clearCache($this->cacheName, '', '');
         return $Model->deleteComment($c_id);
     } else {
         return false;
     }
 }
开发者ID:vad,项目名称:taolin,代码行数:11,代码来源:comment.php

示例13: __construct

 public function __construct()
 {
     adminGateKeeper();
     $settings = getEntities(array("type" => "Setting"));
     foreach ($settings as $setting) {
         $setting->delete();
     }
     Systemvariable::set("setup_complete", "false");
     clearCache();
     Cache::clear();
     forward();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:12,代码来源:ResetSettingsActionHandler.php

示例14: myClearCache

function myClearCache($pattern)
{
    App::import('Core', 'Folder');
    $folder = new Folder(CACHE . 'views');
    $files = $folder->find('.*' . $pattern . '.*');
    if (!empty($files)) {
        foreach ($files as $file) {
            $file = r('.php', '', $file);
            clearCache($file);
        }
    }
}
开发者ID:stripthis,项目名称:donate,代码行数:12,代码来源:bootstrap.php

示例15: _save

 function _save()
 {
     $response = array();
     $this->Discussion->isNew = false;
     if ($this->Discussion->store($this->data)) {
         $response[] = "jQuery('#jr_postForm" . $this->data['Discussion']['discussion_id'] . "').slideUp('slow',function(){jQuery(this).html('');});";
         $response[] = "jreviews_admin.menu.moderation_counter('discussion_count');";
     }
     clearCache('', 'views');
     clearCache('', '__data');
     return $this->ajaxResponse($response);
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:12,代码来源:admin_discussions_controller.php


注:本文中的clearCache函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。