Commit Graph

12198 Commits

Author SHA1 Message Date
Victor Berchet
cc0be8edf2 [Finder] fluid, calling in() not required after append() 2012-12-10 09:52:01 +01:00
Fran Moreno
a37e5e323b [Form] Fix const inside an anonymous function 2012-12-09 23:59:18 +01:00
Tobias Schultze
76e5bce801 no need to set the compiled route to null when cloning 2012-12-07 22:24:45 +01:00
dantleech
f48b22a44e Added configuration pass that adds Twig Loaders
- Added compiler class which picks up any services tagged "twig.loader"
- If there is one loader registered we set the alias to this loader
- If there is more than one we set the alias to a chain loader and all
  the loaders to it
- If there is no loaders we throw an Exception
2012-12-07 17:39:55 +01:00
Fabien Potencier
74c8b0150a merged branch bschussek/issue6141_2 (PR #6217)
This PR was merged into the 2.1 branch.

Commits
-------

6e7e08f [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text"

Discussion
----------

[Form] Fixed the "format" option in DateType

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6141
Todo: -
License of the code: MIT
Documentation PR: -

This PR fixes a regression introduced in #4839. To quote that PR:

> This PR changes DateType and DateTimeType to support HTML5 by default when setting the option "widget" to "single_text".

In reality, the "format" option now defaults to the HTML5 format always, not just when "widget" is "single_text". This is fixed here.

The second commit in this PR removes special characters between select/text fields. What, with German locale, was

```
<day input>.<month input>.<year input>
```

before is now

```
<day input><month input><year input>
```

This is the way date fields are represented on the majority of websites. If you *need* separators, you can have them by setting the "format" option to a custom value:

```php
$builder->add('myDate', 'date', array(
    'format' => 'dd.MM.yyyy',
));
```

---------------------------------------------------------------------------

by fabpot at 2012-12-07T08:52:21Z

The second commit should probably be done on master and it changes the behavior.

---------------------------------------------------------------------------

by bschussek at 2012-12-07T12:23:22Z

Ok, I removed the second commit now and removed the entries from the CHANGELOG.
2012-12-07 14:34:54 +01:00
Martin Hasoň
8bb3208ab8 [Config] Loader::import must return imported data 2012-12-07 14:24:02 +01:00
Fabien Potencier
992707ea6c merged branch bschussek/issue6190 (PR #6216)
This PR was merged into the 2.1 branch.

Commits
-------

ca5d9ac [DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed

Discussion
----------

[DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6190
Todo: -
License of the code: MIT
Documentation PR: n/a

---------------------------------------------------------------------------

by craue at 2012-12-06T18:31:43Z

👍

---------------------------------------------------------------------------

by lstrojny at 2012-12-06T18:35:04Z

What about a test?

---------------------------------------------------------------------------

by bschussek at 2012-12-07T12:39:51Z

Removed CHANGELOG entries and added tests.

---------------------------------------------------------------------------

by craue at 2012-12-07T13:14:02Z

I'm not sure if @fabpot is objected to the changelog entry entirely or just the version number. What is the segfault about for PHP 5.4 in Travis?
2012-12-07 14:19:21 +01:00
Bernhard Schussek
ca5d9acb19 [DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed 2012-12-07 13:39:00 +01:00
Bernhard Schussek
6e7e08f8c4 [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text" 2012-12-07 13:22:37 +01:00
Martin Hasoň
e4586007dc [DependencyInjection] Add deleted argument in Extension::processConfiguration 2012-12-07 11:34:49 +01:00
Fabien Potencier
79b4ca686e merged branch lsmith77/pre_process_app_config (PR #5566)
This PR was merged into the master branch.

Commits
-------

d7a1154 make it possible for bundles extensions to prepend settings into the application configuration of any Bundle

Discussion
----------

[2.2] add possibility for bundles extensions to prepend the app configs

Bug fix: #4652
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

As can be seen in the patch the extensions that should prepend the configuration are enabled automatically if they implement ``PrependExtensionInterface``.

Just as an example, here an extension, which checks if SonataAdminBundle is available and if not disables integration with it in several Bundles. It also sets some default settings for ``document_class`` and ``default_document_manager_name``:
```
diff --git a/DependencyInjection/SymfonyCmfCoreExtension.php b/DependencyInjection/SymfonyCmfCoreExtension.php
index 9f92410..c0a8dbb 100644
--- a/DependencyInjection/SymfonyCmfCoreExtension.php
+++ b/DependencyInjection/SymfonyCmfCoreExtension.php
@@ -3,11 +3,12 @@
 namespace Symfony\Cmf\Bundle\CoreBundle\DependencyInjection;

 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+use Symfony\Component\\DependencyInjection\PrependExtensionInterface;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Component\Config\FileLocator;

-class SymfonyCmfCoreExtension extends Extension
+class SymfonyCmfCoreExtension extends Extension implements PrependExtensionInterface
 {
     public function load(array $configs, ContainerBuilder $container)
     {
@@ -15,4 +16,45 @@ class SymfonyCmfCoreExtension extends Extension
         $loader->load('config.xml');
         $loader->load('services.xml');
     }
+
+    public function prepend(ContainerBuilder $container)
+    {
+        $bundles = $container->getParameter('kernel.bundles');
+        if (!isset($bundles['SonataDoctrinePHPCRAdminBundle'])) {
+            // disable SonataDoctrinePHPCRAdminBundle admin support in Bundles
+            $config = array('use_sonata_admin' => false);
+            foreach ($container->getExtensions() as $name => $extension) {
+                switch ($name) {
+                    case 'symfony_cmf_menu':
+                    case 'symfony_cmf_routing_extra':
+                    case 'symfony_cmf_simple_cms':
+                        $container->prependExtensionConfig($name, $config);
+                        break;
+                }
+            }
+        }
+
+        // process the configuration of SymfonyCmfCoreExtension
+        $configs = $container->getExtensionConfig($this->getAlias());
+        $config = $this->processConfiguration(new Configuration(), $configs);
+        // add the default configs to various Bundles
+        foreach ($container->getExtensions() as $name => $extension) {
+            switch ($name) {
+                case 'symfony_cmf_content':
+                case 'symfony_cmf_simple_cms':
+                    $container->prependExtensionConfig($name, $config);
+                    break;
+                }
+        }
+    }
 }
```

---------------------------------------------------------------------------

by stof at 2012-09-21T21:10:00Z

I think you are giving too much power to bundles here: a bundle becomes able to modify all the config defined explicitly by the user if it wants to do it.

I think it would be safer to give them the possibility to load an additional config file which would be prepended (so that user-defined config would still win). Giving the ability to load files means passing the loader used by the kernel, and it should then be called before calling the load method on the kernel itself (to respect the order of loaded files)

---------------------------------------------------------------------------

by lsmith77 at 2012-09-22T05:50:08Z

Not sure how a config file helps solve anything. I mean they can load as many config files as they want already. The key is being able to automatically apply configuration to multiple Bundles as well as enabling/disabling features based on if certain Bundles are registered.

BTW the end result in my examples is also prepended, so that user config wins. However yes this would be up to the person implementing the Bundle. We could however provide a dedicated method for prepending in addition to or instead of ``setExtensionConfig``.

---------------------------------------------------------------------------

by stof at 2012-09-22T11:40:29Z

@lsmith77 If you can load a file with the main loader, this file can provide some app-level configuration (be it for your own bundle or others).
And your code example is indeed prepending. But imagine what would occur when someone uses this feature without knowing well how the component works: he will likely call ``setExtensionConfig`` in a first implementation, thus dropping all userland config for the bundle. Your setup does not only allow to make a file win over the userland config but makes it even easier to remove the userland config.

---------------------------------------------------------------------------

by lsmith77 at 2012-09-22T18:11:29Z

but i dont get how that would help. the point is to be able for one bundle to configure other bundles before the load as this is obviously alot cleaner than trying to do the same via a compiler pass. so imho this is what is needed to encourage decoupled bundles. otherwise for example CMS or other reuseable and extensible apps will be forced to always put everything in one bundle.

---------------------------------------------------------------------------

by stof at 2012-09-22T19:23:45Z

@lsmith77 I agree about the feature, not about the way to implement it. If you allow bundles to load a file as it it were some app-level config, they would become able to provide some config for other bundles (and you could load several files depending of which bundles are enabled), but without allowing bundles to remove the userland config.

---------------------------------------------------------------------------

by lsmith77 at 2012-09-22T19:50:19Z

sorry but i dont understand what you suggest. more over i dont see the problem. its already possible to seriously break stuff with compiler passes which cannot be easily enabled/disabled. this is just convenience. if it doesnt work because of some obscure combo then simply dont use it for the app since it needs to be explicitly enabled in the kernel.

---------------------------------------------------------------------------

by lsmith77 at 2012-09-24T09:25:10Z

@stof thought about your comments, are you suggesting for a Bundle to be able to generate a config file that is prepended? in that case the current behavior would already be that if we change ``setExtensionConfig`` to just be a ``prependExtensionConfig`` .. however i am not sure if we really need this limitation since as i point out this would still by far be less dangerous than compiler passes and also i expect this to be used mainly by open source applications on top of Symfony2 rather than standard bundles.

---------------------------------------------------------------------------

by lsmith77 at 2012-10-13T13:28:29Z

@lolautruche i also think this is relevant for you guys. this way you could start preconfiguring 3rd party bundles as part of your main ezPublish bundle.

---------------------------------------------------------------------------

by lolautruche at 2012-10-13T13:57:09Z

While I suspect a nice feature, the implementation looks obscure to me...

---------------------------------------------------------------------------

by lsmith77 at 2012-10-13T17:43:02Z

The implementation of the example extension or the implementation of the actual changes proposed in this PR?

---------------------------------------------------------------------------

by lolautruche at 2012-10-13T17:46:57Z

The example, sorry 😃

---------------------------------------------------------------------------

by lsmith77 at 2012-10-13T17:50:38Z

The example was fairly quickly hacked together. The basic thing you need to do is fetch the config for the bundle you want to change, manipulate the config (usually by appending an array to the array of configs so that you dont affect explicit configuration) and then set it again.

As I explained to @stof it would alternative/additionally be possible to support a method that pushes a config array to the top of the array of config stack. Such a method might make the necessary code simpler.

---------------------------------------------------------------------------

by stof at 2012-10-13T21:39:07Z

@fabpot what do you think about it ?

---------------------------------------------------------------------------

by jrobeson at 2012-10-20T15:45:18Z

I've been porting much of an existing framework over to use more symfony components and bundles. I think that this might help some of the problems i've been having. I would really appreciate some better examples as how to one would use it  (same for the cmf router, but that's another story).

---------------------------------------------------------------------------

by lsmith77 at 2012-10-21T07:28:52Z

not really sure what other examples i could give. the process is quite simple:
1) determine what configuration options to add to other Bundles

for example with the following code I determine that SonataAdmin for PHPCR is not installed (which means i should disable using it in other Bundles):
```
$bundles = $container->getParameter('kernel.bundles');
if (!isset($bundles['SonataDoctrinePHPCRAdminBundle'])) {
```

alternatively I could simply already process the configuration and then pick all or some of these configuration options:
```
$configs = $container->getExtensionConfig($this->getAlias());
$config = $this->processConfiguration(new Configuration(), $configs);
```

2) then add these configuration to what other Bundles I feel should get these options

usually I will add these to the top of the config array stack. this means that if the user would manually set the same setting in most cases the user setting will override what the pre-processor set.
```
$container->unshiftExtensionConfig($name, array('use_sonata_admin' => false));
```

---------------------------------------------------------------------------

by lsmith77 at 2012-10-24T12:52:38Z

added ``ContainerBuilder::unshiftExtensionConfig`` since this is the usual use case. with this method added it could be discussed if ``ContainerBuilder::setExtensionConfig`` is still needed or not.

---------------------------------------------------------------------------

by lsmith77 at 2012-11-24T14:48:44Z

I spoke to @fabpot today and he said that since this patch just allows you to set defaults and not really "process" the actual configuration I shouldn't call it "preProcess" so I renamed it to "prepend".

Furthermore as its just prepending @fabpot said there isnt really a need to require manually enabling it, so here is a patch to auto-enable the prepending logic:
```
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index b890fbf..7374b87 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -701,8 +701,8 @@ abstract class Kernel implements KernelInterface, TerminableInterface
      */
     protected function prependExtensionConfigs(ContainerBuilder $container)
     {
-        foreach ($this->getPrependingExtensions() as $name) {
-            $extension = $container->getExtension($name);
+        foreach ($this->bundles as $bundle) {
+            $extension = $bundle->getContainerExtension();
             if ($extension instanceof PrependExtensionInterface) {
                 $extension->prepend($container);
             }
@@ -710,16 +710,6 @@ abstract class Kernel implements KernelInterface, TerminableInterface
     }

     /**
-     * Returns the ordered list of extensions that may prepend extension configurations.
-     *
-     * @return array
-     */
-    protected function getPrependingExtensions()
-    {
-        return array();
-    }
-
-    /**
      * Gets a new ContainerBuilder instance used to build the service container.
      *
      * @return ContainerBuilder
```

---------------------------------------------------------------------------

by lsmith77 at 2012-11-25T19:31:01Z

ok .. i pondered the code some more and now i have enabled registering of the prepending extensions by default, since its now quite easy to just override the ``prependExtensionConfigs()`` method since there is almost no logic in there anymore.

@fabpot i am not 100% sure with the naming yet ..

---------------------------------------------------------------------------

by lsmith77 at 2012-12-05T14:03:43Z

@fabpot if you are ok with the PR as it is now, i can do the rebase so you can merge this?

---------------------------------------------------------------------------

by lsmith77 at 2012-12-05T18:30:29Z

@fabpot all good now? then i will squash the commits ..

---------------------------------------------------------------------------

by lsmith77 at 2012-12-05T18:34:50Z

actually looking at the full change set again i am no longer sure if it makes sense to have ``PrependExtensionInterface`` in the DI rather than the HttpKernel.

---------------------------------------------------------------------------

by lsmith77 at 2012-12-07T09:21:14Z

@fabpot all good now?

---------------------------------------------------------------------------

by fabpot at 2012-12-07T09:37:52Z

The code looks good to me now. There are two remaining task before merging:

* Is it something we need to add somewhere in the documentation?
* Can you add a note in the DI component CHANGELOG?

Thanks.

---------------------------------------------------------------------------

by lsmith77 at 2012-12-07T09:49:17Z

i have added a changelog entry and squashed the commits.
i will also work on a documentation entry, i guess i will make it a cookbook entry. not sure if it should be included in http://symfony.com/doc/2.0/cookbook/bundles/extension.html .. but imho it would better be a separate entry.
2012-12-07 11:04:59 +01:00
Lukas Kahwe Smith
d7a1154154 make it possible for bundles extensions to prepend settings into the application configuration of any Bundle 2012-12-07 10:45:48 +01:00
Fabien Potencier
aad8136cd1 [HttpFoundation] fixed a small regression 2012-12-07 10:39:50 +01:00
Fabien Potencier
6e45f1cd78 Merge branch '2.1'
* 2.1:
  [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185)
  [HttpFoundation] added a check for the host header value
  [DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option
  [DoctrineBridge] Improved exception message
  [DoctrineBridge] Fixed: Exception is thrown if the entity class is not known to Doctrine
  Removed useless branch alias for dev-master in composer.json

Conflicts:
	composer.json
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bridge/Monolog/composer.json
	src/Symfony/Bridge/Propel1/composer.json
	src/Symfony/Bridge/Swiftmailer/composer.json
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Bundle/TwigBundle/composer.json
	src/Symfony/Bundle/WebProfilerBundle/composer.json
	src/Symfony/Component/BrowserKit/composer.json
	src/Symfony/Component/ClassLoader/composer.json
	src/Symfony/Component/Config/composer.json
	src/Symfony/Component/Console/composer.json
	src/Symfony/Component/CssSelector/composer.json
	src/Symfony/Component/DependencyInjection/composer.json
	src/Symfony/Component/DomCrawler/composer.json
	src/Symfony/Component/EventDispatcher/composer.json
	src/Symfony/Component/Filesystem/composer.json
	src/Symfony/Component/Finder/composer.json
	src/Symfony/Component/Form/composer.json
	src/Symfony/Component/HttpFoundation/composer.json
	src/Symfony/Component/HttpKernel/composer.json
	src/Symfony/Component/Locale/composer.json
	src/Symfony/Component/OptionsResolver/composer.json
	src/Symfony/Component/Process/composer.json
	src/Symfony/Component/Routing/composer.json
	src/Symfony/Component/Security/composer.json
	src/Symfony/Component/Serializer/composer.json
	src/Symfony/Component/Templating/composer.json
	src/Symfony/Component/Translation/composer.json
	src/Symfony/Component/Validator/composer.json
	src/Symfony/Component/Yaml/composer.json
2012-12-07 10:33:24 +01:00
Fabien Potencier
864cc8598f Merge branch '2.0' into 2.1
* 2.0:
  [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185)
  [HttpFoundation] added a check for the host header value

Conflicts:
	src/Symfony/Component/HttpFoundation/File/File.php
	src/Symfony/Component/HttpFoundation/Request.php
	src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
2012-12-07 10:29:55 +01:00
Fabien Potencier
a12c685e3c merged branch fabpot/move-uploaded-file-2_0 (PR #6221)
This PR was merged into the 2.0 branch.

Commits
-------

447ff91 [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185)

Discussion
----------

[HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185)

An alternative for #5878 and it fixes #6185.
2012-12-07 10:27:52 +01:00
Fabien Potencier
447ff915df [HttpFoundation] changed UploadedFile::move() to use move_uploaded_file() when possible (closes #5878, closes #6185) 2012-12-07 10:25:55 +01:00
Fabien Potencier
e277258e91 merged branch fabpot/host-check (PR #6209)
This PR was merged into the 2.0 branch.

Commits
-------

0489799 [HttpFoundation] added a check for the host header value

Discussion
----------

[HttpFoundation] added a check for the host header value

alternative for #3865
2012-12-07 10:18:13 +01:00
Fabien Potencier
048979993e [HttpFoundation] added a check for the host header value 2012-12-07 10:14:56 +01:00
Fabien Potencier
5581db35b2 merged branch vicb/debug/last (PR #6220)
This PR was merged into the master branch.

Commits
-------

459a09f [WebProfilerBundle] "View all" is "View last 10"

Discussion
----------

[WebProfilerBundle] "View all" is "View last 10"

Change a misleading link description
2012-12-07 10:12:12 +01:00
Victor Berchet
459a09fbdf [WebProfilerBundle] "View all" is "View last 10" 2012-12-07 10:03:28 +01:00
Fabien Potencier
0c6e145c0d merged branch vicb/httputils (PR #6005)
This PR was squashed before being merged into the master branch (closes #6005).

Commits
-------

577ee80 [HttpFoundation] Move IP check methods to a HttpUtils class for reuse

Discussion
----------

[HttpFoundation] Move IP check methods to a HttpUtils class for reuse

---------------------------------------------------------------------------

by vicb at 2012-11-13T18:05:18Z

Thanks @stof ! (didn't get my copy paste error as PHP allow calling non static method w/o a warning).

---------------------------------------------------------------------------

by GromNaN at 2012-11-17T23:19:29Z

Having an `Utils` class with mixed functions doesn't seem to be a good practice. I think the class should be called something like `Symfony\Component\HttpFoundation\IpAddress`.

---------------------------------------------------------------------------

by vicb at 2012-11-27T09:37:20Z

@fabpot could this be merged if `HttpUtils` is renamed to `IpUtils` ?

---------------------------------------------------------------------------

by fabpot at 2012-12-06T13:35:28Z

Renaming the class to `IpUtils` is indeed a good idea.

---------------------------------------------------------------------------

by vicb at 2012-12-06T14:07:59Z

ready !

---------------------------------------------------------------------------

by fabpot at 2012-12-06T14:39:19Z

Can you add an entry in the CHANGELOG?

---------------------------------------------------------------------------

by vicb at 2012-12-06T14:53:09Z

done, thanks for the reminder !
2012-12-06 16:23:16 +01:00
Victor Berchet
577ee80003 [HttpFoundation] Move IP check methods to a HttpUtils class for reuse 2012-12-06 16:23:16 +01:00
Fabien Potencier
6be1d29a3d merged branch bschussek/issue6141 (PR #6206)
This PR was merged into the 2.1 branch.

Commits
-------

b604eb7 [DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option
db2ee54 [DoctrineBridge] Improved exception message
99321cb [DoctrineBridge] Fixed: Exception is thrown if the entity class is not known to Doctrine

Discussion
----------

[DoctrineBridge] fixed caching when EntityType is used with the "query_builder" option

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
2012-12-06 15:43:13 +01:00
Fabien Potencier
9de5ffadf6 merged branch vicb/di/ext (PR #6207)
This PR was squashed before being merged into the master branch (closes #6207).

Commits
-------

57e9d28 [DI] Add a base class for extension

Discussion
----------

[DI] Add a base class for extension

depends on #6148

@fabpot should we change `addClassesToCompile` & the likes (thinking of traits).

---------------------------------------------------------------------------

by fabpot at 2012-12-06T13:05:05Z

Can you rebase?

---------------------------------------------------------------------------

by fabpot at 2012-12-06T13:06:43Z

hmmm, now that I see the result, I'm not sure it is worth it as the Extension class in the DI component depends on the Config one.

---------------------------------------------------------------------------

by vicb at 2012-12-06T13:23:29Z

No pb, I can remove it, should I remove the `ContainerBuilder` altogether ?

---------------------------------------------------------------------------

by fabpot at 2012-12-06T13:37:18Z

I would keep everything that is strictly in the DI namespace in the DI extension class and everything else in the HttpKernel class as it is now.

---------------------------------------------------------------------------

by vicb at 2012-12-06T13:38:59Z

But this change is **great** if you need the DI without the full stack.

What about my other comment ?

---------------------------------------------------------------------------

by fabpot at 2012-12-06T13:55:30Z

Which other comment? This one? "should I remove the ContainerBuilder altogether?" In which case, I don't understand what it means.

What about adding 2 classes in the DI component: the base one and another one with the dependency on the config component? Is it overkill?

---------------------------------------------------------------------------

by vicb at 2012-12-06T14:06:43Z

> "should I remove the ContainerBuilder altogether?"

I mean that the **widely used** (ie loaders) `ContainerBuilder` also depends on Config - that was kind of a joke !

I was refering to my first comment here

> should we change addClassesToCompile & the likes (thinking of traits).

Overkill I don't know but useless for sure: the `ExtensionInterface` depends on `ContainerBuilder` which depends on `Config`.
2012-12-06 15:41:33 +01:00
Victor Berchet
57e9d28795 [DI] Add a base class for extension 2012-12-06 15:41:32 +01:00
Fabien Potencier
ac714030c2 merged branch nomack84/fix_typo (PR #6210)
This PR was merged into the master branch.

Commits
-------

cf63069 Fixed copy/paste mistake

Discussion
----------

Fixed copy/paste mistake in #6205

@fabpot Sorry, I had a little copy/paste mistake here #6205
2012-12-06 14:38:14 +01:00
Mario A. Alvarez Garcia
cf630690be Fixed copy/paste mistake 2012-12-06 08:14:56 -05:00
Fabien Potencier
8968bd0e03 merged branch asm89/enhance-processbuilder (PR #5853)
This PR was squashed before being merged into the master branch (closes #5853).

Commits
-------

63b0059 [Process] Add ability to reset arguments on ProcessBuilder

Discussion
----------

[Process] Add ability to reset arguments on ProcessBuilder

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

This PR adds the ability to "reset" the arguments set on a `ProcessBuilder`. This allows the builder to be re-used without having to set things like custom environment variables, current working directory etc again.
2012-12-06 14:11:58 +01:00
Alexander
63b00598fe [Process] Add ability to reset arguments on ProcessBuilder 2012-12-06 14:11:57 +01:00
Fabien Potencier
9072951fce merged branch leevigraham/failure_path (PR #5860)
This PR was squashed before being merged into the master branch (closes #5860).

Commits
-------

d0057d0 Added failure_path_parameter to mirror target_path_parameter

Discussion
----------

Added failure_path_parameter to mirror target_path_parameter

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

Enable login failure redirect path can be assigned in a form field just like target path.

---------------------------------------------------------------------------

by stof at 2012-10-29T09:40:17Z

Please also open a PR to the doc repo to document this new feature

---------------------------------------------------------------------------

by leevigraham at 2012-10-29T09:56:29Z

@stof @fabpot Done.
2012-12-06 14:11:06 +01:00
Leevi Graham
d0057d0e64 Added failure_path_parameter to mirror target_path_parameter 2012-12-06 14:11:05 +01:00
Fabien Potencier
64b76ba1b4 merged branch vicb/sfcc (PR #6148)
This PR was merged into the master branch.

Commits
-------

7f16c1f [HttpKernel] Add DI extension configs as ressources when possible

Discussion
----------

[HttpKernel] Add DI extension configs as ressources when possible

/cc @rdohms @richardmiller

---------------------------------------------------------------------------

by vicb at 2012-11-30T11:57:48Z

btw @fabpot what about having a base class for `Extension` in the DI ? Would make it easier to re-use it when using standalone components, Di and (the suggested) Config as the greatest part of the class is not HttpKernel specific.

---------------------------------------------------------------------------

by fabpot at 2012-12-06T08:47:28Z

@vicb your suggestion makes sense.

Can you also explain the goal of this PR?

---------------------------------------------------------------------------

by vicb at 2012-12-06T09:01:58Z

The goal of this PR is to avoid having to sfcc when you modify a DI extension configuration. I think @rdohms got trapped.

---------------------------------------------------------------------------

by vicb at 2012-12-06T09:08:08Z

see https://twitter.com/rdohms/status/274059267428978688

---------------------------------------------------------------------------

by stof at 2012-12-06T09:20:54Z

I thought about it several times but never took time to implement it. It is annoying to have to clear the cache when you modify a default value in the Configuration class. So +1
2012-12-06 14:04:11 +01:00
Fabien Potencier
7fec2c9a3e merged branch nomack84/route_debug_cmd (PR #6205)
This PR was merged into the master branch.

Commits
-------

d902e9d [FrameworkBundle] Added hostnamePattern to the router:debug command

Discussion
----------

[FrameworkBundle] Added hostnamePattern to the router:debug command

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT

When you use the router:debug command with a specific route, the hostname is not show. I fix this with this PR.  Also I make a little improvement to the requirements section.
2012-12-06 13:46:50 +01:00
Bernhard Schussek
b604eb7b52 [DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option 2012-12-06 13:37:46 +01:00
Bernhard Schussek
db2ee54bda [DoctrineBridge] Improved exception message 2012-12-06 13:35:16 +01:00
Bernhard Schussek
99321cbe24 [DoctrineBridge] Fixed: Exception is thrown if the entity class is not known to Doctrine 2012-12-06 13:35:16 +01:00
Mario A. Alvarez Garcia
d902e9d839 [FrameworkBundle] Added hostnamePattern to the router:debug command 2012-12-06 06:57:32 -05:00
Fabien Potencier
101f0421ca merged branch hason/composer_2_1 (PR #6201)
This PR was merged into the 2.1 branch.

Commits
-------

10e5f3b Removed useless branch alias for dev-master in composer.json

Discussion
----------

[2.1] Fixed composer.json

---------------------------------------------------------------------------

by fabpot at 2012-12-06T08:23:35Z

Why is is useless?

---------------------------------------------------------------------------

by hason at 2012-12-06T08:30:58Z

Because the ``dev-master`` branch is alias for ``2.2-dev`` as mentioned @stof in https://github.com/symfony/symfony/pull/6196#discussion_r2320254.

---------------------------------------------------------------------------

by fabpot at 2012-12-06T08:33:42Z

got it now. Can you fix your PR as there are some unrelated commits? Thanks.

---------------------------------------------------------------------------

by hason at 2012-12-06T09:02:50Z

I backported some "unrelated" commits for better usage with composer. Should I remove these?

---------------------------------------------------------------------------

by fabpot at 2012-12-06T09:05:45Z

We do not backport things. So, please, remove them.

---------------------------------------------------------------------------

by hason at 2012-12-06T10:02:08Z

done
2012-12-06 11:19:11 +01:00
Martin Hasoň
10e5f3b3df Removed useless branch alias for dev-master in composer.json 2012-12-06 11:00:55 +01:00
Fabien Potencier
aee033699b fixed CS 2012-12-06 09:58:41 +01:00
Fabien Potencier
ee346bbc22 merged branch KingCrunch/feature/static-template-cache (PR #6083)
This PR was squashed before being merged into the master branch (closes #6083).

Commits
-------

6236c18 [FrameworkBundle] Added caching to TemplateController

Discussion
----------

[FrameworkBundle] Added caching to TemplateController

Because the main purpose for the `TemplateController` seems to be to render static pages like "disclaimer" and such, it seems useful to allow caching.

    imprint:
        pattern: /imprint
        defaults:
            _controller: SymfonyFrameworkBundle:Template:template
            template: "::pages/imprint.html.twig"
            maxAge: 86400

---------------------------------------------------------------------------

by pierredup at 2012-11-21T20:24:53Z

IMHO I think the caching should be allowed to be set optionally

---------------------------------------------------------------------------

by KingCrunch at 2012-11-21T20:38:54Z

I wrote it this way, because I assume, that it will cover more use-cases, than the other way round, but you are right, that this will change the current behaviour. Would like to hear other opinions, because I don't think one uses this action for anything else than fully-static content (means: The current behaviour doesn't feel very useful to me).

---------------------------------------------------------------------------

by pierredup at 2012-11-21T20:48:19Z

I totally agree, but I would then suggest keep the caching on by default, but have the option to turn it off if necessary

---------------------------------------------------------------------------

by pierredup at 2012-11-21T20:52:01Z

Actually I think to have caching permanently enabled for static content would probably be the best scenario, but I like to think in terms of flexibility and specific user requirements. It would be great to get some opinions from others on this

---------------------------------------------------------------------------

by KingCrunch at 2012-11-23T21:12:45Z

I thought about it and I come to the conclusion, that it is probably a not so good idea to enable caching by default, because ... well, it's not possible to disable it again. I guess something like this

    {{ render '@AcmeBundle:ArticleController:latest' with {count: 1} }}

may be not so uncommon as I suggested in the first commit.

---------------------------------------------------------------------------

by fabpot at 2012-12-03T22:18:51Z

Can you make a PR for the docs? (symfony/symfony-docs). Thanks.
2012-12-06 09:57:25 +01:00
Sebastian Krebs
6236c1835c [FrameworkBundle] Added caching to TemplateController 2012-12-06 09:57:24 +01:00
Martin Hasoň
abe244f0c9 [TwigBundle] Fixed tests on windows 2012-12-06 09:55:04 +01:00
Fabien Potencier
e75c7e20ce merged branch colinfrei/deprecatedErrorHandling (PR #6173)
This PR was squashed before being merged into the master branch (closes #6173).

Commits
-------

4878ec0 [HttpKernel] [WebProfilerBundle] Better handling of deprecated methods

Discussion
----------

[HttpKernel] [WebProfilerBundle] Better handling of deprecated methods

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes, if you were expecting E_USER_DEPRECATED or E_DEPRECATED to throw an exception
Symfony2 tests pass: yes
Fixes the following tickets: #6139 partly, I'd go through and add the actual trigger_error() calls in another (or possibly one per component) PR
Todo: call trigger_error()
License of the code: MIT
Documentation PR: -

I added the deprecation count with the Exception icon in the Profiler Toolbar, and changed the color of it to be yellow for deprecations and red for exceptions (was yellow for exceptions).

---------------------------------------------------------------------------

by fabpot at 2012-12-03T09:43:09Z

Adding trigger_error calls should be done in one PR to ease the merging. thanks.
2012-12-06 09:10:08 +01:00
Colin Frei
4878ec08e6 [HttpKernel] [WebProfilerBundle] Better handling of deprecated methods 2012-12-06 09:09:04 +01:00
Fabien Potencier
869be1df6d Merge branch '2.1'
* 2.1:
  [Locale] fixed tests
  [Config] Fixed tests on Windows
  [TwigBundle] Fixed tests
  [Security] Move DigestDataTest.php inside the Security component
  Fixed DefaultValue for session.auto_start in NodeDefinition
  Fix namespace of Validator and BrowserKit Tests

Conflicts:
	src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php
	src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php
2012-12-06 08:52:34 +01:00
Fabien Potencier
889bd2ee62 Merge branch '2.0' into 2.1
* 2.0:
  [Locale] fixed tests
  [Config] Fixed tests on Windows
  [TwigBundle] Fixed tests

Conflicts:
	phpunit.xml.dist
	src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php
	src/Symfony/Component/Locale/Tests/Stub/StubIntlDateFormatterTest.php
	src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php
2012-12-06 08:51:00 +01:00
Fabien Potencier
874ea1c029 merged branch hason/tests_2_0 (PR #6197)
This PR was merged into the 2.0 branch.

Commits
-------

5fe58bf [Locale] fixed tests
500cc3c [Config] Fixed tests on Windows

Discussion
----------

[2.0] Fixed tests

---------------------------------------------------------------------------

by fabpot at 2012-12-05T15:25:23Z

Is it a backport of some commits that were merged in 2.1/master?

---------------------------------------------------------------------------

by hason at 2012-12-05T22:17:15Z

I backported 65281fb56c and modified 90d6dc3791
2012-12-06 08:45:04 +01:00
Fabien Potencier
bf6d9be27d merged branch willdurand/woodspire-master (PR #6199)
This PR was merged into the master branch.

Commits
-------

a3a832c Fix CS in the whole Propel1 bridge
86ab4b3 Add typehint to isInteger(), fix tests
a26a690 remove useless ColumnMap
ffd8759 fix some formatting issue
6fb9536 fix indentation problem
e5e3341 oups. It seems that here, we need \PDO
36d6c40 fix indentation problem
6f8cd9d Removed the PropelColumnTypes.php copy
8125163 removed the TODO mention. Will keep the Propel code here so it can work with older version of Propel
0e4419b I found the error in my latest commit. This pass the test suite.
cf8a6c0 Fix my code and also fix the test suite.
737b596 Merge remote-tracking branch 'upstream/master'
972e503 Fix problem when 1 column identifier in propel is a string.

Discussion
----------

Fix ModelChoiceList problem with string key

Replaces #6150

---------------------------------------------------------------------------

by willdurand at 2012-12-05T20:51:44Z

Note that 5f54ed1 is a "CS fix" commit. I don't want to open a PR just for that. Let me know if I should to remove it.

Also, I'm 👍 on this PR. Review has been made already, so it seems mergeable.
2012-12-06 08:43:02 +01:00