/** * Clean Sugar cache directories: * Rebuild autoloader cache * Clean smarty cache * modules cache * themes cache * jsLanguage cache */ public function cleanCaches() { require_once "include/MetaDataManager/MetaDataManager.php"; $this->log("Cleaning cache"); $this->cleanFileCache(); $this->cleanDir($this->cacheDir("smarty")); $this->cleanDir($this->cacheDir("modules")); $this->cleanDir($this->cacheDir("jsLanguage")); $this->cleanDir($this->cacheDir("Expressions")); $this->cleanDir($this->cacheDir("themes")); $this->cleanDir($this->cacheDir("include/api")); // as far as database schema hasn't been rebuilt yet, it's needed to check // if metadata manager is operable if (MetaDataManager::isCacheOperable()) { MetaDataManager::clearAPICache(true, true); } else { // otherwise, disable it until the schema has been rebuilt MetaDataManager::disableCache(); } $this->log("Cache cleaned"); }