示例#1
0
 /**
  * resets cache as a result of user invoked call from admin
  * by removing the jbetolo cache directory
  *
  * if frontend cache is removed and own Pull CDN is enabled
  * we also clear the cache in own Pull CDN folder
  */
 public static function resetCache($app = 'all')
 {
     if ($app == 'all') {
         plgSystemJBetolo::param('files', '', 'set');
     } else {
         $param = plgSystemJBetolo::param('files');
         unset($param[$app]);
         plgSystemJBetolo::param('files', $param, 'set');
     }
     if ($app == 'all' || $app == 'site') {
         $loc = JBETOLO_CACHE_DIR;
         if (JFolder::exists($loc)) {
             JFolder::delete($loc);
         }
         if (jbetoloHelper::defineOwnCDNFolder()) {
             $loc = JBETOLO_CDN_OWN_FOLDER . 'cache/jbetolo';
             if (JFolder::exists($loc)) {
                 JFolder::delete($loc);
             }
         }
     }
     if ($app == 'all' || $app == 'administrator') {
         $loc = JPATH_ADMINISTRATOR . '/cache/jbetolo';
         if (JFolder::exists($loc)) {
             JFolder::delete($loc);
         }
     }
     return JText::_('PLG_SYSTEM_JBETOLO_CACHE_CLEARED');
 }