| 
 | 1 | +diff --Nuar a/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php b/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php  | 
 | 2 | +--- a/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php  | 
 | 3 | ++++ b/vendor/magento/module-page-cache/Model/Layout/LayoutPlugin.php  | 
 | 4 | +@@ -7,6 +7,7 @@ declare(strict_types=1);  | 
 | 5 | + | 
 | 6 | + namespace Magento\PageCache\Model\Layout;  | 
 | 7 | + | 
 | 8 | ++use Magento\Framework\App\MaintenanceMode;  | 
 | 9 | + use Magento\Framework\App\ResponseInterface;  | 
 | 10 | + use Magento\Framework\DataObject\IdentityInterface;  | 
 | 11 | + use Magento\Framework\View\Layout;  | 
 | 12 | +@@ -27,16 +28,24 @@ class LayoutPlugin  | 
 | 13 | +      */  | 
 | 14 | +     private $response;  | 
 | 15 | + | 
 | 16 | ++    /**  | 
 | 17 | ++     * @var MaintenanceMode  | 
 | 18 | ++     */  | 
 | 19 | ++    private $maintenanceMode;  | 
 | 20 | ++  | 
 | 21 | +     /**  | 
 | 22 | +      * @param ResponseInterface $response  | 
 | 23 | +      * @param Config $config  | 
 | 24 | ++     * @param MaintenanceMode $maintenanceMode  | 
 | 25 | +      */  | 
 | 26 | +     public function __construct(  | 
 | 27 | +         ResponseInterface $response,  | 
 | 28 | +-        Config $config  | 
 | 29 | ++        Config $config,  | 
 | 30 | ++        MaintenanceMode $maintenanceMode  | 
 | 31 | +     ) {  | 
 | 32 | +         $this->response = $response;  | 
 | 33 | +         $this->config = $config;  | 
 | 34 | ++        $this->maintenanceMode = $maintenanceMode;  | 
 | 35 | +     }  | 
 | 36 | + | 
 | 37 | +     /**  | 
 | 38 | +@@ -49,7 +58,7 @@ class LayoutPlugin  | 
 | 39 | +      */  | 
 | 40 | +     public function afterGenerateElements(Layout $subject)  | 
 | 41 | +     {  | 
 | 42 | +-        if ($subject->isCacheable() && $this->config->isEnabled()) {  | 
 | 43 | ++        if ($subject->isCacheable() && !$this->maintenanceMode->isOn() && $this->config->isEnabled()) {  | 
 | 44 | +             $this->response->setPublicHeaders($this->config->getTtl());  | 
 | 45 | +         }  | 
 | 46 | +     }  | 
 | 47 | +diff --Nuar a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance.php b/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance.php  | 
 | 48 | +deleted file mode 100644  | 
 | 49 | +--- a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance.php  | 
 | 50 | ++++ /dev/null  | 
 | 51 | +@@ -1,108 +0,0 @@  | 
 | 52 | +-<?php  | 
 | 53 | +-/**  | 
 | 54 | +- *  | 
 | 55 | +- * Copyright © Magento, Inc. All rights reserved.  | 
 | 56 | +- * See COPYING.txt for license details.  | 
 | 57 | +- */  | 
 | 58 | +-  | 
 | 59 | +-declare(strict_types=1);  | 
 | 60 | +-  | 
 | 61 | +-namespace Magento\PageCache\Observer;  | 
 | 62 | +-  | 
 | 63 | +-use Magento\Framework\Event\ObserverInterface;  | 
 | 64 | +-use Magento\Framework\Event\Observer;  | 
 | 65 | +-use Magento\Framework\App\Cache\Manager;  | 
 | 66 | +-use Magento\PageCache\Model\Cache\Type as PageCacheType;  | 
 | 67 | +-use Magento\PageCache\Observer\SwitchPageCacheOnMaintenance\PageCacheState;  | 
 | 68 | +-  | 
 | 69 | +-/**  | 
 | 70 | +- * Switch Page Cache on maintenance.  | 
 | 71 | +- */  | 
 | 72 | +-class SwitchPageCacheOnMaintenance implements ObserverInterface  | 
 | 73 | +-{  | 
 | 74 | +-    /**  | 
 | 75 | +-     * @var Manager  | 
 | 76 | +-     */  | 
 | 77 | +-    private $cacheManager;  | 
 | 78 | +-  | 
 | 79 | +-    /**  | 
 | 80 | +-     * @var PageCacheState  | 
 | 81 | +-     */  | 
 | 82 | +-    private $pageCacheStateStorage;  | 
 | 83 | +-  | 
 | 84 | +-    /**  | 
 | 85 | +-     * @param Manager $cacheManager  | 
 | 86 | +-     * @param PageCacheState $pageCacheStateStorage  | 
 | 87 | +-     */  | 
 | 88 | +-    public function __construct(Manager $cacheManager, PageCacheState $pageCacheStateStorage)  | 
 | 89 | +-    {  | 
 | 90 | +-        $this->cacheManager = $cacheManager;  | 
 | 91 | +-        $this->pageCacheStateStorage = $pageCacheStateStorage;  | 
 | 92 | +-    }  | 
 | 93 | +-  | 
 | 94 | +-    /**  | 
 | 95 | +-     * Switches Full Page Cache.  | 
 | 96 | +-     *  | 
 | 97 | +-     * Depending on enabling or disabling Maintenance Mode it turns off or restores Full Page Cache state.  | 
 | 98 | +-     *  | 
 | 99 | +-     * @param Observer $observer  | 
 | 100 | +-     * @return void  | 
 | 101 | +-     */  | 
 | 102 | +-    public function execute(Observer $observer): void  | 
 | 103 | +-    {  | 
 | 104 | +-        if ($observer->getData('isOn')) {  | 
 | 105 | +-            $this->pageCacheStateStorage->save($this->isFullPageCacheEnabled());  | 
 | 106 | +-            $this->turnOffFullPageCache();  | 
 | 107 | +-        } else {  | 
 | 108 | +-            $this->restoreFullPageCacheState();  | 
 | 109 | +-        }  | 
 | 110 | +-    }  | 
 | 111 | +-  | 
 | 112 | +-    /**  | 
 | 113 | +-     * Turns off Full Page Cache.  | 
 | 114 | +-     *  | 
 | 115 | +-     * @return void  | 
 | 116 | +-     */  | 
 | 117 | +-    private function turnOffFullPageCache(): void  | 
 | 118 | +-    {  | 
 | 119 | +-        if (!$this->isFullPageCacheEnabled()) {  | 
 | 120 | +-            return;  | 
 | 121 | +-        }  | 
 | 122 | +-  | 
 | 123 | +-        $this->cacheManager->clean([PageCacheType::TYPE_IDENTIFIER]);  | 
 | 124 | +-        $this->cacheManager->setEnabled([PageCacheType::TYPE_IDENTIFIER], false);  | 
 | 125 | +-    }  | 
 | 126 | +-  | 
 | 127 | +-    /**  | 
 | 128 | +-     * Full Page Cache state.  | 
 | 129 | +-     *  | 
 | 130 | +-     * @return bool  | 
 | 131 | +-     */  | 
 | 132 | +-    private function isFullPageCacheEnabled(): bool  | 
 | 133 | +-    {  | 
 | 134 | +-        $cacheStatus = $this->cacheManager->getStatus();  | 
 | 135 | +-  | 
 | 136 | +-        if (!array_key_exists(PageCacheType::TYPE_IDENTIFIER, $cacheStatus)) {  | 
 | 137 | +-            return false;  | 
 | 138 | +-        }  | 
 | 139 | +-  | 
 | 140 | +-        return (bool)$cacheStatus[PageCacheType::TYPE_IDENTIFIER];  | 
 | 141 | +-    }  | 
 | 142 | +-  | 
 | 143 | +-    /**  | 
 | 144 | +-     * Restores Full Page Cache state.  | 
 | 145 | +-     *  | 
 | 146 | +-     * Returns FPC to previous state that was before maintenance mode turning on.  | 
 | 147 | +-     *  | 
 | 148 | +-     * @return void  | 
 | 149 | +-     */  | 
 | 150 | +-    private function restoreFullPageCacheState(): void  | 
 | 151 | +-    {  | 
 | 152 | +-        $storedPageCacheState = $this->pageCacheStateStorage->isEnabled();  | 
 | 153 | +-        $this->pageCacheStateStorage->flush();  | 
 | 154 | +-  | 
 | 155 | +-        if ($storedPageCacheState) {  | 
 | 156 | +-            $this->cacheManager->setEnabled([PageCacheType::TYPE_IDENTIFIER], true);  | 
 | 157 | +-        }  | 
 | 158 | +-    }  | 
 | 159 | +-}  | 
 | 160 | +diff --Nuar a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php b/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php  | 
 | 161 | +--- a/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php  | 
 | 162 | ++++ b/vendor/magento/module-page-cache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php  | 
 | 163 | +@@ -14,6 +14,8 @@ use Magento\Framework\App\Filesystem\DirectoryList;  | 
 | 164 | + | 
 | 165 | + /**  | 
 | 166 | +  * Page Cache state.  | 
 | 167 | ++ *  | 
 | 168 | ++ * @deprecated Originally used by now removed observer SwitchPageCacheOnMaintenance  | 
 | 169 | +  */  | 
 | 170 | + class PageCacheState  | 
 | 171 | + {  | 
 | 172 | +diff --Nuar a/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php b/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php  | 
 | 173 | +--- a/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php  | 
 | 174 | ++++ b/vendor/magento/module-page-cache/Test/Unit/Model/Layout/LayoutPluginTest.php  | 
 | 175 | +@@ -8,6 +8,7 @@ declare(strict_types=1);  | 
 | 176 | + namespace Magento\PageCache\Test\Unit\Model\Layout;  | 
 | 177 | + | 
 | 178 | + use Magento\Framework\App\Config\ScopeConfigInterface;  | 
 | 179 | ++use Magento\Framework\App\MaintenanceMode;  | 
 | 180 | + use Magento\Framework\App\Response\Http;  | 
 | 181 | + use Magento\Framework\App\ResponseInterface;  | 
 | 182 | + use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;  | 
 | 183 | +@@ -43,6 +44,11 @@ class LayoutPluginTest extends TestCase  | 
 | 184 | +      */  | 
 | 185 | +     private $configMock;  | 
 | 186 | + | 
 | 187 | ++    /**  | 
 | 188 | ++     * @var MaintenanceMode|PHPUnit_Framework_MockObject_MockObject  | 
 | 189 | ++     */  | 
 | 190 | ++    private $maintenanceModeMock;  | 
 | 191 | ++  | 
 | 192 | +     /**  | 
 | 193 | +      * @inheritdoc  | 
 | 194 | +      */  | 
 | 195 | +@@ -51,12 +57,14 @@ class LayoutPluginTest extends TestCase  | 
 | 196 | +         $this->layoutMock = $this->createPartialMock(Layout::class, ['isCacheable', 'getAllBlocks']);  | 
 | 197 | +         $this->responseMock = $this->createMock(Http::class);  | 
 | 198 | +         $this->configMock = $this->createMock(Config::class);  | 
 | 199 | ++        $this->maintenanceModeMock = $this->createMock(MaintenanceMode::class);  | 
 | 200 | + | 
 | 201 | +         $this->model = (new ObjectManagerHelper($this))->getObject(  | 
 | 202 | +             LayoutPlugin::class,  | 
 | 203 | +             [  | 
 | 204 | +                 'response' => $this->responseMock,  | 
 | 205 | +                 'config' => $this->configMock,  | 
 | 206 | ++                'maintenanceMode' => $this->maintenanceModeMock  | 
 | 207 | +             ]  | 
 | 208 | +         );  | 
 | 209 | +     }  | 
 | 210 | +@@ -64,17 +72,19 @@ class LayoutPluginTest extends TestCase  | 
 | 211 | +     /**  | 
 | 212 | +      * @param $cacheState  | 
 | 213 | +      * @param $layoutIsCacheable  | 
 | 214 | ++     * @param $maintenanceModeIsEnabled  | 
 | 215 | +      * @return void  | 
 | 216 | +      * @dataProvider afterGenerateXmlDataProvider  | 
 | 217 | +      */  | 
 | 218 | +-    public function testAfterGenerateElements($cacheState, $layoutIsCacheable): void  | 
 | 219 | ++    public function testAfterGenerateElements($cacheState, $layoutIsCacheable, $maintenanceModeIsEnabled): void  | 
 | 220 | +     {  | 
 | 221 | +         $maxAge = 180;  | 
 | 222 | + | 
 | 223 | +         $this->layoutMock->expects($this->once())->method('isCacheable')->will($this->returnValue($layoutIsCacheable));  | 
 | 224 | +         $this->configMock->expects($this->any())->method('isEnabled')->will($this->returnValue($cacheState));  | 
 | 225 | ++        $this->maintenanceModeMock->expects($this->any())->method('isOn')->will($this->returnValue($maintenanceModeIsEnabled));  | 
 | 226 | + | 
 | 227 | +-        if ($layoutIsCacheable && $cacheState) {  | 
 | 228 | ++        if ($layoutIsCacheable && $cacheState && !$maintenanceModeIsEnabled) {  | 
 | 229 | +             $this->configMock->expects($this->once())->method('getTtl')->will($this->returnValue($maxAge));  | 
 | 230 | +             $this->responseMock->expects($this->once())->method('setPublicHeaders')->with($maxAge);  | 
 | 231 | +         } else {  | 
 | 232 | +@@ -90,10 +100,11 @@ class LayoutPluginTest extends TestCase  | 
 | 233 | +     public function afterGenerateXmlDataProvider(): array  | 
 | 234 | +     {  | 
 | 235 | +         return [  | 
 | 236 | +-            'Full_cache state is true, Layout is cache-able' => [true, true],  | 
 | 237 | +-            'Full_cache state is true, Layout is not cache-able' => [true, false],  | 
 | 238 | +-            'Full_cache state is false, Layout is not cache-able' => [false, false],  | 
 | 239 | +-            'Full_cache state is false, Layout is cache-able' => [false, true],  | 
 | 240 | ++            'Full_cache state is true, Layout is cache-able' => [true, true, false],  | 
 | 241 | ++            'Full_cache state is true, Layout is not cache-able' => [true, false, false],  | 
 | 242 | ++            'Full_cache state is false, Layout is not cache-able' => [false, false, false],  | 
 | 243 | ++            'Full_cache state is false, Layout is cache-able' => [false, true, false],  | 
 | 244 | ++            'Full_cache state is true, Layout is cache-able, Maintenance mode is enabled' => [true, true, true],  | 
 | 245 | +         ];  | 
 | 246 | +     }  | 
 | 247 | + | 
 | 248 | +diff --Nuar a/vendor/magento/module-page-cache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php b/vendor/magento/module-page-cache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php  | 
 | 249 | +deleted file mode 100644  | 
 | 250 | +--- a/vendor/magento/module-page-cache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php  | 
 | 251 | ++++ /dev/null  | 
 | 252 | +@@ -1,164 +0,0 @@  | 
 | 253 | +-<?php  | 
 | 254 | +-/**  | 
 | 255 | +- *  | 
 | 256 | +- * Copyright © Magento, Inc. All rights reserved.  | 
 | 257 | +- * See COPYING.txt for license details.  | 
 | 258 | +- */  | 
 | 259 | +-  | 
 | 260 | +-declare(strict_types=1);  | 
 | 261 | +-  | 
 | 262 | +-namespace Magento\PageCache\Test\Unit\Observer;  | 
 | 263 | +-  | 
 | 264 | +-use PHPUnit\Framework\TestCase;  | 
 | 265 | +-use Magento\PageCache\Observer\SwitchPageCacheOnMaintenance;  | 
 | 266 | +-use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;  | 
 | 267 | +-use Magento\Framework\App\Cache\Manager;  | 
 | 268 | +-use Magento\Framework\Event\Observer;  | 
 | 269 | +-use Magento\PageCache\Model\Cache\Type as PageCacheType;  | 
 | 270 | +-use Magento\PageCache\Observer\SwitchPageCacheOnMaintenance\PageCacheState;  | 
 | 271 | +-  | 
 | 272 | +-/**  | 
 | 273 | +- * SwitchPageCacheOnMaintenance observer test.  | 
 | 274 | +- */  | 
 | 275 | +-class SwitchPageCacheOnMaintenanceTest extends TestCase  | 
 | 276 | +-{  | 
 | 277 | +-    /**  | 
 | 278 | +-     * @var SwitchPageCacheOnMaintenance  | 
 | 279 | +-     */  | 
 | 280 | +-    private $model;  | 
 | 281 | +-  | 
 | 282 | +-    /**  | 
 | 283 | +-     * @var Manager|\PHPUnit\Framework\MockObject\MockObject  | 
 | 284 | +-     */  | 
 | 285 | +-    private $cacheManager;  | 
 | 286 | +-  | 
 | 287 | +-    /**  | 
 | 288 | +-     * @var PageCacheState|\PHPUnit\Framework\MockObject\MockObject  | 
 | 289 | +-     */  | 
 | 290 | +-    private $pageCacheStateStorage;  | 
 | 291 | +-  | 
 | 292 | +-    /**  | 
 | 293 | +-     * @var Observer|\PHPUnit\Framework\MockObject\MockObject  | 
 | 294 | +-     */  | 
 | 295 | +-    private $observer;  | 
 | 296 | +-  | 
 | 297 | +-    /**  | 
 | 298 | +-     * @inheritdoc  | 
 | 299 | +-     */  | 
 | 300 | +-    protected function setUp(): void  | 
 | 301 | +-    {  | 
 | 302 | +-        $objectManager = new ObjectManager($this);  | 
 | 303 | +-        $this->cacheManager = $this->createMock(Manager::class);  | 
 | 304 | +-        $this->pageCacheStateStorage = $this->createMock(PageCacheState::class);  | 
 | 305 | +-        $this->observer = $this->createMock(Observer::class);  | 
 | 306 | +-  | 
 | 307 | +-        $this->model = $objectManager->getObject(SwitchPageCacheOnMaintenance::class, [  | 
 | 308 | +-            'cacheManager' => $this->cacheManager,  | 
 | 309 | +-            'pageCacheStateStorage' => $this->pageCacheStateStorage,  | 
 | 310 | +-        ]);  | 
 | 311 | +-    }  | 
 | 312 | +-  | 
 | 313 | +-    /**  | 
 | 314 | +-     * Tests execute when setting maintenance mode to on.  | 
 | 315 | +-     *  | 
 | 316 | +-     * @param array $cacheStatus  | 
 | 317 | +-     * @param bool $cacheState  | 
 | 318 | +-     * @param int $flushCacheCalls  | 
 | 319 | +-     * @return void  | 
 | 320 | +-     * @dataProvider enablingPageCacheStateProvider  | 
 | 321 | +-     */  | 
 | 322 | +-    public function testExecuteWhileMaintenanceEnabling(  | 
 | 323 | +-        array $cacheStatus,  | 
 | 324 | +-        bool $cacheState,  | 
 | 325 | +-        int $flushCacheCalls  | 
 | 326 | +-    ): void {  | 
 | 327 | +-        $this->observer->method('getData')  | 
 | 328 | +-            ->with('isOn')  | 
 | 329 | +-            ->willReturn(true);  | 
 | 330 | +-        $this->cacheManager->method('getStatus')  | 
 | 331 | +-            ->willReturn($cacheStatus);  | 
 | 332 | +-  | 
 | 333 | +-        // Page Cache state will be stored.  | 
 | 334 | +-        $this->pageCacheStateStorage->expects($this->once())  | 
 | 335 | +-            ->method('save')  | 
 | 336 | +-            ->with($cacheState);  | 
 | 337 | +-  | 
 | 338 | +-        // Page Cache will be cleaned and disabled  | 
 | 339 | +-        $this->cacheManager->expects($this->exactly($flushCacheCalls))  | 
 | 340 | +-            ->method('clean')  | 
 | 341 | +-            ->with([PageCacheType::TYPE_IDENTIFIER]);  | 
 | 342 | +-        $this->cacheManager->expects($this->exactly($flushCacheCalls))  | 
 | 343 | +-            ->method('setEnabled')  | 
 | 344 | +-            ->with([PageCacheType::TYPE_IDENTIFIER], false);  | 
 | 345 | +-  | 
 | 346 | +-        $this->model->execute($this->observer);  | 
 | 347 | +-    }  | 
 | 348 | +-  | 
 | 349 | +-    /**  | 
 | 350 | +-     * Tests execute when setting Maintenance Mode to off.  | 
 | 351 | +-     *  | 
 | 352 | +-     * @param bool $storedCacheState  | 
 | 353 | +-     * @param int $enableCacheCalls  | 
 | 354 | +-     * @return void  | 
 | 355 | +-     * @dataProvider disablingPageCacheStateProvider  | 
 | 356 | +-     */  | 
 | 357 | +-    public function testExecuteWhileMaintenanceDisabling(bool $storedCacheState, int $enableCacheCalls): void  | 
 | 358 | +-    {  | 
 | 359 | +-        $this->observer->method('getData')  | 
 | 360 | +-            ->with('isOn')  | 
 | 361 | +-            ->willReturn(false);  | 
 | 362 | +-  | 
 | 363 | +-        $this->pageCacheStateStorage->method('isEnabled')  | 
 | 364 | +-            ->willReturn($storedCacheState);  | 
 | 365 | +-  | 
 | 366 | +-        // Nullify Page Cache state.  | 
 | 367 | +-        $this->pageCacheStateStorage->expects($this->once())  | 
 | 368 | +-            ->method('flush');  | 
 | 369 | +-  | 
 | 370 | +-        // Page Cache will be enabled.  | 
 | 371 | +-        $this->cacheManager->expects($this->exactly($enableCacheCalls))  | 
 | 372 | +-            ->method('setEnabled')  | 
 | 373 | +-            ->with([PageCacheType::TYPE_IDENTIFIER]);  | 
 | 374 | +-  | 
 | 375 | +-        $this->model->execute($this->observer);  | 
 | 376 | +-    }  | 
 | 377 | +-  | 
 | 378 | +-    /**  | 
 | 379 | +-     * Page Cache state data provider.  | 
 | 380 | +-     *  | 
 | 381 | +-     * @return array  | 
 | 382 | +-     */  | 
 | 383 | +-    public function enablingPageCacheStateProvider(): array  | 
 | 384 | +-    {  | 
 | 385 | +-        return [  | 
 | 386 | +-            'page_cache_is_enable' => [  | 
 | 387 | +-                'cache_status' => [PageCacheType::TYPE_IDENTIFIER => 1],  | 
 | 388 | +-                'cache_state' => true,  | 
 | 389 | +-                'flush_cache_calls' => 1,  | 
 | 390 | +-            ],  | 
 | 391 | +-            'page_cache_is_missing_in_system' => [  | 
 | 392 | +-                'cache_status' => [],  | 
 | 393 | +-                'cache_state' => false,  | 
 | 394 | +-                'flush_cache_calls' => 0,  | 
 | 395 | +-            ],  | 
 | 396 | +-            'page_cache_is_disable' => [  | 
 | 397 | +-                'cache_status' => [PageCacheType::TYPE_IDENTIFIER => 0],  | 
 | 398 | +-                'cache_state' => false,  | 
 | 399 | +-                'flush_cache_calls' => 0,  | 
 | 400 | +-            ],  | 
 | 401 | +-        ];  | 
 | 402 | +-    }  | 
 | 403 | +-  | 
 | 404 | +-    /**  | 
 | 405 | +-     * Page Cache state data provider.  | 
 | 406 | +-     *  | 
 | 407 | +-     * @return array  | 
 | 408 | +-     */  | 
 | 409 | +-    public function disablingPageCacheStateProvider(): array  | 
 | 410 | +-    {  | 
 | 411 | +-        return [  | 
 | 412 | +-            ['stored_cache_state' => true, 'enable_cache_calls' => 1],  | 
 | 413 | +-            ['stored_cache_state' => false, 'enable_cache_calls' => 0],  | 
 | 414 | +-        ];  | 
 | 415 | +-    }  | 
 | 416 | +-}  | 
 | 417 | +diff --Nuar a/vendor/magento/module-page-cache/etc/events.xml b/vendor/magento/module-page-cache/etc/events.xml  | 
 | 418 | +--- a/vendor/magento/module-page-cache/etc/events.xml  | 
 | 419 | ++++ b/vendor/magento/module-page-cache/etc/events.xml  | 
 | 420 | +@@ -57,7 +57,4 @@  | 
 | 421 | +     <event name="customer_logout">  | 
 | 422 | +         <observer name="FlushFormKey" instance="Magento\PageCache\Observer\FlushFormKey"/>  | 
 | 423 | +     </event>  | 
 | 424 | +-    <event name="maintenance_mode_changed">  | 
 | 425 | +-        <observer name="page_cache_switcher_for_maintenance" instance="Magento\PageCache\Observer\SwitchPageCacheOnMaintenance"/>  | 
 | 426 | +-    </event>  | 
 | 427 | + </config>  | 
0 commit comments