From e3364ed683e6358ac0850897f6b0db71ea8f1562 Mon Sep 17 00:00:00 2001 From: Oliver Skroblin Date: Wed, 7 Jun 2017 11:11:10 +0200 Subject: [PATCH] SW-18961 - Add new http cache route entry for frontend listing layout calls --- .../935-add-listing-layout-config.php | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 _sql/migrations/935-add-listing-layout-config.php diff --git a/_sql/migrations/935-add-listing-layout-config.php b/_sql/migrations/935-add-listing-layout-config.php new file mode 100644 index 00000000000..2722efc3f07 --- /dev/null +++ b/_sql/migrations/935-add-listing-layout-config.php @@ -0,0 +1,76 @@ +addSql(sprintf( + "UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'cacheControllers'", + serialize($tags) + )); + + if ($modus == self::MODUS_INSTALL) { + return; + } + + $values = $this->connection->query("SELECT v.id, v.value FROM s_core_config_values v INNER JOIN s_core_config_elements e ON e.id = v.element_id WHERE e.name = 'cacheControllers'") + ->fetchAll(PDO::FETCH_ASSOC); + + foreach ($values as $row) { + $value = unserialize($row['value']); + $value = explode("\n", $value); + $value[] = 'frontend/listing/layout 0'; + $value = implode("\n", $value); + $value = serialize($value); + + $sql = sprintf("UPDATE `s_core_config_values` SET `value` = '%s' WHERE id = " . (int) $row['id'], $value); + $this->addSql($sql); + } + } +}