From 75404e6bd642f831efe4b976a83f7143183d99d7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Jan 2011 21:38:45 +0100 Subject: [PATCH] renamed HttpKernel/Cache/ namespace to HttpKernel/HttpCache/ --- .../{Cache/Cache.php => HttpCache/HttpCache.php} | 10 +++++----- src/Symfony/Bundle/FrameworkBundle/HttpKernel.php | 2 +- .../Bundle/FrameworkBundle/Resources/config/esi.xml | 4 ++-- .../HttpKernel/{Cache => HttpCache}/Esi.php | 12 ++++++------ .../HttpKernel/{Cache => HttpCache}/EsiListener.php | 2 +- .../{Cache/Cache.php => HttpCache/HttpCache.php} | 4 ++-- .../HttpKernel/{Cache => HttpCache}/Store.php | 2 +- .../{Cache => HttpCache}/EsiListenerTest.php | 6 +++--- .../HttpKernel/{Cache => HttpCache}/EsiTest.php | 6 +++--- .../CacheTest.php => HttpCache/HttpCacheTest.php} | 6 +++--- .../HttpCacheTestCase.php} | 10 +++++----- .../HttpKernel/{Cache => HttpCache}/StoreTest.php | 12 ++++++------ .../{Cache => HttpCache}/TestHttpKernel.php | 2 +- 13 files changed, 39 insertions(+), 39 deletions(-) rename src/Symfony/Bundle/FrameworkBundle/{Cache/Cache.php => HttpCache/HttpCache.php} (86%) rename src/Symfony/Component/HttpKernel/{Cache => HttpCache}/Esi.php (95%) rename src/Symfony/Component/HttpKernel/{Cache => HttpCache}/EsiListener.php (96%) rename src/Symfony/Component/HttpKernel/{Cache/Cache.php => HttpCache/HttpCache.php} (99%) rename src/Symfony/Component/HttpKernel/{Cache => HttpCache}/Store.php (99%) rename tests/Symfony/Tests/Component/HttpKernel/{Cache => HttpCache}/EsiListenerTest.php (92%) rename tests/Symfony/Tests/Component/HttpKernel/{Cache => HttpCache}/EsiTest.php (96%) rename tests/Symfony/Tests/Component/HttpKernel/{Cache/CacheTest.php => HttpCache/HttpCacheTest.php} (99%) rename tests/Symfony/Tests/Component/HttpKernel/{Cache/CacheTestCase.php => HttpCache/HttpCacheTestCase.php} (93%) rename tests/Symfony/Tests/Component/HttpKernel/{Cache => HttpCache}/StoreTest.php (95%) rename tests/Symfony/Tests/Component/HttpKernel/{Cache => HttpCache}/TestHttpKernel.php (97%) diff --git a/src/Symfony/Bundle/FrameworkBundle/Cache/Cache.php b/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php similarity index 86% rename from src/Symfony/Bundle/FrameworkBundle/Cache/Cache.php rename to src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php index 7f87a37cd1ab..75ac9edaa707 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Cache/Cache.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php @@ -1,11 +1,11 @@ */ -abstract class Cache extends BaseCache +abstract class HttpCache extends BaseHttpCache { /** * Constructor. diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 073f9429247a..8511b671bd64 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -69,7 +69,7 @@ public function forward($controller, array $attributes = array(), array $query = * 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: * diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml index 094420e565bb..822330d6e959 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml @@ -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"> - Symfony\Component\HttpKernel\Cache\Esi - Symfony\Component\HttpKernel\Cache\EsiListener + Symfony\Component\HttpKernel\HttpCache\Esi + Symfony\Component\HttpKernel\HttpCache\EsiListener diff --git a/src/Symfony/Component/HttpKernel/Cache/Esi.php b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php similarity index 95% rename from src/Symfony/Component/HttpKernel/Cache/Esi.php rename to src/Symfony/Component/HttpKernel/HttpCache/Esi.php index dd9872cf03d5..20d8dc44cb15 100644 --- a/src/Symfony/Component/HttpKernel/Cache/Esi.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php @@ -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 @@ public function process(Request $request, Response $response) /** * 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()); diff --git a/src/Symfony/Component/HttpKernel/Cache/EsiListener.php b/src/Symfony/Component/HttpKernel/HttpCache/EsiListener.php similarity index 96% rename from src/Symfony/Component/HttpKernel/Cache/EsiListener.php rename to src/Symfony/Component/HttpKernel/HttpCache/EsiListener.php index a6b7ab80253d..f240e4f151be 100644 --- a/src/Symfony/Component/HttpKernel/Cache/EsiListener.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/EsiListener.php @@ -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; diff --git a/src/Symfony/Component/HttpKernel/Cache/Cache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php similarity index 99% rename from src/Symfony/Component/HttpKernel/Cache/Cache.php rename to src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 8ee9689a6984..93d27b4260a1 100644 --- a/src/Symfony/Component/HttpKernel/Cache/Cache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -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 @@ * * @author Fabien Potencier */ -class Cache implements HttpKernelInterface +class HttpCache implements HttpKernelInterface { protected $kernel; protected $traces; diff --git a/src/Symfony/Component/HttpKernel/Cache/Store.php b/src/Symfony/Component/HttpKernel/HttpCache/Store.php similarity index 99% rename from src/Symfony/Component/HttpKernel/Cache/Store.php rename to src/Symfony/Component/HttpKernel/HttpCache/Store.php index 76ad62605a20..10725c40897d 100644 --- a/src/Symfony/Component/HttpKernel/Cache/Store.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -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; diff --git a/tests/Symfony/Tests/Component/HttpKernel/Cache/EsiListenerTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/EsiListenerTest.php similarity index 92% rename from tests/Symfony/Tests/Component/HttpKernel/Cache/EsiListenerTest.php rename to tests/Symfony/Tests/Component/HttpKernel/HttpCache/EsiListenerTest.php index fb6d27fa152c..d17c3b40a117 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/Cache/EsiListenerTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/EsiListenerTest.php @@ -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; diff --git a/tests/Symfony/Tests/Component/HttpKernel/Cache/EsiTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/EsiTest.php similarity index 96% rename from tests/Symfony/Tests/Component/HttpKernel/Cache/EsiTest.php rename to tests/Symfony/Tests/Component/HttpKernel/HttpCache/EsiTest.php index 416a512d9620..34c2e3eb10c5 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/Cache/EsiTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/EsiTest.php @@ -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 @@ public function testHandleWhenResponseIsNot200AndAltIsPresent() 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)) diff --git a/tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php similarity index 99% rename from tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTest.php rename to tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php index 3a7133881b83..ba67bdc4d7ea 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php @@ -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() { diff --git a/tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTestCase.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php similarity index 93% rename from tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTestCase.php rename to tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php index 86a3ac8262bb..1af5811cc180 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/Cache/CacheTestCase.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php @@ -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 @@ public function request($method, $uri = '/', $server = array(), $cookies = array $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); diff --git a/tests/Symfony/Tests/Component/HttpKernel/Cache/StoreTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/StoreTest.php similarity index 95% rename from tests/Symfony/Tests/Component/HttpKernel/Cache/StoreTest.php rename to tests/Symfony/Tests/Component/HttpKernel/HttpCache/StoreTest.php index f38e86936b57..50a2574dd6bb 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/Cache/StoreTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/StoreTest.php @@ -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 @@ protected function setUp() $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 @@ protected function tearDown() { $this->store = null; - CacheTestCase::clearDirectory(sys_get_temp_dir().'/http_cache'); + HttpCacheTestCase::clearDirectory(sys_get_temp_dir().'/http_cache'); } public function testReadsAnEmptyArrayWithReadWhenNothingCachedAtKey() diff --git a/tests/Symfony/Tests/Component/HttpKernel/Cache/TestHttpKernel.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/TestHttpKernel.php similarity index 97% rename from tests/Symfony/Tests/Component/HttpKernel/Cache/TestHttpKernel.php rename to tests/Symfony/Tests/Component/HttpKernel/HttpCache/TestHttpKernel.php index aed742daf930..5f8ae66aea5f 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/Cache/TestHttpKernel.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/TestHttpKernel.php @@ -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;