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


PHP wfConfig::clearDiskCache方法代码示例

本文整理汇总了PHP中wfConfig::clearDiskCache方法的典型用法代码示例。如果您正苦于以下问题:PHP wfConfig::clearDiskCache方法的具体用法?PHP wfConfig::clearDiskCache怎么用?PHP wfConfig::clearDiskCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wfConfig的用法示例。


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

示例1: uninstallPlugin

 public static function uninstallPlugin()
 {
     //Check if caching is enabled and if it is, disable it and fix the .htaccess file.
     $cacheType = wfConfig::get('cacheType', false);
     if ($cacheType == 'falcon') {
         wfCache::addHtaccessCode('remove');
         wfCache::updateBlockedIPs('remove');
         wfConfig::set('cacheType', false);
         //We currently don't clear the cache when plugin is disabled because it will take too long if done synchronously and won't work because plugin is disabled if done asynchronously.
         //wfCache::scheduleCacheClear();
     } else {
         if ($cacheType == 'php') {
             wfConfig::set('cacheType', false);
         }
     }
     //Used by MU code below
     update_option('wordfenceActivated', 0);
     wp_clear_scheduled_hook('wordfence_daily_cron');
     wp_clear_scheduled_hook('wordfence_hourly_cron');
     wp_clear_scheduled_hook('wordfence_daily_autoUpdate');
     //Remove old legacy cron job if it exists
     wp_clear_scheduled_hook('wordfence_scheduled_scan');
     //Remove all scheduled scans.
     self::unscheduleAllScans();
     // Remove cron for email summary
     wfActivityReport::clearCronJobs();
     wfConfig::clearDiskCache();
     if (wfConfig::get('deleteTablesOnDeact')) {
         $schema = new wfSchema();
         $schema->dropAll();
         foreach (array('wordfence_version', 'wordfenceActivated') as $opt) {
             delete_option($opt);
         }
     }
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:35,代码来源:wordfenceClass.php

示例2: uninstallPlugin

 public static function uninstallPlugin()
 {
     //Check if caching is enabled and if it is, disable it and fix the .htaccess file.
     $cacheType = wfConfig::get('cacheType', false);
     if ($cacheType == 'falcon') {
         wfCache::addHtaccessCode('remove');
         wfCache::updateBlockedIPs('remove');
         wfConfig::set('cacheType', false);
         //We currently don't clear the cache when plugin is disabled because it will take too long if done synchronously and won't work because plugin is disabled if done asynchronously.
         //wfCache::scheduleCacheClear();
     } else {
         if ($cacheType == 'php') {
             wfConfig::set('cacheType', false);
         }
     }
     //Used by MU code below
     update_option('wordfenceActivated', 0);
     wp_clear_scheduled_hook('wordfence_daily_cron');
     wp_clear_scheduled_hook('wordfence_hourly_cron');
     wp_clear_scheduled_hook('wordfence_daily_autoUpdate');
     //Remove old legacy cron job if it exists
     wp_clear_scheduled_hook('wordfence_scheduled_scan');
     //Remove all scheduled scans.
     self::unscheduleAllScans();
     // Remove cron for email summary
     wfActivityReport::clearCronJobs();
     // Remove the admin user list so it can be regenerated if Wordfence is reactivated.
     wfConfig::set_ser('adminUserList', false);
     wfConfig::clearDiskCache();
     if (!WFWAF_SUBDIRECTORY_INSTALL) {
         try {
             wfWAF::getInstance()->getStorageEngine()->setConfig('wafDisabled', true);
         } catch (wfWAFStorageFileException $e) {
             error_log($e->getMessage());
         }
     }
     if (wfConfig::get('deleteTablesOnDeact')) {
         $schema = new wfSchema();
         $schema->dropAll();
         foreach (array('wordfence_version', 'wordfenceActivated') as $opt) {
             delete_option($opt);
         }
         if (!WFWAF_SUBDIRECTORY_INSTALL) {
             try {
                 if (WFWAF_AUTO_PREPEND) {
                     $helper = new wfWAFAutoPrependHelper();
                     if ($helper->uninstall()) {
                         wfWAF::getInstance()->uninstall();
                     }
                 } else {
                     wfWAF::getInstance()->uninstall();
                 }
             } catch (wfWAFStorageFileException $e) {
                 error_log($e->getMessage());
             }
         }
     }
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:58,代码来源:wordfenceClass.php


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