Pimcore\Cache::clearAll PHP Метод

clearAll() публичный статический Метод

Empty the cache
public static clearAll ( ) : void
Результат void
    public static function clearAll()
    {
        // do not disable clearing, it's better purging items here than having inconsistent data because of wrong usage
        /*if (!self::$enabled) {
              Logger::debug("Cache is not cleared because it is disabled");
              return;
          }*/
        self::setWriteLock();
        if ($cache = self::getInstance()) {
            $cache->clean(\Zend_Cache::CLEANING_MODE_ALL);
        }
        // add tag to clear stack
        self::$clearedTagsStack[] = "__CLEAR_ALL__";
        // immediately acquire the write lock again (force), because the lock is in the cache too
        self::setWriteLock(true);
    }

Usage Example

Пример #1
0
 public function jobProceduralAction()
 {
     $status = array("success" => true);
     if ($this->getParam("type") == "files") {
         Update::installData($this->getParam("revision"));
     } else {
         if ($this->getParam("type") == "clearcache") {
             \Pimcore\Cache::clearAll();
         } else {
             if ($this->getParam("type") == "preupdate") {
                 $status = Update::executeScript($this->getParam("revision"), "preupdate");
             } else {
                 if ($this->getParam("type") == "postupdate") {
                     $status = Update::executeScript($this->getParam("revision"), "postupdate");
                 } else {
                     if ($this->getParam("type") == "cleanup") {
                         Update::cleanup();
                     }
                 }
             }
         }
     }
     // we use pure PHP here, otherwise this can cause issues with dependencies that changed during the update
     header("Content-type: application/json");
     echo json_encode($status);
     exit;
 }
All Usage Examples Of Pimcore\Cache::clearAll