PHP 8.3.30
Preview: SurrogateInterface.php Size: 2.07 KB
/home/getspomw/.trash/vendor/symfony/http-kernel/HttpCache/SurrogateInterface.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\HttpKernel\HttpCache;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

interface SurrogateInterface
{
    /**
     * Returns surrogate name.
     */
    public function getName(): string;

    /**
     * Returns a new cache strategy instance.
     */
    public function createCacheStrategy(): ResponseCacheStrategyInterface;

    /**
     * Checks that at least one surrogate has Surrogate capability.
     */
    public function hasSurrogateCapability(Request $request): bool;

    /**
     * Adds Surrogate-capability to the given Request.
     */
    public function addSurrogateCapability(Request $request): void;

    /**
     * Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.
     *
     * This method only adds an Surrogate HTTP header if the Response has some Surrogate tags.
     */
    public function addSurrogateControl(Response $response): void;

    /**
     * Checks that the Response needs to be parsed for Surrogate tags.
     */
    public function needsParsing(Response $response): bool;

    /**
     * Renders a Surrogate tag.
     *
     * @param string|null $alt     An alternate URI
     * @param string      $comment A comment to add as an esi:include tag
     */
    public function renderIncludeTag(string $uri, ?string $alt = null, bool $ignoreErrors = true, string $comment = ''): string;

    /**
     * Replaces a Response Surrogate tags with the included resource content.
     */
    public function process(Request $request, Response $response): Response;

    /**
     * Handles a Surrogate from the cache.
     *
     * @param string $alt An alternative URI
     *
     * @throws \RuntimeException
     * @throws \Exception
     */
    public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string;
}

Directory Contents

Dirs: 0 × Files: 11

Name Size Perms Modified Actions
4.32 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
2.07 KB lrw-r--r-- 2026-04-19 13:22:38
Edit Download
3.20 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
26.18 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
8.47 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
1013 B lrw-rw-rw- 2025-09-17 06:53:21
Edit Download
2.50 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
14.20 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
2.13 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
3.83 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
2.07 KB lrw-rw-rw- 2025-09-17 06:53:21
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).