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

Empty the cache
public static clearAll ( ) : void
Результат void
Пример #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;
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $storeId = $input->getArgument('storeId');
     if (!is_numeric($storeId)) {
         throw new \Exception('Invalid store ID');
     }
     $db = Db::get();
     $tableList = $db->fetchAll("show tables like 'object_classificationstore_data_%'");
     foreach ($tableList as $table) {
         $theTable = current($table);
         $sql = "delete from " . $theTable . " where keyId In (select id from classificationstore_keys where storeId = " . $db->quote($storeId) . ")";
         echo $sql . "\n";
         $db->query($sql);
     }
     $tableList = $db->fetchAll("show tables like 'object_classificationstore_groups_%'");
     foreach ($tableList as $table) {
         $theTable = current($table);
         $sql = "delete from " . $theTable . " where groupId In (select id from classificationstore_groups where storeId = " . $db->quote($storeId) . ")";
         echo $sql . "\n";
         $db->query($sql);
     }
     $sql = "delete from classificationstore_keys where storeId = " . $db->quote($storeId);
     echo $sql . "\n";
     $db->query($sql);
     $sql = "delete from classificationstore_groups where storeId = " . $db->quote($storeId);
     echo $sql . "\n";
     $db->query($sql);
     $sql = "delete from classificationstore_collections where storeId = " . $db->quote($storeId);
     echo $sql . "\n";
     $db->query($sql);
     $sql = "delete from classificationstore_stores where id = " . $db->quote($storeId);
     echo $sql . "\n";
     $db->query($sql);
     Cache::clearAll();
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $status = ["success" => true];
     $config = $input->getArgument("config");
     if ($config) {
         $job = json_decode($config, true);
         if (is_array($job)) {
             if (isset($job["dry-run"])) {
                 // do not do anything here
                 \Logger::info("skipped update job because it is in dry-run mode", $job);
             } elseif ($job["type"] == "files") {
                 Update::installData($job["revision"]);
             } elseif ($job["type"] == "clearcache") {
                 \Pimcore\Cache::clearAll();
             } elseif ($job["type"] == "preupdate") {
                 $status = Update::executeScript($job["revision"], "preupdate");
             } elseif ($job["type"] == "postupdate") {
                 $status = Update::executeScript($job["revision"], "postupdate");
             } elseif ($job["type"] == "cleanup") {
                 Update::cleanup();
             }
         }
     }
     $this->output->write(json_encode($status));
 }
Пример #4
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($input->getOption("tags")) {
         $tags = explode(",", $input->getOption("tags"));
         Cache::clearTags($tags);
     } elseif ($input->getOption("output")) {
         Cache::clearTag("output");
     } else {
         Cache::clearAll();
     }
 }
Пример #5
0
 /**
  *
  */
 public function delete()
 {
     // delete all childs
     $list = new Listing();
     $list->setCondition("parentId = ?", $this->getId());
     $list->load();
     if (is_array($list->getUsers())) {
         foreach ($list->getUsers() as $user) {
             $user->delete();
         }
     }
     // now delete the current user
     $this->getDao()->delete();
     \Pimcore\Cache::clearAll();
 }
Пример #6
0
 public function clearCacheAction()
 {
     $this->checkPermission("clear_cache");
     // empty document cache
     Cache::clearAll();
     $db = \Pimcore\Db::get();
     $db->query("truncate table cache_tags");
     $db->query("truncate table cache");
     // empty cache directory
     recursiveDelete(PIMCORE_CACHE_DIRECTORY, false);
     // PIMCORE-1854 - recreate .dummy file => should remain
     \Pimcore\File::put(PIMCORE_CACHE_DIRECTORY . "/.dummy", "");
     $this->_helper->json(array("success" => true));
 }
Пример #7
0
<?php

// get db connection
$db = \Pimcore\Db::get();
$db->query("DELETE FROM `users_permission_definitions` WHERE `key`='document_style_editor';");
$db->query("ALTER TABLE documents_page DROP COLUMN `css`;");
\Pimcore\Cache::clearAll();