Skip to content

Commit

Permalink
renamed HttpKernel/Cache/ namespace to HttpKernel/HttpCache/
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 26, 2011
1 parent d10f631 commit 75404e6
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
@@ -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;

Expand All @@ -22,7 +22,7 @@
*
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
*/
abstract class Cache extends BaseCache
abstract class HttpCache extends BaseHttpCache
{
/**
* Constructor.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
Expand Up @@ -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:
*
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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;
Expand All @@ -24,7 +24,7 @@
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class Cache implements HttpKernelInterface
class HttpCache implements HttpKernelInterface
{
protected $kernel;
protected $traces;
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -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))
Expand Down
Expand Up @@ -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()
{
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Expand Up @@ -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;
Expand All @@ -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');
}
Expand All @@ -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()
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit 75404e6

Please sign in to comment.