Skip to content

Commit

Permalink
removed Symfony\Framework
Browse files Browse the repository at this point in the history
Things have been moved to Symfony\Component\HttpKernel
and Symfony\Bundle\FrameworkBundle

The kernel configuration namespace was removed and merged
with the main web configuration namespace (kernel:config => web:config,
kernel:test => web:test, and kernel:session => web:session):

Before:
<kernel:config charset="UTF-8" error_handler="null" />

<web:config csrf-secret="xxxxxxxxxx">
    <web:router resource="%kernel.root_dir%/config/routing.xml" />
    <web:validation enabled="true" annotations="true" />
</web:config>

After:
<web:config csrf-secret="xxxxxxxxxx" charset="UTF-8" error-handler="null">
    <web:router resource="%kernel.root_dir%/config/routing.xml" />
    <web:validation enabled="true" annotations="true" />
</web:config>

Renamed classes:

Symfony\{Framework => Bundle\FrameworkBundle}\Cache\Cache
Symfony\{Framework => Bundle\FrameworkBundle}\Client
Symfony\{Framework => Bundle\FrameworkBundle}\Debug\EventDispatcher
Symfony\{Framework => Bundle\FrameworkBundle}\Debug\EventDispatcherTraceableInterface
Symfony\{Framework => Bundle\FrameworkBundle}\EventDispatcher
Symfony\{Framework => Component\HttpFoundation}\UniversalClassLoader
Symfony\{Framework => Component\HttpKernel}\Bundle\Bundle
Symfony\{Framework => Component\HttpKernel}\Bundle\BundleInterface
Symfony\{Framework => Component\HttpKernel}\ClassCollectionLoader
Symfony\{Framework => Component\HttpKernel}\Debug\ErrorException
Symfony\{Framework => Component\HttpKernel}\Debug\ErrorHandler
Symfony\{Bundle\FrameworkBundle => Component\HttpKernel}\Debug\ExceptionListener
Symfony\{Framework => Component\HttpKernel}\Kernel
  • Loading branch information
fabpot committed Sep 17, 2010
1 parent 1990fc5 commit d657adb
Show file tree
Hide file tree
Showing 64 changed files with 186 additions and 374 deletions.
4 changes: 2 additions & 2 deletions autoload.php.dist
@@ -1,8 +1,8 @@
<?php

require_once __DIR__.'/src/Symfony/Framework/UniversalClassLoader.php';
require_once __DIR__.'/src/Symfony/Component/HttpFoundation/UniversalClassLoader.php';

use Symfony\Framework\UniversalClassLoader;
use Symfony\Component\HttpFoundation\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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;

/*
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
Expand Up @@ -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.
Expand Down
Expand Up @@ -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
{
Expand Down
Expand Up @@ -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
{
Expand Down
Expand Up @@ -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
{
Expand Down
Expand Up @@ -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.
Expand Down
Expand Up @@ -2,7 +2,7 @@

namespace Symfony\Bundle\DoctrineMongoDBBundle;

use Symfony\Framework\Bundle\Bundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* Doctrine MongoDB ODM bundle.
Expand Down
Expand Up @@ -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
{

}
}
Expand Up @@ -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
{
Expand Down
Expand Up @@ -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
{
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace Symfony\Framework\Cache;
namespace Symfony\Bundle\FrameworkBundle\Cache;

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Cache\Cache as BaseCache;
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace Symfony\Framework;
namespace Symfony\Bundle\FrameworkBundle;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Expand Up @@ -6,7 +6,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Framework\Kernel;
use Symfony\Component\HttpKernel\Kernel;

/*
* This file is part of the Symfony framework.
Expand Down
Expand Up @@ -6,7 +6,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Framework\Kernel;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Bundle\FrameworkBundle\Command\InitApplicationCommand;

/*
Expand Down
Expand Up @@ -2,7 +2,7 @@

namespace Symfony\Bundle\FrameworkBundle\Controller;

use Symfony\Framework\Kernel;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\Log\LoggerInterface;

/*
Expand Down
Expand Up @@ -2,7 +2,7 @@

namespace Symfony\Bundle\FrameworkBundle\DataCollector;

use Symfony\Framework\Kernel;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
Expand Up @@ -3,7 +3,7 @@
namespace Symfony\Bundle\FrameworkBundle\DataCollector;

use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Framework\Kernel;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

Expand Down
@@ -1,8 +1,8 @@
<?php

namespace Symfony\Framework\Debug;
namespace Symfony\Bundle\FrameworkBundle\Debug;

use Symfony\Framework\EventDispatcher as BaseEventDispatcher;
use Symfony\Bundle\FrameworkBundle\EventDispatcher as BaseEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace Symfony\Framework\Debug;
namespace Symfony\Bundle\FrameworkBundle\Debug;

/*
* This file is part of the Symfony package.
Expand Down
Expand Up @@ -88,6 +88,32 @@ public function configLoad($config, ContainerBuilder $container)
$this->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',
Expand Down Expand Up @@ -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));
}
}

/*
<profiler only-exceptions="false">
<matcher ip="192.168.0.0/24" path="#/admin/#i" />
Expand Down
@@ -1,6 +1,6 @@
<?php

namespace Symfony\Framework;
namespace Symfony\Bundle\FrameworkBundle;

use Symfony\Component\EventDispatcher\EventDispatcher as BaseEventDispatcher;
use Symfony\Component\EventDispatcher\Event;
Expand Down
6 changes: 5 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
Expand Up @@ -2,7 +2,7 @@

namespace Symfony\Bundle\FrameworkBundle;

use Symfony\Framework\Bundle\Bundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\Form\Form;

/*
Expand All @@ -26,6 +26,10 @@ class FrameworkBundle extends Bundle
*/
public function boot()
{
if ($this->container->has('error_handler')) {
$this->container['error_handler'];
}

if ($this->container->hasParameter('csrf_secret')) {
Form::setDefaultCsrfSecret($this->container->getParameter('csrf_secret'));
Form::enableDefaultCsrfProtection();
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/RequestListener.php
Expand Up @@ -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;
Expand Down
Expand Up @@ -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">

<parameters>
<parameter key="debug.event_dispatcher.class">Symfony\Framework\Debug\EventDispatcher</parameter>
<parameter key="debug.event_dispatcher.class">Symfony\Bundle\FrameworkBundle\Debug\EventDispatcher</parameter>
</parameters>

<services>
Expand Down
Expand Up @@ -18,6 +18,8 @@

<xsd:attribute name="ide" type="xsd:string" />
<xsd:attribute name="csrf-secret" type="xsd:string" />
<xsd:attribute name="charset" type="xsd:string" />
<xsd:attribute name="error-handler" type="xsd:string" />
</xsd:complexType>

<xsd:complexType name="profiler">
Expand Down
Expand Up @@ -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">

<parameters>
<parameter key="event_dispatcher.class">Symfony\Framework\EventDispatcher</parameter>
<parameter key="event_dispatcher.class">Symfony\Bundle\FrameworkBundle\EventDispatcher</parameter>
<parameter key="http_kernel.class">Symfony\Component\HttpKernel\HttpKernel</parameter>
<parameter key="request.class">Symfony\Component\HttpFoundation\Request</parameter>
<parameter key="response.class">Symfony\Component\HttpFoundation\Response</parameter>
<parameter key="error_handler.class">Symfony\Framework\Debug\ErrorHandler</parameter>
<parameter key="error_handler.class">Symfony\Component\HttpKernel\Debug\ErrorHandler</parameter>
<parameter key="error_handler.level">null</parameter>
</parameters>

Expand Down
Expand Up @@ -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">

<parameters>
<parameter key="test.client.class">Symfony\Framework\Client</parameter>
<parameter key="test.client.class">Symfony\Bundle\FrameworkBundle\Client</parameter>
<parameter key="test.client.parameters" type="collection"></parameter>
<parameter key="test.client.history.class">Symfony\Component\BrowserKit\History</parameter>
<parameter key="test.client.cookiejar.class">Symfony\Component\BrowserKit\CookieJar</parameter>
Expand Down
Expand Up @@ -9,7 +9,7 @@
<parameter key="controller_resolver.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver</parameter>
<parameter key="controller_name_converter.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerNameConverter</parameter>
<parameter key="response_listener.class">Symfony\Component\HttpKernel\ResponseListener</parameter>
<parameter key="exception_listener.class">Symfony\Bundle\FrameworkBundle\Debug\ExceptionListener</parameter>
<parameter key="exception_listener.class">Symfony\Component\HttpKernel\Debug\ExceptionListener</parameter>
<parameter key="exception_listener.controller">Symfony\Bundle\FrameworkBundle\Controller\ExceptionController::exceptionAction</parameter>
<parameter key="esi.class">Symfony\Component\HttpKernel\Cache\Esi</parameter>
<parameter key="esi_listener.class">Symfony\Component\HttpKernel\Cache\EsiListener</parameter>
Expand Down
Expand Up @@ -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
{
Expand Down
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d657adb

Please sign in to comment.