for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Aoe\Varnish\System;
use Aoe\Varnish\Domain\Model\TagInterface;
class Header
{
/**
* @var string
*/
const HEADER_TAGS = 'X-Tags: %s';
const HEADER_DEBUG = 'X-Debug: 1';
const HEADER_ENABLED = 'X-Varnish-enabled: 1';
const HEADER_STRIP_QUERY_PARAMETER = 'X-Varnish-Strip-Query-Parameter: 1';
* @param TagInterface $tag
* @return void
public function sendHeaderForTag(TagInterface $tag)
if (false === $tag->isValid()) {
throw new \RuntimeException('Tag is not valid', 1435047447);
}
header(sprintf(self::HEADER_TAGS, $tag->getIdentifier()), false);
public function sendDebugHeader()
header(self::HEADER_DEBUG);
public function sendEnabledHeader()
header(self::HEADER_ENABLED);
public function sendStripQueryParameterHeader()
header(self::HEADER_STRIP_QUERY_PARAMETER);