Development

Changeset 32440

You must first sign up to be able to contribute.

Changeset 32440

Show
Ignore:
Timestamp:
04/04/11 12:00:09 (3 years ago)
Author:
fabien
Message:

Merge branch 'master' of git://github.com/symfony/symfony

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.0/UPDATE.md

    r32439 r32440  
    77timeline closely anyway. 
    88 
    9 PR8 to PR10 
     9PR9 to PR10 
    1010----------- 
     11 
     12* Bundle logical names earned back their `Bundle` suffix: 
     13 
     14    *Controllers*: `Blog:Post:show` -> `BlogBundle:Post:show` 
     15 
     16    *Templates*:   `Blog:Post:show.html.twig` -> `BlogBundle:Post:show.html.twig` 
     17 
     18    *Resources*:   `@Blog/Resources/config/blog.xml` -> `@BlogBundle/Resources/config/blog.xml` 
     19 
     20    *Doctrine*:    `$em->find('Blog:Post', $id)` -> `$em->find('BlogBundle:Post', $id)` 
     21 
     22* Almost all core bundles parameters have been removed. You should use the 
     23  settings exposed by the bundle extension configuration instead. 
     24 
     25* Some core bundles service names changed for better consistency. 
    1126 
    1227* Namespace for validators has changed from `validation` to `assert` (it was 
     
    2338    Moreover, the `Assert` prefix used for some constraints has been removed 
    2439    (`AssertTrue` to `True`). 
     40 
     41* `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` method 
     42  now return the command exit code 
    2543 
    2644PR8 to PR9 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

    r32408 r32440  
    108108 
    109109        Mustache::renderDir($targetDir, array( 
    110             'namespace'   => $namespace, 
    111             'bundle'      => $bundle, 
    112             'bundleShort' => preg_replace('/Bundle$/', '', $bundle), 
     110            'namespace' => $namespace, 
     111            'bundle'    => $bundle, 
    113112        )); 
    114113 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

    r32431 r32440  
    358358            // Wrap the existing loader with cache (must happen after loaders are registered) 
    359359            $container->setDefinition('templating.loader.wrapped', $container->findDefinition('templating.loader')); 
    360             $container->setDefinition('templating.loader', $container->getDefinition('templating.loader.cache')); 
    361             $container->setParameter('templating.loader.cache.path', $config['cache']); 
    362         } else { 
    363             $container->setParameter('templating.loader.cache.path', null); 
     360            $loaderCache = $container->getDefinition('templating.loader.cache'); 
     361            $loaderCache->setArgument(1, $config['cache']); 
     362 
     363            $container->setDefinition('templating.loader', $loaderCache); 
    364364        } 
    365365 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating.xml

    r32416 r32440  
    4949        <service id="templating.loader.cache" class="%templating.loader.cache.class%" public="false"> 
    5050            <argument type="service" id="templating.loader.wrapped" /> 
    51             <argument>%templating.loader.cache.path%</argument
     51            <argument /> <!-- cache path --
    5252            <call method="setDebugger"><argument type="service" id="templating.debugger" on-invalid="ignore" /></call> 
    5353        </service> 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/generic/Controller/DefaultController.php

    r32408 r32440  
    99    public function indexAction() 
    1010    { 
    11         return $this->render('{{ bundleShort }}:Default:index.html.twig'); 
     11        return $this->render('{{ bundle }}:Default:index.html.twig'); 
    1212    } 
    1313} 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/php/Resources/config/routing.php

    r32408 r32440  
    77/* 
    88$collection->add('homepage', new Route('/', array( 
    9     '_controller' => '{{ bundleShort }}:Default:index', 
     9    '_controller' => '{{ bundle }}:Default:index', 
    1010))); 
    1111*/ 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/xml/Resources/config/routing.xml

    r32408 r32440  
    77    <!-- 
    88    <route id="homepage" pattern="/"> 
    9         <default key="_controller">{{ bundleShort }}:Default:index</default> 
     9        <default key="_controller">{{ bundle }}:Default:denied</default> 
    1010    </route> 
    1111    //--> 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Resources/skeleton/bundle/yml/Resources/config/routing.yml

    r32408 r32440  
    11#homepage: 
    22#    pattern:  / 
    3 #    defaults: { _controller: {{ bundleShort }}:Default:index } 
     3#    defaults: { _controller: {{ bundle }}:Default:index } 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php

    r32287 r32440  
    3333        'assets_version'   => 'SomeVersionScheme', 
    3434        'assets_base_urls' => 'http://cdn.example.com', 
     35        'cache'            => '/path/to/cache', 
    3536        'cache_warmer'     => true, 
    3637        'engines'          => array('php', 'twig'), 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml

    r32287 r32440  
    1313        <app:router cache-warmer="true" resource="%kernel.root_dir%/config/routing.xml" type="xml" /> 
    1414        <app:session auto-start="true" class="Session" default-locale="fr" storage-id="native" name="_SYMFONY" lifetime="86400" path="/" domain="example.com" secure="true" httponly="true" /> 
    15         <app:templating assets-version="SomeVersionScheme" cache-warmer="true"
     15        <app:templating assets-version="SomeVersionScheme" cache-warmer="true" cache="/path/to/cache"
    1616            <app:loader>loader.foo</app:loader> 
    1717            <app:loader>loader.bar</app:loader> 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml

    r32287 r32440  
    2929        engines:          [php, twig] 
    3030        loader:           [loader.foo, loader.bar] 
     31        cache:            /path/to/cache 
    3132        packages: 
    3233            images: 
  • branches/2.0/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

    r32439 r32440  
    114114        $this->assertEquals('templating.engine.delegating', (string) $container->getAlias('templating'), '->registerTemplatingConfiguration() configures delegating loader if multiple engines are provided'); 
    115115 
    116         $this->assertEquals('templating.loader.chain', (string) $container->getAlias('templating.loader'), '->registerTemplatingConfiguration() configures loader chain if multiple loaders are provided'); 
     116        $this->assertEquals($container->getDefinition('templating.loader.chain'), $container->getDefinition('templating.loader.wrapped'), '->registerTemplatingConfiguration() configures loader chain if multiple loaders are provided'); 
     117 
     118        $this->assertEquals($container->getDefinition('templating.loader'), $container->getDefinition('templating.loader.cache'), '->registerTemplatingConfiguration() configures the loader to use cache'); 
     119 
     120        $arguments = $container->getDefinition('templating.loader.cache')->getArguments(); 
     121        $this->assertEquals('/path/to/cache', $arguments[1]); 
    117122 
    118123        $this->assertEquals(array('php', 'twig'), $container->getParameter('templating.engines'), '->registerTemplatingConfiguration() sets a templating.engines parameter'); 
  • branches/2.0/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Configuration.php

    r32316 r32440  
    5050                ->scalarNode('access_denied_url')->defaultNull()->end() 
    5151                ->scalarNode('session_fixation_strategy')->cannotBeEmpty()->defaultValue('migrate')->end() 
     52                ->booleanNode('always_authenticate_before_granting')->defaultFalse()->end() 
     53                ->arrayNode('access_decision_manager') 
     54                    ->addDefaultsIfNotSet() 
     55                    ->children() 
     56                        ->scalarNode('strategy')->defaultValue('affirmative')->end() 
     57                        ->booleanNode('allow_if_all_abstain')->defaultFalse()->end() 
     58                        ->booleanNode('allow_if_equal_granted_denied')->defaultTrue()->end() 
     59                    ->end() 
     60                ->end() 
    5261            ->end() 
    5362            // add a faux-entry for factories, so that no validation error is thrown 
     
    7584                    ->children() 
    7685                        ->scalarNode('connection')->end() 
    77                         ->scalarNode('cache')->end() 
     86                        ->arrayNode('cache') 
     87                            ->addDefaultsIfNotSet() 
     88                            ->children() 
     89                                ->scalarNode('id')->end() 
     90                                ->scalarNode('prefix')->defaultValue('sf2_acl_')->end() 
     91                            ->end() 
     92                        ->end() 
     93                        ->arrayNode('tables') 
     94                            ->addDefaultsIfNotSet() 
     95                            ->children() 
     96                                ->scalarNode('class')->defaultValue('acl_classes')->end() 
     97                                ->scalarNode('entry')->defaultValue('acl_entries')->end() 
     98                                ->scalarNode('object_identity')->defaultValue('acl_object_identities')->end() 
     99                                ->scalarNode('object_identity_ancestors')->defaultValue('acl_object_identity_ancestors')->end() 
     100                                ->scalarNode('security_identity')->defaultValue('acl_security_identities')->end() 
     101                            ->end() 
     102                        ->end() 
     103                        ->arrayNode('voter') 
     104                            ->addDefaultsIfNotSet() 
     105                            ->children() 
     106                                ->booleanNode('allow_if_object_identity_unavailable')->defaultTrue()->end() 
     107                            ->end() 
     108                        ->end() 
    78109                    ->end() 
    79110                ->end() 
  • branches/2.0/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

    r32283 r32440  
    6767        // set some global scalars 
    6868        $container->setParameter('security.access.denied_url', $config['access_denied_url']); 
    69         $container->setParameter('security.authentication.session_strategy.strategy', $config['session_fixation_strategy']); 
     69        $container->getDefinition('security.authentication.session_strategy')->setArgument(0, $config['session_fixation_strategy']); 
     70        $container 
     71            ->getDefinition('security.access.decision_manager') 
     72            ->addArgument($config['access_decision_manager']['strategy']) 
     73            ->addArgument($config['access_decision_manager']['allow_if_all_abstain']) 
     74            ->addArgument($config['access_decision_manager']['allow_if_equal_granted_denied']) 
     75        ; 
     76        $container->setParameter('security.access.always_authenticate_before_granting', $config['always_authenticate_before_granting']); 
    7077 
    7178        $this->createFirewalls($config, $container); 
     
    112119        } 
    113120 
    114         if (isset($config['cache'])) { 
    115             $container->setAlias('security.acl.cache', sprintf('security.acl.cache.%s', $config['cache'])); 
    116         } 
     121        if (isset($config['cache']['id'])) { 
     122            $container->setAlias('security.acl.cache', $config['cache']['id']); 
     123        } 
     124        $container->getDefinition('security.acl.cache.doctrine')->addArgument($config['cache']['prefix']); 
     125 
     126        $container 
     127            ->getDefinition('security.acl.dbal.provider') 
     128            ->setArgument(2, array( 
     129                'class_table_name' => $config['tables']['class'], 
     130                'entry_table_name' => $config['tables']['entry'], 
     131                'oid_table_name'   => $config['tables']['object_identity'], 
     132                'oid_ancestors_table_name' => $config['tables']['object_identity_ancestors'], 
     133                'sid_table_name' => $config['tables']['security_identity'], 
     134            )) 
     135        ; 
     136 
     137        $container->getDefinition('security.acl.voter.basic_permissions')->addArgument($config['voter']['allow_if_object_identity_unavailable']); 
    117138    } 
    118139 
  • branches/2.0/src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

    r32299 r32440  
    77    <parameters> 
    88        <parameter key="security.context.class">Symfony\Component\Security\Core\SecurityContext</parameter> 
    9         <parameter key="security.context.always_authenticate">false</parameter> 
    109 
    1110        <parameter key="security.user_checker.class">Symfony\Component\Security\Core\User\UserChecker</parameter> 
     
    2726 
    2827        <parameter key="security.authentication.session_strategy.class">Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy</parameter> 
    29         <parameter key="security.authentication.session_strategy.strategy">migrate</parameter> 
    3028 
    3129        <parameter key="security.access.decision_manager.class">Symfony\Component\Security\Core\Authorization\AccessDecisionManager</parameter> 
    32         <parameter key="security.access.decision_manager.strategy">affirmative</parameter> 
    33         <parameter key="security.access.decision_manager.allow_if_all_abstain">false</parameter> 
    34         <parameter key="security.access.decision_manager.allow_if_equal_granted_denied">true</parameter> 
    3530 
    3631        <parameter key="security.access.simple_role_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleVoter</parameter> 
     
    5045            <argument type="service" id="security.authentication.manager" /> 
    5146            <argument type="service" id="security.access.decision_manager" /> 
    52             <argument>%security.context.always_authenticate%</argument> 
     47            <argument>%security.access.always_authenticate_before_granting%</argument> 
    5348        </service> 
    5449 
     
    6459 
    6560        <service id="security.authentication.session_strategy" class="%security.authentication.session_strategy.class%" public="false"> 
    66             <argument>%security.authentication.session_strategy.strategy%</argument
     61            <argument /> <!-- Strategy --
    6762        </service> 
    6863 
     
    7974        <service id="security.access.decision_manager" class="%security.access.decision_manager.class%" public="false"> 
    8075            <argument type="collection"></argument> 
    81             <argument>%security.access.decision_manager.strategy%</argument> 
    82             <argument>%security.access.decision_manager.allow_if_all_abstain%</argument> 
    83             <argument>%security.access.decision_manager.allow_if_equal_granted_denied%</argument> 
    8476        </service> 
    8577 
  • branches/2.0/src/Symfony/Bundle/SecurityBundle/Resources/config/security_acl.xml

    r32184 r32440  
    66 
    77    <parameters> 
    8         <parameter key="security.acl.dbal.class_table_name">acl_classes</parameter> 
    9         <parameter key="security.acl.dbal.entry_table_name">acl_entries</parameter> 
    10         <parameter key="security.acl.dbal.oid_table_name">acl_object_identities</parameter> 
    11         <parameter key="security.acl.dbal.oid_ancestors_table_name">acl_object_identity_ancestors</parameter> 
    12         <parameter key="security.acl.dbal.sid_table_name">acl_security_identities</parameter> 
    138        <parameter key="security.acl.dbal.provider.class">Symfony\Component\Security\Acl\Dbal\MutableAclProvider</parameter> 
    149 
     
    1611 
    1712        <parameter key="security.acl.voter.class">Symfony\Component\Security\Acl\Voter\AclVoter</parameter> 
    18         <parameter key="security.acl.voter.allow_if_object_identity_unavailable">true</parameter> 
    1913        <parameter key="security.acl.permission.map.class">Symfony\Component\Security\Acl\Permission\BasicPermissionMap</parameter> 
    2014 
     
    2317 
    2418        <parameter key="security.acl.cache.doctrine.class">Symfony\Component\Security\Acl\Domain\DoctrineAclCache</parameter> 
    25         <parameter key="security.acl.cache.doctrine.prefix">sf2_acl_</parameter> 
    2619 
    2720        <parameter key="security.acl.collection_cache.class">Symfony\Component\Security\Acl\Domain\AclCollectionCache</parameter> 
     
    4134            <argument type="service" id="security.acl.dbal.connection" /> 
    4235            <argument type="service" id="security.acl.permission_granting_strategy" /> 
    43             <argument type="collection"> 
    44                 <argument key="class_table_name">%security.acl.dbal.class_table_name%</argument> 
    45                 <argument key="entry_table_name">%security.acl.dbal.entry_table_name%</argument> 
    46                 <argument key="oid_table_name">%security.acl.dbal.oid_table_name%</argument> 
    47                 <argument key="oid_ancestors_table_name">%security.acl.dbal.oid_ancestors_table_name%</argument> 
    48                 <argument key="sid_table_name">%security.acl.dbal.sid_table_name%</argument> 
    49             </argument> 
     36            <argument /> <!-- Table collection --> 
    5037            <argument type="service" id="security.acl.cache" on-invalid="null" /> 
    5138        </service> 
     
    6249            <argument type="service" id="security.acl.cache.doctrine_cache_impl" /> 
    6350            <argument type="service" id="security.acl.permission_granting_strategy" />         
    64             <argument>%security.acl.cache.doctrine.prefix%</argument> 
    6551        </service> 
    6652 
     
    7561            <argument type="service" id="security.acl.permission.map" /> 
    7662            <argument type="service" id="logger" on-invalid="null" /> 
    77             <argument>%security.acl.voter.allow_if_object_identity_unavailable%</argument> 
    7863            <tag name="security.voter" priority="255" /> 
    7964        </service> 
  • branches/2.0/src/Symfony/Component/Templating/Loader/CacheLoader.php

    r32184 r32440  
    3333     * Constructor. 
    3434     * 
    35      * @param Loader $loader A Loader instance 
    36      * @param string $dir    The directory where to store the cache files 
     35     * @param LoaderInterface $loader A Loader instance 
     36     * @param string          $dir    The directory where to store the cache files 
    3737     */ 
    38     public function __construct(Loader $loader, $dir) 
     38    public function __construct(LoaderInterface $loader, $dir) 
    3939    { 
    4040        $this->loader = $loader;