renamed RequestHandler component to HttpKernel

This commit is contained in:
Fabien Potencier 2010-05-06 12:04:50 +02:00
parent d41e33782a
commit 6328d514a3
39 changed files with 144 additions and 149 deletions

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
/*
* This file is part of the Symfony framework.
@ -18,7 +18,7 @@ namespace Symfony\Components\RequestHandler;
* (and those that only apply to requests or responses).
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class CacheControl
@ -30,9 +30,9 @@ class CacheControl
/**
* Constructor.
*
* @param Symfony\Components\RequestHandler\HeaderBag $bag A HeaderBag instance
* @param string $header The value of the Cache-Control HTTP header
* @param string $type The type (null, request, or response)
* @param Symfony\Components\HttpKernel\HeaderBag $bag A HeaderBag instance
* @param string $header The value of the Cache-Control HTTP header
* @param string $type The type (null, request, or response)
*/
public function __construct(HeaderBag $bag, $header, $type = null)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler\Exception;
namespace Symfony\Components\HttpKernel\Exception;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler\Exception;
* ForbiddenHttpException.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class ForbiddenHttpException extends HttpException

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler\Exception;
namespace Symfony\Components\HttpKernel\Exception;
/*
* This file is part of the Symfony package.
@ -17,7 +17,7 @@ namespace Symfony\Components\RequestHandler\Exception;
* By convention, exception code == response status code.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class HttpException extends \Exception

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler\Exception;
namespace Symfony\Components\HttpKernel\Exception;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler\Exception;
* NotFoundHttpException.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class NotFoundHttpException extends HttpException

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler\Exception;
namespace Symfony\Components\HttpKernel\Exception;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler\Exception;
* UnauthorizedHttpException.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class UnauthorizedHttpException extends HttpException

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler;
* HeaderBag is a ParameterBag optimized to hold header HTTP headers.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class HeaderBag extends ParameterBag
@ -113,7 +113,7 @@ class HeaderBag extends ParameterBag
/**
* Returns an instance able to manage the Cache-Control header.
*
* @return Symfony\Components\RequestHandler\Cache\CacheControl A CacheControl instance
* @return Symfony\Components\HttpKernel\Cache\CacheControl A CacheControl instance
*/
public function getCacheControl()
{

View File

@ -1,10 +1,10 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
use Symfony\Components\EventDispatcher\Event;
use Symfony\Components\EventDispatcher\EventDispatcher;
use Symfony\Components\RequestHandler\Exception\NotFoundHttpException;
use Symfony\Components\HttpKernel\Exception\NotFoundHttpException;
/*
* This file is part of the Symfony package.
@ -16,13 +16,13 @@ use Symfony\Components\RequestHandler\Exception\NotFoundHttpException;
*/
/**
* RequestHandler notifies events to convert a Request object to a Response one.
* HttpKernel notifies events to convert a Request object to a Response one.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class RequestHandler implements RequestHandlerInterface
class HttpKernel implements HttpKernelInterface
{
protected $dispatcher;
protected $request;

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
/*
* This file is part of the Symfony package.
@ -12,13 +12,13 @@ namespace Symfony\Components\RequestHandler;
*/
/**
* RequestHandlerInterface.
* HttpKernelInterface.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
interface RequestHandlerInterface
interface HttpKernelInterface
{
/**
* Handles a request to convert it to a response.

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler;
* ParameterBag is a container for key/value pairs.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class ParameterBag

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler;
* Request represents an HTTP request.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class Request

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler;
namespace Symfony\Components\HttpKernel;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler;
* Response represents an HTTP response.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class Response

View File

@ -1,9 +1,9 @@
<?php
namespace Symfony\Components\RequestHandler\Test;
namespace Symfony\Components\HttpKernel\Test;
use Symfony\Components\RequestHandler\RequestHandler;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\HttpKernel\HttpKernel;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\BrowserKit\Client as BaseClient;
use Symfony\Components\BrowserKit\Request as DomRequest;
use Symfony\Components\BrowserKit\Response as DomResponse;
@ -20,29 +20,29 @@ use Symfony\Components\BrowserKit\CookieJar;
*/
/**
* Client simulates a browser and makes requests to a RequestHandler object.
* Client simulates a browser and makes requests to a Kernel object.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class Client extends BaseClient
{
protected $requestHandler;
protected $kernel;
protected $test;
protected $testers;
/**
* Constructor.
*
* @param Symfony\Components\RequestHandler\RequestHandler $requestHandler A RequestHandler instance
* @param array $server The server parameters (equivalent of $_SERVER)
* @param Symfony\Components\BrowserKit\History $history A History instance to store the browser history
* @param Symfony\Components\BrowserKit\CookieJar $cookieJar A CookieJar instance to store the cookies
* @param Symfony\Components\HttpKernel\HttpKernel $kernel An HttpKernel instance
* @param array $server The server parameters (equivalent of $_SERVER)
* @param Symfony\Components\BrowserKit\History $history A History instance to store the browser history
* @param Symfony\Components\BrowserKit\CookieJar $cookieJar A CookieJar instance to store the cookies
*/
public function __construct(RequestHandler $requestHandler, array $server = array(), History $history = null, CookieJar $cookieJar = null)
public function __construct(HttpKernel $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)
{
$this->requestHandler = $requestHandler;
$this->kernel = $kernel;
$this->testers = array();
parent::__construct($server, $history, $cookieJar);
@ -103,23 +103,23 @@ class Client extends BaseClient
/**
* Makes a request.
*
* @param Symfony\Components\RequestHandler\Request $request A Request instance
* @param Symfony\Components\HttpKernel\Request $request A Request instance
*
* @param Symfony\Components\RequestHandler\Response $response A Response instance
* @param Symfony\Components\HttpKernel\Response $response A Response instance
*/
protected function doRequest($request)
{
return $this->requestHandler->handle($request);
return $this->kernel->handle($request);
}
/**
* Returns the script to execute when the request must be insulated.
*
* @param Symfony\Components\RequestHandler\Request $request A Request instance
* @param Symfony\Components\HttpKernel\Request $request A Request instance
*/
protected function getScript($request)
{
$requestHandler = serialize($this->requestHandler);
$kernel = serialize($this->kernel);
$request = serialize($request);
$r = new \ReflectionClass('\\Symfony\\Foundation\\UniversalClassLoader');
@ -136,17 +136,17 @@ require_once '$requirePath';
\$loader->registerNamespaces(array('Symfony' => '$symfonyPath'));
\$loader->register();
\$requestHandler = unserialize('$requestHandler');
echo serialize(\$requestHandler->handle(unserialize('$request')));
\$kernel = unserialize('$kernel');
echo serialize(\$kernel->handle(unserialize('$request')));
EOF;
}
/**
* Converts the BrowserKit request to a RequestHandler request.
* Converts the BrowserKit request to a HttpKernel request.
*
* @param Symfony\Components\BrowserKit\Request $request A Request instance
*
* @return Symfony\Components\RequestHandler\Request A Request instance
* @return Symfony\Components\HttpKernel\Request A Request instance
*/
protected function filterRequest(DomRequest $request)
{
@ -160,9 +160,9 @@ EOF;
}
/**
* Converts the RequestHandler response to a BrowserKit response.
* Converts the HttpKernel response to a BrowserKit response.
*
* @param Symfony\Components\RequestHandler\Response $response A Response instance
* @param Symfony\Components\HttpKernel\Response $response A Response instance
*
* @return Symfony\Components\BrowserKit\Response A Response instance
*/

View File

@ -1,8 +1,8 @@
<?php
namespace Symfony\Components\RequestHandler\Test;
namespace Symfony\Components\HttpKernel\Test;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\HttpKernel\Request;
/*
* This file is part of the Symfony package.
@ -17,7 +17,7 @@ use Symfony\Components\RequestHandler\Request;
* RequestTester implements tests for the Request object.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class RequestTester extends Tester
@ -27,7 +27,7 @@ class RequestTester extends Tester
/**
* Constructor.
*
* @param Symfony\Components\RequestHandler\Request $request A Request instance
* @param Symfony\Components\HttpKernel\Request $request A Request instance
*/
public function __construct(Request $request)
{

View File

@ -1,8 +1,8 @@
<?php
namespace Symfony\Components\RequestHandler\Test;
namespace Symfony\Components\HttpKernel\Test;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Response;
use Symfony\Components\DomCrawler\Crawler;
/*
@ -18,7 +18,7 @@ use Symfony\Components\DomCrawler\Crawler;
* ResponseTester implements tests for the Response object.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class ResponseTester extends Tester
@ -29,7 +29,7 @@ class ResponseTester extends Tester
/**
* Constructor.
*
* @param Symfony\Components\RequestHandler\Response $response A Response instance
* @param Symfony\Components\HttpKernel\Response $response A Response instance
*/
public function __construct(Response $response)
{

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler\Test;
namespace Symfony\Components\HttpKernel\Test;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler\Test;
* Tester is the base class for all tester classes.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class Tester implements TesterInterface

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Components\RequestHandler\Test;
namespace Symfony\Components\HttpKernel\Test;
/*
* This file is part of the Symfony package.
@ -15,7 +15,7 @@ namespace Symfony\Components\RequestHandler\Test;
* TesterInterface.
*
* @package Symfony
* @subpackage Components_RequestHandler
* @subpackage Components_HttpKernel
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
interface TesterInterface

View File

@ -52,9 +52,9 @@ class KernelExtension extends LoaderExtension
'Symfony\\Components\\EventDispatcher\\Event',
'Symfony\\Components\\Routing\\Matcher\\UrlMatcherInterface',
'Symfony\\Components\\Routing\\Matcher\\UrlMatcher',
'Symfony\\Components\\RequestHandler\\RequestHandler',
'Symfony\\Components\\RequestHandler\\Request',
'Symfony\\Components\\RequestHandler\\Response',
'Symfony\\Components\\HttpKernel\\HttpKernel',
'Symfony\\Components\\HttpKernel\\Request',
'Symfony\\Components\\HttpKernel\\Response',
'Symfony\\Components\\Templating\\Loader\\LoaderInterface',
'Symfony\\Components\\Templating\\Loader\\Loader',
'Symfony\\Components\\Templating\\Loader\\FilesystemLoader',

View File

@ -7,8 +7,8 @@ use Symfony\Components\DependencyInjection\Builder;
use Symfony\Components\DependencyInjection\BuilderConfiguration;
use Symfony\Components\DependencyInjection\Dumper\PhpDumper;
use Symfony\Components\DependencyInjection\FileResource;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\RequestHandlerInterface;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\HttpKernelInterface;
/*
* This file is part of the Symfony package.
@ -27,7 +27,7 @@ use Symfony\Components\RequestHandler\RequestHandlerInterface;
* @subpackage Foundation
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
*/
abstract class Kernel implements RequestHandlerInterface, \Serializable
abstract class Kernel implements HttpKernelInterface, \Serializable
{
protected $bundles;
protected $bundleDirs;
@ -198,11 +198,11 @@ abstract class Kernel implements RequestHandlerInterface, \Serializable
if (true === $raw)
{
return $this->container->getRequestHandlerService()->handleRaw($request, $main);
return $this->container->getHttpKernelService()->handleRaw($request, $main);
}
else
{
return $this->container->getRequestHandlerService()->handle($request, $main);
return $this->container->getHttpKernelService()->handle($request, $main);
}
}

View File

@ -6,9 +6,9 @@
<parameters>
<parameter key="event_dispatcher.class">Symfony\Foundation\EventDispatcher</parameter>
<parameter key="request_handler.class">Symfony\Components\RequestHandler\RequestHandler</parameter>
<parameter key="request.class">Symfony\Components\RequestHandler\Request</parameter>
<parameter key="response.class">Symfony\Components\RequestHandler\Response</parameter>
<parameter key="http_kernel.class">Symfony\Components\HttpKernel\HttpKernel</parameter>
<parameter key="request.class">Symfony\Components\HttpKernel\Request</parameter>
<parameter key="response.class">Symfony\Components\HttpKernel\Response</parameter>
<parameter key="error_handler.class">Symfony\Foundation\Debug\ErrorHandler</parameter>
<parameter key="error_handler.level">null</parameter>
<parameter key="kernel.include_core_classes">true</parameter>
@ -24,7 +24,7 @@
<call method="register" />
</service>
<service id="request_handler" class="%request_handler.class%">
<service id="http_kernel" class="%http_kernel.class%">
<argument type="service" id="event_dispatcher" />
</service>

View File

@ -9,8 +9,8 @@
<parameter key="test.client.parameters" type="collection"></parameter>
<parameter key="test.client.history.class">Symfony\Components\BrowserKit\History</parameter>
<parameter key="test.client.cookiejar.class">Symfony\Components\BrowserKit\CookieJar</parameter>
<parameter key="test.tester.request.class">Symfony\Components\RequestHandler\Test\RequestTester</parameter>
<parameter key="test.tester.response.class">Symfony\Components\RequestHandler\Test\ResponseTester</parameter>
<parameter key="test.tester.request.class">Symfony\Components\HttpKernel\Test\RequestTester</parameter>
<parameter key="test.tester.response.class">Symfony\Components\HttpKernel\Test\ResponseTester</parameter>
</parameters>
<services>

View File

@ -3,7 +3,7 @@
namespace Symfony\Foundation\Test;
use Symfony\Foundation\Kernel;
use Symfony\Components\RequestHandler\Test\Client as BaseClient;
use Symfony\Components\HttpKernel\Test\Client as BaseClient;
use Symfony\Components\BrowserKit\History;
use Symfony\Components\BrowserKit\CookieJar;
@ -41,7 +41,7 @@ class Client extends BaseClient
$this->kernel = $kernel;
$this->container = $kernel->getContainer();
parent::__construct($kernel->getContainer()->getRequestHandlerService(), $server, $history, $cookieJar);
parent::__construct($kernel->getContainer()->getHttpKernelService(), $server, $history, $cookieJar);
$this->addTestersFromContainer();
}
@ -88,9 +88,9 @@ class Client extends BaseClient
/**
* Makes a request.
*
* @param Symfony\Components\RequestHandler\Request $request A Request instance
* @param Symfony\Components\HttpKernel\Request $request A Request instance
*
* @param Symfony\Components\RequestHandler\Response $response A Response instance
* @param Symfony\Components\HttpKernel\Response $response A Response instance
*/
protected function doRequest($request)
{
@ -102,7 +102,7 @@ class Client extends BaseClient
/**
* Returns the script to execute when the request must be insulated.
*
* @param Symfony\Components\RequestHandler\Request $request A Request instance
* @param Symfony\Components\HttpKernel\Request $request A Request instance
*/
protected function getScript($request)
{

View File

@ -154,9 +154,9 @@ class KernelExtension extends LoaderExtension
'Symfony\\Components\\EventDispatcher\\Event',
'Symfony\\Components\\Routing\\Matcher\\UrlMatcherInterface',
'Symfony\\Components\\Routing\\Matcher\\UrlMatcher',
'Symfony\\Components\\RequestHandler\\RequestHandler',
'Symfony\\Components\\RequestHandler\\Request',
'Symfony\\Components\\RequestHandler\\Response',
'Symfony\\Components\\HttpKernel\\HttpKernel',
'Symfony\\Components\\HttpKernel\\Request',
'Symfony\\Components\\HttpKernel\\Response',
'Symfony\\Components\\Templating\\Loader\\LoaderInterface',
'Symfony\\Components\\Templating\\Loader\\Loader',
'Symfony\\Components\\Templating\\Loader\\FilesystemLoader',
@ -366,13 +366,13 @@ use Symfony\Components\DependencyInjection\Builder;
use Symfony\Components\DependencyInjection\BuilderConfiguration;
use Symfony\Components\DependencyInjection\Dumper\PhpDumper;
use Symfony\Components\DependencyInjection\FileResource;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\RequestHandlerInterface;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\HttpKernelInterface;
abstract class Kernel implements RequestHandlerInterface, \Serializable
abstract class Kernel implements HttpKernelInterface, \Serializable
{
protected $bundles;
protected $bundleDirs;
@ -499,11 +499,11 @@ abstract class Kernel implements RequestHandlerInterface, \Serializable
if (true === $raw)
{
return $this->container->getRequestHandlerService()->handleRaw($request, $main);
return $this->container->getHttpKernelService()->handleRaw($request, $main);
}
else
{
return $this->container->getRequestHandlerService()->handle($request, $main);
return $this->container->getHttpKernelService()->handle($request, $main);
}
}

View File

@ -3,8 +3,6 @@
namespace Symfony\Framework\DoctrineBundle\Controller;
use Symfony\Framework\WebBundle\Controller;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\Exception\NotFoundHttpException;
/*
* This file is part of the Symfony framework.

View File

@ -4,7 +4,7 @@ namespace Symfony\Framework\ProfilerBundle\DataCollector;
use Symfony\Components\DependencyInjection\ContainerInterface;
use Symfony\Components\EventDispatcher\Event;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Response;
use Symfony\Framework\ProfilerBundle\ProfilerStorage;
use Symfony\Foundation\LoggerInterface;

View File

@ -4,7 +4,7 @@ namespace Symfony\Framework\ProfilerBundle\Listener;
use Symfony\Components\DependencyInjection\ContainerInterface;
use Symfony\Components\EventDispatcher\Event;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Response;
use Symfony\Framework\ProfilerBundle\DataCollector\DataCollectorManager;
/*

View File

@ -3,8 +3,8 @@
namespace Symfony\Framework\WebBundle;
use Symfony\Components\DependencyInjection\ContainerInterface;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\Response;
/*
* This file is part of the Symfony framework.

View File

@ -3,7 +3,6 @@
namespace Symfony\Framework\WebBundle\Controller;
use Symfony\Framework\WebBundle\Controller;
use Symfony\Components\RequestHandler\Request;
/*
* This file is part of the Symfony framework.

View File

@ -4,9 +4,9 @@ namespace Symfony\Framework\WebBundle\Controller;
use Symfony\Framework\WebBundle\Controller;
use Symfony\Framework\WebBundle\Debug\ExceptionFormatter;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\RequestHandler\Exception\HttpException;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\Response;
use Symfony\Components\HttpKernel\Exception\HttpException;
/*
* This file is part of the Symfony framework.

View File

@ -3,7 +3,6 @@
namespace Symfony\Framework\WebBundle\Controller;
use Symfony\Framework\WebBundle\Controller;
use Symfony\Components\RequestHandler\Request;
/*
* This file is part of the Symfony framework.

View File

@ -3,7 +3,6 @@
namespace Symfony\Framework\WebBundle\Controller;
use Symfony\Framework\WebBundle\Controller;
use Symfony\Components\RequestHandler\Request;
/*
* This file is part of the Symfony framework.

View File

@ -3,7 +3,7 @@
namespace Symfony\Framework\WebBundle\Helper;
use Symfony\Components\Templating\Helper\Helper;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\HttpKernel\Request;
/*
* This file is part of the Symfony framework.

View File

@ -47,7 +47,7 @@ class ControllerLoader
$subRequest = $request->duplicate($query, null, $path);
$response = $this->container->getRequestHandlerService()->handleRaw($subRequest, false);
$response = $this->container->getHttpKernelService()->handleRaw($subRequest, false);
$this->container->setService('request', $request);

View File

@ -4,8 +4,8 @@ namespace Symfony\Framework\WebBundle\Listener;
use Symfony\Components\EventDispatcher\EventDispatcher;
use Symfony\Components\EventDispatcher\Event;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\Response;
/*
* This file is part of the Symfony framework.

View File

@ -9,14 +9,14 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Components\RequestHandler;
namespace Symfony\Tests\Components\HttpKernel;
use Symfony\Components\RequestHandler\ParameterBag;
use Symfony\Components\HttpKernel\ParameterBag;
class ParameterBagTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::__construct
* @covers Symfony\Components\HttpKernel\ParameterBag::__construct
*/
public function testConstructor()
{
@ -24,7 +24,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::all
* @covers Symfony\Components\HttpKernel\ParameterBag::all
*/
public function testAll()
{
@ -33,7 +33,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::replace
* @covers Symfony\Components\HttpKernel\ParameterBag::replace
*/
public function testReplace()
{
@ -45,7 +45,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::get
* @covers Symfony\Components\HttpKernel\ParameterBag::get
*/
public function testGet()
{
@ -57,7 +57,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::set
* @covers Symfony\Components\HttpKernel\ParameterBag::set
*/
public function testSet()
{
@ -71,7 +71,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::has
* @covers Symfony\Components\HttpKernel\ParameterBag::has
*/
public function testHas()
{
@ -82,7 +82,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::getAlpha
* @covers Symfony\Components\HttpKernel\ParameterBag::getAlpha
*/
public function testGetAlpha()
{
@ -93,7 +93,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::getAlnum
* @covers Symfony\Components\HttpKernel\ParameterBag::getAlnum
*/
public function testGetAlnum()
{
@ -104,7 +104,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::getDigits
* @covers Symfony\Components\HttpKernel\ParameterBag::getDigits
*/
public function testGetDigits()
{
@ -115,7 +115,7 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\ParameterBag::getInt
* @covers Symfony\Components\HttpKernel\ParameterBag::getInt
*/
public function testGetInt()
{

View File

@ -9,14 +9,14 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Components\RequestHandler;
namespace Symfony\Tests\Components\HttpKernel;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\HttpKernel\Request;
class RequestTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Symfony\Components\RequestHandler\Request::__construct
* @covers Symfony\Components\HttpKernel\Request::__construct
*/
public function testConstructor()
{
@ -24,7 +24,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\Request::initialize
* @covers Symfony\Components\HttpKernel\Request::initialize
*/
public function testInitialize()
{
@ -44,7 +44,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\Request::duplicate
* @covers Symfony\Components\HttpKernel\Request::duplicate
*/
public function testDuplicate()
{
@ -65,7 +65,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
}
/**
* @covers Symfony\Components\RequestHandler\Request::getFormat
* @covers Symfony\Components\HttpKernel\Request::getFormat
*/
public function testGetFormat()
{

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Components\RequestHandler;
namespace Symfony\Tests\Components\HttpKernel;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Response;
class ResponseTest extends \PHPUnit_Framework_TestCase
{

View File

@ -9,18 +9,18 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Components\RequestHandler\Test;
namespace Symfony\Tests\Components\HttpKernel\Test;
use Symfony\Components\RequestHandler\Test\Client;
use Symfony\Components\RequestHandler\Test\RequestTester;
use Symfony\Components\RequestHandler\Test\ResponseTester;
use Symfony\Components\RequestHandler\RequestHandler;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\Test\Client;
use Symfony\Components\HttpKernel\Test\RequestTester;
use Symfony\Components\HttpKernel\Test\ResponseTester;
use Symfony\Components\HttpKernel\HttpKernel;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\Response;
use Symfony\Components\EventDispatcher\EventDispatcher;
use Symfony\Components\EventDispatcher\Event;
require_once __DIR__.'/TestRequestHandler.php';
require_once __DIR__.'/TestHttpKernel.php';
class TestClient extends Client
{
@ -28,7 +28,7 @@ class TestClient extends Client
{
$script = parent::getScript($request);
$script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/TestRequestHandler.php';", $script);
$script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/TestHttpKernel.php';", $script);
return $script;
}
@ -38,7 +38,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
{
public function testDoRequest()
{
$client = new Client(new TestRequestHandler());
$client = new Client(new TestHttpKernel());
$client->request('GET', '/');
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
@ -50,7 +50,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testGetScript()
{
$client = new TestClient(new TestRequestHandler());
$client = new TestClient(new TestHttpKernel());
$client->insulate();
$client->request('GET', '/');
@ -59,7 +59,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testAddHasGetTester()
{
$client = new TestClient(new TestRequestHandler());
$client = new TestClient(new TestHttpKernel());
$client->request('GET', '/');
$client->addTester('foo', $tester = new RequestTester($client->getRequest()));
@ -81,7 +81,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testMagicCall()
{
$client = new TestClient(new TestRequestHandler());
$client = new TestClient(new TestHttpKernel());
$client->request('DELETE', '/foo');
$client->addTester('request', new RequestTester($client->getRequest()));
$client->addTester('response', new ResponseTester($client->getResponse()));

View File

@ -9,15 +9,15 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Components\RequestHandler\Test;
namespace Symfony\Tests\Components\HttpKernel\Test;
use Symfony\Components\RequestHandler\RequestHandler;
use Symfony\Components\RequestHandler\Request;
use Symfony\Components\RequestHandler\Response;
use Symfony\Components\HttpKernel\HttpKernel;
use Symfony\Components\HttpKernel\Request;
use Symfony\Components\HttpKernel\Response;
use Symfony\Components\EventDispatcher\EventDispatcher;
use Symfony\Components\EventDispatcher\Event;
class TestRequestHandler extends RequestHandler
class TestHttpKernel extends HttpKernel
{
public function __construct()
{

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Components\RequestHandler\Test;
namespace Symfony\Tests\Components\HttpKernel\Test;
use Symfony\Components\RequestHandler\Test\Tester;
use Symfony\Components\HttpKernel\Test\Tester;
class TestTester extends Tester
{