annotate vendor/symfony/http-kernel/HttpCache/StoreInterface.php @ 8:50b0d041100e

Further files for download
author Chris Cannam
date Mon, 05 Feb 2018 10:56:40 +0000
parents 4c8ae668cc8c
children 1fec387a4317
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /*
Chris@0 4 * This file is part of the Symfony package.
Chris@0 5 *
Chris@0 6 * (c) Fabien Potencier <fabien@symfony.com>
Chris@0 7 *
Chris@0 8 * This code is partially based on the Rack-Cache library by Ryan Tomayko,
Chris@0 9 * which is released under the MIT license.
Chris@0 10 *
Chris@0 11 * For the full copyright and license information, please view the LICENSE
Chris@0 12 * file that was distributed with this source code.
Chris@0 13 */
Chris@0 14
Chris@0 15 namespace Symfony\Component\HttpKernel\HttpCache;
Chris@0 16
Chris@0 17 use Symfony\Component\HttpFoundation\Request;
Chris@0 18 use Symfony\Component\HttpFoundation\Response;
Chris@0 19
Chris@0 20 /**
Chris@0 21 * Interface implemented by HTTP cache stores.
Chris@0 22 *
Chris@0 23 * @author Fabien Potencier <fabien@symfony.com>
Chris@0 24 */
Chris@0 25 interface StoreInterface
Chris@0 26 {
Chris@0 27 /**
Chris@0 28 * Locates a cached Response for the Request provided.
Chris@0 29 *
Chris@0 30 * @param Request $request A Request instance
Chris@0 31 *
Chris@0 32 * @return Response|null A Response instance, or null if no cache entry was found
Chris@0 33 */
Chris@0 34 public function lookup(Request $request);
Chris@0 35
Chris@0 36 /**
Chris@0 37 * Writes a cache entry to the store for the given Request and Response.
Chris@0 38 *
Chris@0 39 * Existing entries are read and any that match the response are removed. This
Chris@0 40 * method calls write with the new list of cache entries.
Chris@0 41 *
Chris@0 42 * @param Request $request A Request instance
Chris@0 43 * @param Response $response A Response instance
Chris@0 44 *
Chris@0 45 * @return string The key under which the response is stored
Chris@0 46 */
Chris@0 47 public function write(Request $request, Response $response);
Chris@0 48
Chris@0 49 /**
Chris@0 50 * Invalidates all cache entries that match the request.
Chris@0 51 *
Chris@0 52 * @param Request $request A Request instance
Chris@0 53 */
Chris@0 54 public function invalidate(Request $request);
Chris@0 55
Chris@0 56 /**
Chris@0 57 * Locks the cache for a given Request.
Chris@0 58 *
Chris@0 59 * @param Request $request A Request instance
Chris@0 60 *
Chris@0 61 * @return bool|string true if the lock is acquired, the path to the current lock otherwise
Chris@0 62 */
Chris@0 63 public function lock(Request $request);
Chris@0 64
Chris@0 65 /**
Chris@0 66 * Releases the lock for the given Request.
Chris@0 67 *
Chris@0 68 * @param Request $request A Request instance
Chris@0 69 *
Chris@0 70 * @return bool False if the lock file does not exist or cannot be unlocked, true otherwise
Chris@0 71 */
Chris@0 72 public function unlock(Request $request);
Chris@0 73
Chris@0 74 /**
Chris@0 75 * Returns whether or not a lock exists.
Chris@0 76 *
Chris@0 77 * @param Request $request A Request instance
Chris@0 78 *
Chris@0 79 * @return bool true if lock exists, false otherwise
Chris@0 80 */
Chris@0 81 public function isLocked(Request $request);
Chris@0 82
Chris@0 83 /**
Chris@0 84 * Purges data for the given URL.
Chris@0 85 *
Chris@0 86 * @param string $url A URL
Chris@0 87 *
Chris@0 88 * @return bool true if the URL exists and has been purged, false otherwise
Chris@0 89 */
Chris@0 90 public function purge($url);
Chris@0 91
Chris@0 92 /**
Chris@0 93 * Cleanups storage.
Chris@0 94 */
Chris@0 95 public function cleanup();
Chris@0 96 }