diff --git a/autoload.php.dist b/autoload.php.dist index 594524991806..81ee7573a143 100644 --- a/autoload.php.dist +++ b/autoload.php.dist @@ -1,8 +1,8 @@ registerNamespaces(array( diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php index 6a167b4325ef..563a7d6e235c 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php @@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\Output; use Symfony\Bundle\FrameworkBundle\Console\Application; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php index 617b08da3ab6..39a0bfb4f94c 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php @@ -7,7 +7,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\Output; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; use Doctrine\ORM\Tools\EntityGenerator; /* diff --git a/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php b/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php index b04bedd586a1..d649938392ee 100644 --- a/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php +++ b/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\DoctrineBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /* * This file is part of the Symfony framework. diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php index 76c2dd3bc69f..29b77cd78ce1 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php @@ -2,7 +2,7 @@ namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class AnnotationsBundle extends Bundle { diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php index a45b03bf0b48..60bdabaf8db1 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php @@ -2,7 +2,7 @@ namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class XmlBundle extends Bundle { diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php index a19bad8d579f..8a55f4272a9e 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php @@ -2,7 +2,7 @@ namespace DoctrineBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class YamlBundle extends Bundle { diff --git a/src/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php b/src/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php index c3d022d2d6a7..b3861db2b827 100644 --- a/src/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php +++ b/src/Symfony/Bundle/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\DoctrineMigrationsBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /* * This file is part of the Symfony framework. diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php index 0e470f39d0e8..444de2b430b6 100755 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\DoctrineMongoDBBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /** * Doctrine MongoDB ODM bundle. diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php index 1ebe384185c4..23b96a825d60 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php @@ -2,9 +2,8 @@ namespace DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\AnnotationsBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class AnnotationsBundle extends Bundle { - -} \ No newline at end of file +} diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php index cd6d8c61879e..66897e59e8c5 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php @@ -2,7 +2,7 @@ namespace DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\XmlBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class XmlBundle extends Bundle { diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php index 897eb477eef9..a1fddd6fb7b2 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php @@ -2,7 +2,7 @@ namespace DoctrineMongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\YamlBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class YamlBundle extends Bundle { diff --git a/src/Symfony/Framework/Cache/Cache.php b/src/Symfony/Bundle/FrameworkBundle/Cache/Cache.php similarity index 97% rename from src/Symfony/Framework/Cache/Cache.php rename to src/Symfony/Bundle/FrameworkBundle/Cache/Cache.php index 8c2b0d3809de..9f14080b23ea 100644 --- a/src/Symfony/Framework/Cache/Cache.php +++ b/src/Symfony/Bundle/FrameworkBundle/Cache/Cache.php @@ -1,6 +1,6 @@ registerValidationConfiguration($config, $container); } + if (!$container->hasDefinition('event_dispatcher')) { + $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); + $loader->load('services.xml'); + + if ($container->getParameter('kernel.debug')) { + $loader->load('debug.xml'); + $container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher')); + $container->setAlias('debug.event_dispatcher', 'event_dispatcher'); + } + } + + if (isset($config['charset'])) { + $container->setParameter('kernel.charset', $config['charset']); + } + + foreach (array('error_handler', 'error-handler') as $key) { + if (array_key_exists($key, $config)) { + if (false === $config[$key]) { + $container->getDefinition('error_handler')->setMethodCalls(array()); + } else { + $container->getDefinition('error_handler')->addMethodCall('register', array()); + $container->setParameter('error_handler.level', $config[$key]); + } + } + } + $this->addCompiledClasses($container, array( 'Symfony\\Component\\HttpFoundation\\ParameterBag', 'Symfony\\Component\\HttpFoundation\\HeaderBag', @@ -196,6 +222,55 @@ public function templatingLoad($config, ContainerBuilder $container) )); } + /** + * Loads the test configuration. + * + * @param array $config A configuration array + * @param ContainerBuilder $container A ContainerBuilder instance + */ + public function testLoad($config, ContainerBuilder $container) + { + $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); + $loader->load('test.xml'); + } + + /** + * Loads the session configuration. + * + * @param array $config A configuration array + * @param ContainerBuilder $container A ContainerBuilder instance + */ + public function sessionLoad($config, ContainerBuilder $container) + { + if (!$container->hasDefinition('session')) { + $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); + $loader->load('session.xml'); + } + + if (isset($config['default_locale'])) { + $container->setParameter('session.default_locale', $config['default_locale']); + } + + if (isset($config['class'])) { + $container->setParameter('session.class', $config['class']); + } + + foreach (array('name', 'lifetime', 'path', 'domain', 'secure', 'httponly', 'cache_limiter', 'pdo.db_table') as $name) { + if (isset($config['session'][$name])) { + $container->setParameter('session.options.'.$name, $config['session'][$name]); + } + } + + if (isset($config['session']['class'])) { + $class = $config['session']['class']; + if (in_array($class, array('Native', 'Pdo'))) { + $class = 'Symfony\\Component\\HttpFoundation\\SessionStorage\\'.$class.'SessionStorage'; + } + + $container->setParameter('session.session', 'session.session.'.strtolower($class)); + } + } + /* diff --git a/src/Symfony/Framework/EventDispatcher.php b/src/Symfony/Bundle/FrameworkBundle/EventDispatcher.php similarity index 96% rename from src/Symfony/Framework/EventDispatcher.php rename to src/Symfony/Bundle/FrameworkBundle/EventDispatcher.php index f573e90439db..f73f44d97123 100644 --- a/src/Symfony/Framework/EventDispatcher.php +++ b/src/Symfony/Bundle/FrameworkBundle/EventDispatcher.php @@ -1,6 +1,6 @@ container->has('error_handler')) { + $this->container['error_handler']; + } + if ($this->container->hasParameter('csrf_secret')) { Form::setDefaultCsrfSecret($this->container->getParameter('csrf_secret')); Form::enableDefaultCsrfProtection(); diff --git a/src/Symfony/Bundle/FrameworkBundle/RequestListener.php b/src/Symfony/Bundle/FrameworkBundle/RequestListener.php index 556e20644bbb..1c774ddbb4e3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/RequestListener.php +++ b/src/Symfony/Bundle/FrameworkBundle/RequestListener.php @@ -3,7 +3,6 @@ namespace Symfony\Bundle\FrameworkBundle; use Symfony\Component\HttpKernel\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\Routing\RouterInterface; use Symfony\Component\HttpKernel\HttpKernelInterface; diff --git a/src/Symfony/Framework/Resources/config/debug.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml similarity index 85% rename from src/Symfony/Framework/Resources/config/debug.xml rename to src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml index 2519e88437ce..181aa8e667b0 100644 --- a/src/Symfony/Framework/Resources/config/debug.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd"> - Symfony\Framework\Debug\EventDispatcher + Symfony\Bundle\FrameworkBundle\Debug\EventDispatcher diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index f4caf0aebf84..2527bf56b466 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -18,6 +18,8 @@ + + diff --git a/src/Symfony/Framework/Resources/config/services.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml similarity index 88% rename from src/Symfony/Framework/Resources/config/services.xml rename to src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml index 7f688a537924..05e11c93b6d7 100644 --- a/src/Symfony/Framework/Resources/config/services.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml @@ -5,11 +5,11 @@ xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd"> - Symfony\Framework\EventDispatcher + Symfony\Bundle\FrameworkBundle\EventDispatcher Symfony\Component\HttpKernel\HttpKernel Symfony\Component\HttpFoundation\Request Symfony\Component\HttpFoundation\Response - Symfony\Framework\Debug\ErrorHandler + Symfony\Component\HttpKernel\Debug\ErrorHandler null diff --git a/src/Symfony/Framework/Resources/config/session.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml similarity index 100% rename from src/Symfony/Framework/Resources/config/session.xml rename to src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml diff --git a/src/Symfony/Framework/Resources/config/test.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml similarity index 92% rename from src/Symfony/Framework/Resources/config/test.xml rename to src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml index 83654351ff89..f9d946db85f3 100644 --- a/src/Symfony/Framework/Resources/config/test.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd"> - Symfony\Framework\Client + Symfony\Bundle\FrameworkBundle\Client Symfony\Component\BrowserKit\History Symfony\Component\BrowserKit\CookieJar diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml index e7fb6eb771c9..d0f0b81f5cd0 100755 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml @@ -9,7 +9,7 @@ Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver Symfony\Bundle\FrameworkBundle\Controller\ControllerNameConverter Symfony\Component\HttpKernel\ResponseListener - Symfony\Bundle\FrameworkBundle\Debug\ExceptionListener + Symfony\Component\HttpKernel\Debug\ExceptionListener Symfony\Bundle\FrameworkBundle\Controller\ExceptionController::exceptionAction Symfony\Component\HttpKernel\Cache\Esi Symfony\Component\HttpKernel\Cache\EsiListener diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Cache.php b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Cache.php index 10d11d7439cf..554a356e9a1e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Cache.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Cache.php @@ -2,7 +2,7 @@ require_once __DIR__.'/{{ class }}Kernel.php'; -use Symfony\Framework\Cache\Cache; +use Symfony\Bundle\FrameworkBundle\Cache\Cache; class {{ class }}Cache extends Cache { diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Kernel.php b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Kernel.php index 22aa81b55f69..5b165b2f3655 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Kernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/generic/Kernel.php @@ -2,7 +2,7 @@ require_once __DIR__.'/../src/autoload.php'; -use Symfony\Framework\Kernel; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\DependencyInjection\Loader\LoaderInterface; class {{ class }}Kernel extends Kernel @@ -15,7 +15,6 @@ public function registerRootDir() public function registerBundles() { $bundles = array( - new Symfony\Framework\KernelBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), // enable third-party bundles diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config.php b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config.php index 0be2e62aa012..dc5befdc5a4c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config.php @@ -1,14 +1,11 @@ loadFromExtension('kernel', 'config', array( +$container->loadFromExtension('web', 'config', array( 'charset' => 'UTF-8', 'error_handler' => null, -)); - -$container->loadFromExtension('web', 'config', array( - 'csrf-secret' => 'xxxxxxxxxx', - 'router' => array('resource' => '%kernel.root_dir%/config/routing.php'), - 'validation' => array('enabled' => true, 'annotations' => true), + 'csrf-secret' => 'xxxxxxxxxx', + 'router' => array('resource' => '%kernel.root_dir%/config/routing.php'), + 'validation' => array('enabled' => true, 'annotations' => true), )); $container->loadFromExtension('web', 'templating', array( diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config_test.php b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config_test.php index 3e85558417d4..7325b33925d7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config_test.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/php/config/config_test.php @@ -2,7 +2,7 @@ $loader->import('config_dev.php'); -$container->loadFromExtension('kernel', 'config', array( +$container->loadFromExtension('web', 'config', array( 'error_handler' => false, )); @@ -15,4 +15,4 @@ 'priority' => 'debug', )); -$container->loadFromExtension('kernel', 'test'); +$container->loadFromExtension('web', 'test'); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config.xml index 72783a206b6e..a8a1aafed6a3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config.xml @@ -2,7 +2,6 @@ - - - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config_test.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config_test.xml index 05310ad5dedb..4a9b9a5dbea7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config_test.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/xml/config/config_test.xml @@ -4,7 +4,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:zend="http://www.symfony-project.org/schema/dic/zend" xmlns:web="http://www.symfony-project.org/schema/dic/symfony" - xmlns:kernel="http://www.symfony-project.org/schema/dic/symfony/kernel" xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd http://www.symfony-project.org/schema/dic/zend http://www.symfony-project.org/schema/dic/zend/zend-1.0.xsd"> @@ -17,7 +16,7 @@ intercept-redirects="false" /> - @@ -25,5 +24,5 @@ priority="debug" /> - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config.yml b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config.yml index 1c7f12995299..0f4c4f206662 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config.yml @@ -1,11 +1,9 @@ -kernel.config: +web.config: charset: UTF-8 error_handler: null - -web.config: - csrf_secret: xxxxxxxxxx - router: { resource: "%kernel.root_dir%/config/routing.yml" } - validation: { enabled: true, annotations: true } + csrf_secret: xxxxxxxxxx + router: { resource: "%kernel.root_dir%/config/routing.yml" } + validation: { enabled: true, annotations: true } web.templating: escaping: htmlspecialchars diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config_test.yml b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config_test.yml index 9c3250071cda..ec11b3663a2b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config_test.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/application/yml/config/config_test.yml @@ -1,7 +1,7 @@ imports: - { resource: config_dev.yml } -kernel.config: +web.config: error_handler: false webprofiler.config: @@ -11,4 +11,4 @@ webprofiler.config: zend.logger: priority: debug -kernel.test: ~ +web.test: ~ diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php index 1ba3f4cd4afd..f908308616b7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/Bundle.php @@ -2,7 +2,7 @@ namespace {{ namespace }}\{{ bundle }}; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.txt.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.txt.php index 7e345e5400c1..0e720eb4d78a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.txt.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.txt.php @@ -15,5 +15,5 @@ -[symfony] v. (symfony-project.org) +[symfony] v. (symfony-project.org) [PHP] v. diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php index d68cc834944d..2166b83b5848 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php @@ -2,7 +2,8 @@ namespace Symfony\Bundle\FrameworkBundle\Test; -use Symfony\Framework\Test\WebTestCase as BaseWebTestCase; +use Symfony\Bundle\FrameworkBundle\Client; +use Symfony\Bundle\FrameworkBundle\WebTestCase as BaseWebTestCase; use Symfony\Component\Finder\Finder; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\HttpKernelInterface; @@ -23,6 +24,27 @@ */ abstract class WebTestCase extends BaseWebTestCase { + protected $kernel; + + /** + * Creates a Client. + * + * @param array $options An array of options to pass to the createKernel class + * @param array $server An array of server parameters + * + * @return Client A Client instance + */ + public function createClient(array $options = array(), array $server = array()) + { + $this->kernel = $this->createKernel($options); + $this->kernel->boot(); + + $client = $this->kernel->getContainer()->getTest_ClientService(); + $client->setServerParameters($server); + + return $client; + } + /** * Creates a Kernel. * diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel.php index e6894ad8807c..08b2f3ec0453 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel.php @@ -11,7 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests; -use Symfony\Framework\Kernel as BaseKernel; +use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\DependencyInjection\Loader\LoaderInterface; use Symfony\Bundle\FrameworkBundle\Util\Filesystem; @@ -45,7 +45,6 @@ public function registerRootDir() public function registerBundles() { return array( - new \Symfony\Framework\KernelBundle(), new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), ); } diff --git a/src/Symfony/Bundle/PropelBundle/PropelBundle.php b/src/Symfony/Bundle/PropelBundle/PropelBundle.php index 9ef7b4b47030..926a8507411b 100644 --- a/src/Symfony/Bundle/PropelBundle/PropelBundle.php +++ b/src/Symfony/Bundle/PropelBundle/PropelBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\PropelBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; class PropelBundle extends Bundle { diff --git a/src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php b/src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php index f79eeaf0b2f9..6041f2087990 100644 --- a/src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php +++ b/src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\SwiftmailerBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /* * This file is part of the Symfony framework. diff --git a/src/Symfony/Bundle/TwigBundle/TwigBundle.php b/src/Symfony/Bundle/TwigBundle/TwigBundle.php index 548faddc2341..3af5c94b5c22 100644 --- a/src/Symfony/Bundle/TwigBundle/TwigBundle.php +++ b/src/Symfony/Bundle/TwigBundle/TwigBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\TwigBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /* * This file is part of the Symfony package. diff --git a/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php b/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php index ae386eaa65bf..03f558a59cc7 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php +++ b/src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\WebProfilerBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /* * This file is part of the Symfony framework. diff --git a/src/Symfony/Bundle/ZendBundle/ZendBundle.php b/src/Symfony/Bundle/ZendBundle/ZendBundle.php index 526dd64ea04c..03c68a48b16f 100644 --- a/src/Symfony/Bundle/ZendBundle/ZendBundle.php +++ b/src/Symfony/Bundle/ZendBundle/ZendBundle.php @@ -2,7 +2,7 @@ namespace Symfony\Bundle\ZendBundle; -use Symfony\Framework\Bundle\Bundle; +use Symfony\Component\HttpKernel\Bundle\Bundle; /* * This file is part of the Symfony framework. diff --git a/src/Symfony/Framework/UniversalClassLoader.php b/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php similarity index 99% rename from src/Symfony/Framework/UniversalClassLoader.php rename to src/Symfony/Component/HttpFoundation/UniversalClassLoader.php index 0381b9b2bcaa..b651c225f40c 100644 --- a/src/Symfony/Framework/UniversalClassLoader.php +++ b/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php @@ -1,6 +1,6 @@ kernel); $request = serialize($request); - $r = new \ReflectionClass('\\Symfony\\Framework\\UniversalClassLoader'); + $r = new \ReflectionClass('\\Symfony\\Component\\HttpFoundation\\UniversalClassLoader'); $requirePath = $r->getFileName(); $symfonyPath = realpath(__DIR__.'/../../..'); @@ -77,7 +77,7 @@ protected function getScript($request) require_once '$requirePath'; -\$loader = new Symfony\Framework\UniversalClassLoader(); +\$loader = new Symfony\Component\HttpFoundation\UniversalClassLoader(); \$loader->registerNamespaces(array('Symfony' => '$symfonyPath')); \$loader->register(); diff --git a/src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php index 978131c94d7d..25a86d274af9 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php @@ -5,7 +5,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Framework\Debug\EventDispatcherTraceableInterface; +use Symfony\Component\HttpKernel\Debug\EventDispatcherTraceableInterface; /* * This file is part of the Symfony framework. diff --git a/src/Symfony/Framework/Debug/ErrorException.php b/src/Symfony/Component/HttpKernel/Debug/ErrorException.php similarity index 89% rename from src/Symfony/Framework/Debug/ErrorException.php rename to src/Symfony/Component/HttpKernel/Debug/ErrorException.php index dfabeee3e7fc..2b063ea9524e 100644 --- a/src/Symfony/Framework/Debug/ErrorException.php +++ b/src/Symfony/Component/HttpKernel/Debug/ErrorException.php @@ -1,6 +1,6 @@ registerNamespaces(array('Symfony' => __DIR__.'/../../../..')); +$loader->registerNamespaces(array('Symfony' => __DIR__.'/../../../../..')); $loader->register(); if (file_exists(__DIR__.'/../../bootstrap.php')) { @@ -23,11 +23,8 @@ } ClassCollectionLoader::load(array( - 'Symfony\\Framework\\Bundle\\Bundle', - 'Symfony\\Framework\\Bundle\\BundleInterface', - 'Symfony\\Framework\\KernelBundle', - 'Symfony\\Framework\\DependencyInjection\\KernelExtension', - 'Symfony\\Framework\\Debug\\ErrorHandler', - 'Symfony\\Framework\\ClassCollectionLoader', - 'Symfony\\Framework\\EventDispatcher', + 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', + 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface', + 'Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler', + 'Symfony\\Component\\HttpKernel\\ClassCollectionLoader', ), __DIR__.'/../..', 'bootstrap', false); diff --git a/src/Symfony/Framework/bootstrap.php b/src/Symfony/Component/HttpKernel/bootstrap.php similarity index 60% rename from src/Symfony/Framework/bootstrap.php rename to src/Symfony/Component/HttpKernel/bootstrap.php index 3162b9406811..0bc194c40ef7 100644 --- a/src/Symfony/Framework/bootstrap.php +++ b/src/Symfony/Component/HttpKernel/bootstrap.php @@ -1,5 +1,5 @@ name = basename($tmp); $this->reflection = new \ReflectionObject($this); $this->path = dirname($this->reflection->getFilename()); } } -namespace Symfony\Framework\Bundle; +namespace Symfony\Component\HttpKernel\Bundle; interface BundleInterface { public function boot(); public function shutdown(); } -namespace Symfony\Framework; -use Symfony\Framework\Bundle\Bundle; -class KernelBundle extends Bundle { - public function boot() { - if ($this->container->has('error_handler')) { - $this->container['error_handler']; } } } -namespace Symfony\Framework\DependencyInjection; -use Symfony\Component\DependencyInjection\Extension\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\ContainerBuilder; -class KernelExtension extends Extension { - public function testLoad($config, ContainerBuilder $container) { - $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $loader->load('test.xml'); } - public function sessionLoad($config, ContainerBuilder $container) { - if (!$container->hasDefinition('session')) { - $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $loader->load('session.xml'); } - if (isset($config['default_locale'])) { - $container->setParameter('session.default_locale', $config['default_locale']); } - if (isset($config['class'])) { - $container->setParameter('session.class', $config['class']); } - foreach (array('name', 'lifetime', 'path', 'domain', 'secure', 'httponly', 'cache_limiter', 'pdo.db_table') as $name) { - if (isset($config['session'][$name])) { - $container->setParameter('session.options.'.$name, $config['session'][$name]); } } - if (isset($config['session']['class'])) { - $class = $config['session']['class']; - if (in_array($class, array('Native', 'Pdo'))) { - $class = 'Symfony\\Component\\HttpFoundation\\SessionStorage\\'.$class.'SessionStorage'; } - $container->setParameter('session.session', 'session.session.'.strtolower($class)); } } - public function configLoad($config, ContainerBuilder $container) { - if (!$container->hasDefinition('event_dispatcher')) { - $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $loader->load('services.xml'); - if ($container->getParameter('kernel.debug')) { - $loader->load('debug.xml'); - $container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher')); - $container->setAlias('debug.event_dispatcher', 'event_dispatcher'); } } - if (isset($config['charset'])) { - $container->setParameter('kernel.charset', $config['charset']); } - if (array_key_exists('error_handler', $config)) { - if (false === $config['error_handler']) { - $container->getDefinition('error_handler')->setMethodCalls(array()); } else { - $container->getDefinition('error_handler')->addMethodCall('register', array()); - $container->setParameter('error_handler.level', $config['error_handler']); } } } - public function getXsdValidationBasePath() { - return false; } - public function getNamespace() { - return 'http://www.symfony-project.org/schema/dic/symfony/kernel'; } - public function getAlias() { - return 'kernel'; } } -namespace Symfony\Framework\Debug; +namespace Symfony\Component\HttpKernel\Debug; class ErrorHandler { protected $levels = array( E_WARNING => 'Warning', @@ -131,7 +80,7 @@ public function handle($level, $message, $file, $line, $context) { if (error_reporting() & $level && $this->level & $level) { throw new \ErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line)); } return false; } } -namespace Symfony\Framework; +namespace Symfony\Component\HttpKernel; class ClassCollectionLoader { static protected $loaded; static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false) { @@ -178,12 +127,3 @@ static protected function writeCacheFile($file, $content) { chmod($file, 0644); return; } throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file)); } } -namespace Symfony\Framework; -use Symfony\Component\EventDispatcher\EventDispatcher as BaseEventDispatcher; -use Symfony\Component\EventDispatcher\Event; -use Symfony\Component\DependencyInjection\ContainerInterface; -class EventDispatcher extends BaseEventDispatcher { - public function setContainer(ContainerInterface $container) { - foreach ($container->findTaggedServiceIds('kernel.listener') as $id => $attributes) { - $priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0; - $container->get($id)->register($this, $priority); } } } diff --git a/src/Symfony/Framework/DependencyInjection/KernelExtension.php b/src/Symfony/Framework/DependencyInjection/KernelExtension.php deleted file mode 100644 index a1c794da46f6..000000000000 --- a/src/Symfony/Framework/DependencyInjection/KernelExtension.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * KernelExtension. - * - * @author Fabien Potencier - */ -class KernelExtension extends Extension -{ - /** - * Loads the test configuration. - * - * @param array $config A configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function testLoad($config, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $loader->load('test.xml'); - } - - /** - * Loads the session configuration. - * - * @param array $config A configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function sessionLoad($config, ContainerBuilder $container) - { - if (!$container->hasDefinition('session')) { - $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $loader->load('session.xml'); - } - - if (isset($config['default_locale'])) { - $container->setParameter('session.default_locale', $config['default_locale']); - } - - if (isset($config['class'])) { - $container->setParameter('session.class', $config['class']); - } - - foreach (array('name', 'lifetime', 'path', 'domain', 'secure', 'httponly', 'cache_limiter', 'pdo.db_table') as $name) { - if (isset($config['session'][$name])) { - $container->setParameter('session.options.'.$name, $config['session'][$name]); - } - } - - if (isset($config['session']['class'])) { - $class = $config['session']['class']; - if (in_array($class, array('Native', 'Pdo'))) { - $class = 'Symfony\\Component\\HttpFoundation\\SessionStorage\\'.$class.'SessionStorage'; - } - - $container->setParameter('session.session', 'session.session.'.strtolower($class)); - } - } - - /** - * Loads the config configuration. - * - * @param array $config A configuration array - * @param ContainerBuilder $container A ContainerBuilder instance - */ - public function configLoad($config, ContainerBuilder $container) - { - if (!$container->hasDefinition('event_dispatcher')) { - $loader = new XmlFileLoader($container, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config')); - $loader->load('services.xml'); - - if ($container->getParameter('kernel.debug')) { - $loader->load('debug.xml'); - $container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher')); - $container->setAlias('debug.event_dispatcher', 'event_dispatcher'); - } - } - - if (isset($config['charset'])) { - $container->setParameter('kernel.charset', $config['charset']); - } - - if (array_key_exists('error_handler', $config)) { - if (false === $config['error_handler']) { - $container->getDefinition('error_handler')->setMethodCalls(array()); - } else { - $container->getDefinition('error_handler')->addMethodCall('register', array()); - $container->setParameter('error_handler.level', $config['error_handler']); - } - } - } - - /** - * Returns the base path for the XSD files. - * - * @return string The XSD base path - */ - public function getXsdValidationBasePath() - { - return false; - } - - public function getNamespace() - { - return 'http://www.symfony-project.org/schema/dic/symfony/kernel'; - } - - public function getAlias() - { - return 'kernel'; - } -} diff --git a/src/Symfony/Framework/KernelBundle.php b/src/Symfony/Framework/KernelBundle.php deleted file mode 100644 index d65124cf3595..000000000000 --- a/src/Symfony/Framework/KernelBundle.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -/** - * KernelBundle. - * - * @author Fabien Potencier - */ -class KernelBundle extends Bundle -{ - /** - * Boots the Bundle. - */ - public function boot() - { - if ($this->container->has('error_handler')) { - $this->container['error_handler']; - } - } -} diff --git a/src/Symfony/Framework/Test/WebTestCase.php b/src/Symfony/Framework/Test/WebTestCase.php deleted file mode 100644 index 9e39852aafce..000000000000 --- a/src/Symfony/Framework/Test/WebTestCase.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * WebTestCase is the base class for functional tests. - * - * @author Fabien Potencier - */ -abstract class WebTestCase extends BaseWebTestCase -{ - protected $kernel; - - /** - * Creates a Client. - * - * @param array $options An array of options to pass to the createKernel class - * @param array $server An array of server parameters - * - * @return Client A Client instance - */ - public function createClient(array $options = array(), array $server = array()) - { - $this->kernel = $this->createKernel($options); - $this->kernel->boot(); - - $client = $this->kernel->getContainer()->getTest_ClientService(); - $client->setServerParameters($server); - - return $client; - } - - /** - * Creates a Kernel. - * - * @param array $options An array of options - * - * @return HttpKernelInterface A HttpKernelInterface instance - */ - abstract protected function createKernel(array $options = array()); -} diff --git a/tests/Symfony/Tests/Framework/KernelTest.php b/tests/Symfony/Tests/Component/HttpKernel/KernelTest.php similarity index 91% rename from tests/Symfony/Tests/Framework/KernelTest.php rename to tests/Symfony/Tests/Component/HttpKernel/KernelTest.php index d83e542c2e51..b2385a09106f 100644 --- a/tests/Symfony/Tests/Framework/KernelTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/KernelTest.php @@ -9,9 +9,9 @@ * file that was distributed with this source code. */ -namespace Symfony\Tests\Framework; +namespace Symfony\Tests\Component\HttpKernel; -use Symfony\Framework\Kernel; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\DependencyInjection\Loader\LoaderInterface; class KernelTest extends \PHPUnit_Framework_TestCase