renamed HttpKernel/Cache/ namespace to HttpKernel/HttpCache/
This commit is contained in:
parent
d10f631c3d
commit
75404e6bd6
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Cache;
|
||||
namespace Symfony\Bundle\FrameworkBundle\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\Cache\Cache as BaseCache;
|
||||
use Symfony\Component\HttpKernel\Cache\Esi;
|
||||
use Symfony\Component\HttpKernel\Cache\Store;
|
||||
use Symfony\Component\HttpKernel\HttpCache\HttpCache as BaseHttpCache;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Esi;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
@ -22,7 +22,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
|
||||
*/
|
||||
abstract class Cache extends BaseCache
|
||||
abstract class HttpCache extends BaseHttpCache
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
@ -69,7 +69,7 @@ class HttpKernel extends BaseHttpKernel
|
||||
* Renders a Controller and returns the Response content.
|
||||
*
|
||||
* Note that this method generates an esi:include tag only when both the standalone
|
||||
* option is set to true and the request has ESI capability (@see Symfony\Component\HttpKernel\Cache\ESI).
|
||||
* option is set to true and the request has ESI capability (@see Symfony\Component\HttpKernel\HttpCache\ESI).
|
||||
*
|
||||
* Available options:
|
||||
*
|
||||
|
@ -5,8 +5,8 @@
|
||||
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">
|
||||
|
||||
<parameters>
|
||||
<parameter key="esi.class">Symfony\Component\HttpKernel\Cache\Esi</parameter>
|
||||
<parameter key="esi_listener.class">Symfony\Component\HttpKernel\Cache\EsiListener</parameter>
|
||||
<parameter key="esi.class">Symfony\Component\HttpKernel\HttpCache\Esi</parameter>
|
||||
<parameter key="esi_listener.class">Symfony\Component\HttpKernel\HttpCache\EsiListener</parameter>
|
||||
</parameters>
|
||||
|
||||
<services>
|
||||
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@ -167,12 +167,12 @@ class Esi
|
||||
/**
|
||||
* Handles an ESI from the cache.
|
||||
*
|
||||
* @param Cache $cache A Cache instance
|
||||
* @param string $uri The main URI
|
||||
* @param string $alt An alternative URI
|
||||
* @param Boolean $ignoreErrors Whether to ignore errors or not
|
||||
* @param HttpCache $cache An HttpCache instance
|
||||
* @param string $uri The main URI
|
||||
* @param string $alt An alternative URI
|
||||
* @param Boolean $ignoreErrors Whether to ignore errors or not
|
||||
*/
|
||||
public function handle(Cache $cache, $uri, $alt, $ignoreErrors)
|
||||
public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
|
||||
{
|
||||
$subRequest = Request::create($uri, 'get', array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all());
|
||||
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
@ -13,7 +13,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*/
|
||||
class Cache implements HttpKernelInterface
|
||||
class HttpCache implements HttpKernelInterface
|
||||
{
|
||||
protected $kernel;
|
||||
protected $traces;
|
@ -12,7 +12,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
@ -9,10 +9,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpKernel\Cache\Esi;
|
||||
use Symfony\Component\HttpKernel\Cache\EsiListener;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Esi;
|
||||
use Symfony\Component\HttpKernel\HttpCache\EsiListener;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
@ -9,9 +9,9 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpKernel\Cache\Esi;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Esi;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
@ -182,7 +182,7 @@ class EsiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function getCache($request, $response)
|
||||
{
|
||||
$cache = $this->getMock('Symfony\Component\HttpKernel\Cache\Cache', array('getRequest', 'handle'), array(), '', false);
|
||||
$cache = $this->getMock('Symfony\Component\HttpKernel\HttpCache\HttpCache', array('getRequest', 'handle'), array(), '', false);
|
||||
$cache->expects($this->any())
|
||||
->method('getRequest')
|
||||
->will($this->returnValue($request))
|
@ -9,11 +9,11 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
|
||||
|
||||
require_once __DIR__.'/CacheTestCase.php';
|
||||
require_once __DIR__.'/HttpCacheTestCase.php';
|
||||
|
||||
class CacheTest extends CacheTestCase
|
||||
class HttpCacheTest extends HttpCacheTestCase
|
||||
{
|
||||
public function testPassesOnNonGetHeadRequests()
|
||||
{
|
@ -9,16 +9,16 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
|
||||
|
||||
require_once __DIR__.'/TestHttpKernel.php';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Cache\Cache;
|
||||
use Symfony\Component\HttpKernel\Cache\Store;
|
||||
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
||||
class CacheTestCase extends \PHPUnit_Framework_TestCase
|
||||
class HttpCacheTestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $kernel;
|
||||
protected $cache;
|
||||
@ -112,7 +112,7 @@ class CacheTestCase extends \PHPUnit_Framework_TestCase
|
||||
$this->store = new Store(sys_get_temp_dir().'/http_cache');
|
||||
|
||||
$this->cacheConfig['debug'] = true;
|
||||
$this->cache = new Cache($this->kernel, $this->store, null, $this->cacheConfig);
|
||||
$this->cache = new HttpCache($this->kernel, $this->store, null, $this->cacheConfig);
|
||||
$this->request = Request::create($uri, $method, array(), $cookies, array(), $server);
|
||||
|
||||
$this->response = $this->cache->handle($this->request, HttpKernelInterface::MASTER_REQUEST, $this->catch);
|
@ -9,15 +9,15 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
|
||||
|
||||
require_once __DIR__.'/CacheTestCase.php';
|
||||
require_once __DIR__.'/HttpCacheTestCase.php';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Cache\Store;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||
|
||||
class CacheStoreTest extends \PHPUnit_Framework_TestCase
|
||||
class StoreTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $request;
|
||||
protected $response;
|
||||
@ -28,7 +28,7 @@ class CacheStoreTest extends \PHPUnit_Framework_TestCase
|
||||
$this->request = Request::create('/');
|
||||
$this->response = new Response('hello world', 200, array());
|
||||
|
||||
CacheTestCase::clearDirectory(sys_get_temp_dir().'/http_cache');
|
||||
HttpCacheTestCase::clearDirectory(sys_get_temp_dir().'/http_cache');
|
||||
|
||||
$this->store = new Store(sys_get_temp_dir().'/http_cache');
|
||||
}
|
||||
@ -37,7 +37,7 @@ class CacheStoreTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->store = null;
|
||||
|
||||
CacheTestCase::clearDirectory(sys_get_temp_dir().'/http_cache');
|
||||
HttpCacheTestCase::clearDirectory(sys_get_temp_dir().'/http_cache');
|
||||
}
|
||||
|
||||
public function testReadsAnEmptyArrayWithReadWhenNothingCachedAtKey()
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpKernel\Cache;
|
||||
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpKernel\HttpKernel;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
Reference in New Issue
Block a user