Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public function setGenerateUrlType($generateUrlType)
*/
public function tagResponse(Response $response, array $tags, $replace = false)
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.2 and will be removed in 2.0. Use the TagHandler instead.', E_USER_DEPRECATED);

if (!$replace && $response->headers->has($this->getTagsHeader())) {
$header = $response->headers->get($this->getTagsHeader());
if ('' !== $header) {
Expand Down
4 changes: 4 additions & 0 deletions Command/InvalidateTagCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public function __construct($tagHandler = null, $commandName = 'fos:httpcache:in
)
);
}
if ($tagHandler instanceof CacheManager) {
@trigger_error('Passing the CacheManager to '.__CLASS__.' is deprecated since version 1.2 and will be removed in 2.0. Provide the TagHandler instead.', E_USER_DEPRECATED);

}
$this->commandName = $commandName;
$this->tagHandler = $tagHandler;
parent::__construct();
Expand Down
2 changes: 2 additions & 0 deletions HttpCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

@trigger_error('The '.__NAMESPACE__.'\HttpCache class is deprecated since version 1.2 and will be removed in 2.0. Use FOS\HttpCacheBundle\SymfonyCache\EventDispatchingHttpCache instead.', E_USER_DEPRECATED);

/**
* Base class for enhanced Symfony reverse proxy based on the symfony FrameworkBundle HttpCache.
*
Expand Down
3 changes: 3 additions & 0 deletions Tests/Unit/CacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function testRefreshRoute()
;
}

/**
* @group legacy
*/
public function testTagResponse()
{
$ban = \Mockery::mock('\FOS\HttpCache\ProxyClient\Invalidation\BanInterface');
Expand Down
3 changes: 3 additions & 0 deletions Tests/Unit/HttpCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;

/**
* @group legacy
*/
class HttpCacheTest extends \PHPUnit_Framework_TestCase
{
/**
Expand Down