public function jobProceduralAction() { $status = array("success" => true); if ($this->_getParam("type") == "files") { Pimcore_Update::installData($this->_getParam("revision")); } else { if ($this->_getParam("type") == "clearcache") { Pimcore_Model_Cache::clearAll(); } else { if ($this->_getParam("type") == "preupdate") { $status = Pimcore_Update::executeScript($this->_getParam("revision"), "preupdate"); } else { if ($this->_getParam("type") == "postupdate") { $status = Pimcore_Update::executeScript($this->_getParam("revision"), "postupdate"); } else { if ($this->_getParam("type") == "cleanup") { Pimcore_Update::cleanup(); } else { if ($this->_getParam("type") == "languages") { Pimcore_Update::downloadLanguage(); } } } } } } $this->_helper->json($status); }
public function clearCacheAction() { if ($this->getUser()->isAllowed("clear_cache")) { // empty document cache Pimcore_Model_Cache::clearAll(); // empty cache directory $files = scandir(PIMCORE_CACHE_DIRECTORY); foreach ($files as $file) { if (is_file(PIMCORE_CACHE_DIRECTORY . "/" . $file)) { unlink(PIMCORE_CACHE_DIRECTORY . "/" . $file); } } $this->_helper->json(array("success" => true)); } else { if ($this->getUser() != null) { Logger::err("user [" . $this->getUser()->getId() . "] attempted to clear cache, but has no permission to do so."); } else { Logger::err("attempt to clear cache, but no user in session."); } } $this->_helper->json(false); }
<?php // flush cache \Pimcore_Model_Cache::clearAll(); // delete the autoload class map $file = PIMCORE_CONFIGURATION_DIRECTORY . "/autoload-classmap.php"; if (file_exists($file)) { unlink($file); } // clear the opcache (as of PHP 5.5) if (function_exists("opcache_reset")) { opcache_reset(); } // clear the APC opcode cache (<= PHP 5.4) if (function_exists("apc_clear_cache")) { apc_clear_cache(); } // clear the Zend Optimizer cache (Zend Server <= PHP 5.4) if (function_exists('accelerator_reset')) { return accelerator_reset(); }
/** * */ public function delete() { $this->getResource()->delete(); Pimcore_Model_Cache::clearAll(); }