예제 #1
0
 /**
  * Delete the category.
  * First delete the config file if exists, then the menu cache, then the directory.
  *
  * @return true if succeed
  */
 function Delete()
 {
     //delete the config file if exists
     if (is_file($this->oPConfigFile->path) && !$this->oPConfigFile->Delete()) {
         return false;
     }
     //delete the menu cache
     if (!deleteMenuCache()) {
         return false;
     }
     return parent::Delete();
 }
예제 #2
0
 /**
  * Delete the current page.
  * While delete the page, delete the html file, the history directory, and the ini file.
  * An event is attached to this function: deletepage event.
  * Use for example by the search engine plugin.
  *
  * @return true if succeed, else return false.
  */
 function Delete()
 {
     // delete history folder and file
     $oDirHistoryCache = new PDir(CACHE_HIST_DIR . SLASH . $this->getId());
     if (!$oDirHistoryCache->Delete()) {
         return false;
     }
     //delete the config file;
     if (!$this->oPConfigFile->Delete()) {
         return false;
     }
     if (!doEventAction('deletepage', array(&$this))) {
         return false;
     }
     //on supprime le cache du menu
     if (!deleteMenuCache()) {
         return false;
     }
     //delete the html file
     return parent::Delete();
 }
예제 #3
0
 function pcms_clearcache($strType = 'site')
 {
     $cacheDir = false;
     switch ($strType) {
         case 'site':
             $cacheDir = new PDir(SMARTY_CACHE_DIR);
             break;
         case 'thumbs':
             $cacheDir = new PDir(CACHE_DIR . 'thumbnails/');
             break;
         case 'history':
             $cacheDir = new PDir(CACHE_HIST_DIR);
             break;
         default:
             $cacheDir = new PDir(SMARTY_CACHE_DIR);
             break;
     }
     if (is_dir($cacheDir->path) && !$cacheDir->Delete()) {
         return false;
     }
     setError(_('Error deleting cache.'));
     return true;
 }