Commit Graph

9229 Commits

Author SHA1 Message Date
Bernhard Schussek fcb2227ac9 [Form] Deprecated FieldType, which has been merged into FormType 2012-04-17 16:44:39 +02:00
Bernhard Schussek bfa7ef2d9b [Form] Removed obsolete exceptions 2012-04-17 16:44:38 +02:00
Bernhard Schussek 2a49449862 [Form] Simplified CSRF mechanism and removed "csrf" type
CSRF fields are now only added when the view is built. For this reason we already know if
the form is the root form and avoid to create unnecessary CSRF fields for nested fields.
2012-04-17 16:44:38 +02:00
Fabien Potencier e7470ffebb merged branch willdurand/propel-bridge (PR #3949)
Commits
-------

51e19d5 Added propel1-bridge to the main composer.json
fba5d68 [Propel1] Added composer.json
bbf0122 [Propel1] Fixed phpunit.xml.dist

Discussion
----------

Added composer.json to the Propel bridge

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

by stof at 2012-04-15T00:14:12Z

you need to add it in the ``replace`` section for the main package too

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

by willdurand at 2012-04-15T00:17:13Z

Ah done, I forgot that file, thanks.
2012-04-15 08:56:17 +02:00
William DURAND 51e19d56fd Added propel1-bridge to the main composer.json 2012-04-15 02:16:34 +02:00
William DURAND fba5d68397 [Propel1] Added composer.json 2012-04-15 02:05:10 +02:00
William DURAND bbf0122dd0 [Propel1] Fixed phpunit.xml.dist 2012-04-15 02:03:48 +02:00
Fabien Potencier 45d43d325a merged branch drak/clear_tag (PR #3940)
Commits
-------

80f96b7 [DependencyInjection] Add ability to clear tags by name.

Discussion
----------

[DependencyInjection] Add ability to clear tags by name.

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

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

by jalliot at 2012-04-14T07:50:51Z

@drak Just for information, what is the use case?

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

by drak at 2012-04-14T08:40:13Z

I'm using this to filter (and prevent) some listeners from being loaded
into the dispatcher.

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

by lsmith77 at 2012-04-14T09:37:39Z

tags are used by compiler passes. bundles that set these tags expect some defined bundle to take some specific actions on the given services. as such this is already a fairly "fragile" relationship. once other compiler passes then start messing with these tags it can get even more tricky. then again, as long as you know what you are doing ..

that being said .. this method just adds convenience, since one could always just get all the tags, unset and reset them in bulk.

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

by drak at 2012-04-14T09:42:04Z

@lsmith77 - exactly.
2012-04-14 12:39:38 +02:00
Fabien Potencier 8cdf49bf87 merged branch stloyd/tests (PR #3941)
Commits
-------

bfc1aaf [Tests] Use proper assertions

Discussion
----------

[Tests] Use proper assertions

* `assertEquals(false, *)` -> `assertFalse(*)`
* `assertEquals(true, *)` -> `assertTrue(*)`
* `assertEquals(null, *)` -> `assertNull(*)`
* `assertEquals(x, count(*))` -> `assertCount(x, *)`
* `assertSame(false, *)` -> `assertFalse(*)`
* `assertSame(true, *)` -> `assertTrue(*)`
* `assertSame(null, *)` -> `assertNull(*)`

![Travis CI](https://secure.travis-ci.org/stloyd/symfony.png?branch=tests)

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

by drak at 2012-04-14T08:44:16Z

This is nice, but the commit message leads one to believe bugs are beings fixed, when actually it's just about using PHPUnit shortcut/covenience methods.
2012-04-14 12:36:31 +02:00
Joseph Bielawski bfc1aafff6 [Tests] Use proper assertions 2012-04-14 10:05:05 +02:00
Drak 80f96b7a1b [DependencyInjection] Add ability to clear tags by name. 2012-04-14 11:56:21 +05:45
Fabien Potencier d2fd9ce7b9 merged 2.0 2012-04-13 22:21:31 +02:00
Fabien Potencier 098b934410 merged branch vicb/profiler/listener_2.0 (PR #3935)
Commits
-------

01fcb08 [HttpKernel] Fix the ProfilerListener (fix #3620)

Discussion
----------

[HttpKernel] Fix the ProfilerListener (fix #3620)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/vicb/symfony.png?branch=profiler/listener_2.0)](http://travis-ci.org/vicb/symfony)
Fixes the following tickets: #3620, PR #3618

Many thanks to @guilhermeblanco for helping with the tests.

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

by vicb at 2012-04-13T20:10:15Z

For ref: that's basically a backport of #3920 for 2.0
2012-04-13 22:16:12 +02:00
Victor Berchet 01fcb08ea2 [HttpKernel] Fix the ProfilerListener (fix #3620) 2012-04-13 21:51:39 +02:00
Fabien Potencier d9fa1b94ae merged branch stof/form_cleanup (PR #3931)
Commits
-------

538819a [Form] Fixed the tests
9e956a8 [Form] Cleaned the FormValidatorInterface deprecation

Discussion
----------

[Form] Cleaned the FormValidatorInterface deprecation

This fixes my feedback on #3797

[![Build Status](https://secure.travis-ci.org/stof/symfony.png?branch=form_cleanup)](http://travis-ci.org/stof/symfony)
2012-04-13 21:41:36 +02:00
Fabien Potencier 8e59a4ed79 merged branch jmikola/doctrine-unique-proxies (PR #3933)
Commits
-------

41bdf26 [DoctrineBridge] Initialize proxies in UniqueEntityValidator

Discussion
----------

[DoctrineBridge] Initialize proxies in UniqueEntityValidator

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/jmikola/symfony.png?branch=master)](http://travis-ci.org/jmikola/symfony)
Fixes the following tickets: #3163

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

by stof at 2012-04-13T18:17:57Z

I think you should use ``$em->initializeObject($value)`` instead (which is a no-op for other objects)

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

by jmikola at 2012-04-13T18:24:22Z

@stof: Thanks for the suggestion. I wasn't aware of that method.
2012-04-13 21:41:11 +02:00
Jeremy Mikola 41bdf26cb2 [DoctrineBridge] Initialize proxies in UniqueEntityValidator
Fixes #3163
2012-04-13 14:24:50 -04:00
Christophe Coevoet 538819a8bf [Form] Fixed the tests 2012-04-13 19:11:38 +02:00
Christophe Coevoet 9e956a8ecd [Form] Cleaned the FormValidatorInterface deprecation 2012-04-13 18:57:23 +02:00
Fabien Potencier 22177fa029 merged branch vicb/profiler/listener (PR #3920)
Commits
-------

b611db8 [Profiler] Sub requests are not Main requests
2551270 [Profiler] Minimize the number of Profile writes

Discussion
----------

[HttpKernel] Profiler Listener tweaks

* `setParent()` is called in [`Profile::addChild()`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Profiler/Profile.php#L180) in 2.1
* The profiles are now only saved once only in the listener (either at the end of the main request or on an exception)
* The profiles are now only saved once only in the TraceableEventDispatcher (twice for the root profile when there is a kernel.terminate' event

[![Build Status](https://secure.travis-ci.org/vicb/symfony.png?branch=profiler/listener)](http://travis-ci.org/vicb/symfony)

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

by vicb at 2012-04-13T11:15:25Z

Not so sure for the save part... I'll double check
2012-04-13 18:56:35 +02:00
Victor Berchet b611db8e41 [Profiler] Sub requests are not Main requests 2012-04-13 18:42:55 +02:00
Victor Berchet 255127081a [Profiler] Minimize the number of Profile writes
squash

squash
2012-04-13 18:30:43 +02:00
Fabien Potencier a4ea77bc5d merged branch phreaknerd/fix_issue_#3251_for_2.0 (PR #3926)
Commits
-------

3ae826a Fix issue #3251: Check attribute type of service tags

Discussion
----------

Fix issue #3251: Check attribute type of service tags

The attributes of service tags have to be of a scalar type.
It was possible to add arrays here with yaml-configuration.
2012-04-13 17:24:08 +02:00
Carsten Nielsen 3ae826a07d Fix issue #3251: Check attribute type of service tags
The attributes of service tags have to be of a scalar type.
It was possible to add arrays here with yaml-configuration.
2012-04-13 17:07:37 +02:00
Fabien Potencier baabe2649e merged branch bschussek/remove-form-validator (PR #3797)
Commits
-------

6df7a72 [Form] Deprecated FormValidatorInterface and moved implementations to event listeners

Discussion
----------

[Form] Removed FormValidatorInterface and notion of form validators

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=remove-form-validator)

This cleanup has been lying on a disk for a while, so here it goes.

The FormValidatorInterface has been removed in order to reduce the complexity of the Form API. The same expressivity can be achieved by using POST_BIND event listeners. The POST_VALIDATE event introduced in e6577debf6 can be replaced by a POST_BIND listener with low priority.

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

by bschussek at 2012-04-11T15:19:24Z

Rebased on master.

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

by bschussek at 2012-04-12T12:46:14Z

@fabpot Can this be merged?
2012-04-13 17:00:38 +02:00
Bernhard Schussek 6df7a7223e [Form] Deprecated FormValidatorInterface and moved implementations to event listeners 2012-04-13 16:42:01 +02:00
Fabien Potencier 463114134b merged branch asm89/configurable-session-save-path (PR #3912)
Commits
-------

c0e7ee9 [FrameworkBundle] Make session save path configurable

Discussion
----------

[FrameworkBundle] Make session save path configurable

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=configurable-session-save-path)](http://travis-ci.org/asm89/symfony)

Makes it possible to configure the session save path. It still defaults to saving sessions in the kernel cache dir. This might not be appropriate if you want to keep your user sessions after deploying your application.

As promised to @fabpot I will also do a PR on the docs explaining why this might be useful.

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

by drak at 2012-04-13T10:16:17Z

It might be good to default this value to `%kernel.cache_dir%/sessions`.

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

by stloyd at 2012-04-13T10:30:58Z

@drak https://github.com/symfony/symfony/pull/3912/files#L0R184

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

by drak at 2012-04-13T10:31:57Z

@stloyd need my eyes checked :-P
2012-04-13 14:51:40 +02:00
Fabien Potencier 1547a82eae merged branch Tobion/httpkernel-test (PR #3906)
Commits
-------

c331f4a HttpKernel test fix on windows

Discussion
----------

HttpKernel test fix on windows

The changes in `StopwatchEventTest` are only for consistency with the other tests in this file.

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

by drak at 2012-04-13T04:16:19Z

@fabpot - This seems to be an eternal problem with the these particular tests. I wonder if there is a better way to do this.  How about a simple greater than condition to show time has elapsed?

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

by Tobion at 2012-04-13T04:33:04Z

The tests are fine. I didn't change them. Just made it more consistent.

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

by drak at 2012-04-13T04:49:20Z

Yes, but if you look at the history of these tests files, they are constantly being tweaked for whatever reason (and they often fail on windows builds randomly). This is a clear indication the tests are not robust and a different approach is probably warranted if it can be found.

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

by drak at 2012-04-13T04:52:53Z

@Tobion - regarding the commit message, what does "fix" refer to if the tests are fine?

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

by Tobion at 2012-04-13T04:56:39Z

The test in `KernelTest` did not pass for me. That's fixed.
2012-04-13 14:45:21 +02:00
Alexander c0e7ee9a6c [FrameworkBundle] Make session save path configurable 2012-04-13 10:48:56 +02:00
Fabien Potencier 114bc14c21 [FrameworkBundle] fixed name collision 2012-04-13 09:04:04 +02:00
Fabien Potencier d87a197d80 merged branch drak/kernel_dicb (PR #3909)
Commits
-------

82bbf3b [HttpKernel] Allow override of ContainerBuilder instance used to build container

Discussion
----------

[HttpKernel] Allow override of ContainerBuilder class in Kernel

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

The ContainerBuilder class is hard coded into the `buildContainer()` method and is therefor not extensible.

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

by fabpot at 2012-04-13T04:54:28Z

I would definitely prefer a `getContainerBuilder()` that returns a container builder. But why would you want to do that?

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

by drak at 2012-04-13T05:12:13Z

@fabpot - The use case is to override the behaviour of the compilation that is performed by the kernel on the container.  There is no way to override the compile() method called on the builder because the class is created hard in `Kernel::buildContainer()`. This was the simplest way to change it without other cascading changes.

If we had a method which returned a container builder instance, would it just be something that creates a container builder, or acts as a getter on a property? The reason I ask is there is no real need to have a container builder persisting in a property, so a method that just returns a `new ContainerBuilder()` would also work but then we have to deal with the constructor as there is no way to set a ParameterBag on a container and `Kernel::buildContainer()` needs that.

Basically, my reasoning is that since this particular container is just a throwaway, it seems ok to control the class name that was used to create the throwaway builder.

So are you suggesting doing this instead?

    protected function getContainerBuilder()
    {
        return new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
    }

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

by fabpot at 2012-04-13T05:22:20Z

Yes this was my suggestion. But are you sure you cannot solve your problems with compiler passes?

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

by drak at 2012-04-13T05:38:29Z

@fabpot, yes, this particular issue can't be solved by compiler passes.  I'll adapt the PR.

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

by drak at 2012-04-13T05:46:03Z

@fabpot, amended as per your suggestion.
2012-04-13 07:50:57 +02:00
Drak 82bbf3b8b1 [HttpKernel] Allow override of ContainerBuilder instance used to build container 2012-04-13 11:27:54 +05:45
Fabien Potencier 70df8d3892 [FrameworkBundle] made the Esi and Store instances configurable in HttpCache base class 2012-04-13 07:23:33 +02:00
Fabien Potencier 0956be908c merged branch Tobion/route-compiler (PR #3891)
Commits
-------

cb47b03 [Routing] small refactoring + language fixes

Discussion
----------

[Routing] small refactoring + language fixes

tests pass, no bc break

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

by vicb at 2012-04-12T06:42:19Z

@Tobion could you squash your commits ?

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

by Tobion at 2012-04-12T19:25:03Z

done
2012-04-13 06:59:08 +02:00
Fabien Potencier cec8fed31c merged branch willdurand/add-all-method-to-form-builder (PR #3886)
Commits
-------

be2456b [Form] [Tests] Used assertCount()
4120f13 [Form] Added all() method to the FormBuilder class

Discussion
----------

[Form] Added all() method to the FormBuilder class

In order to perform some introspection on a FormBuilder instance,
we need to be able to get its children. Almost everything is accessible
in this class, but the children are not.

This PR adds a all() method to respect the current API (get(), remove(),
...).

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

by bschussek at 2012-04-12T09:54:04Z

👍
2012-04-13 06:56:27 +02:00
Tobias Schultze c331f4a306 HttpKernel test fix on windows 2012-04-13 00:48:19 +02:00
Tobias Schultze cb47b03209 [Routing] small refactoring + language fixes 2012-04-12 21:23:30 +02:00
Fabien Potencier b2af6b4f24 merged branch drak/eventsubscribersnotice (PR #3902)
Commits
-------

e199049 [EventDispatcher] Fixed edge case not covered by tests that generated E_NOTICES

Discussion
----------

[EventDispatcher] Fixed edge case not covered by tests.

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

Fixes case not covered by tests.
2012-04-12 13:47:50 +02:00
Drak e199049581 [EventDispatcher] Fixed edge case not covered by tests that generated E_NOTICES 2012-04-12 16:21:33 +05:45
Fabien Potencier 5a320ca7bd merged 2.0 2012-04-12 12:30:32 +02:00
Fabien Potencier 5ab006aca2 merged branch Tobion/generator-dumper (PR #3894)
Commits
-------

382b083 [Routing] improved generated class by PhpGeneratorDumper
27a05f4 [Routing] small optimization of PhpGeneratorDumper

Discussion
----------

[Routing] improved PhpGeneratorDumper

Test pass: yes
BC break: no

The first commit only replaces arrays with strings and makes some cosmetic changes, so that it's more readable. This makes the `PhpGeneratorDumper` consistent in style with `PhpMatcherDumper` that I fixed recently and should slightly improve performance of the generation of the class.

The second commit changes the output of the `PhpGeneratorDumper->dump` and tries to optimize the resulting class that is used to generate URLs. It's best explained with an example.

Before my changes:

```php
class ProjectUrlGenerator extends Symfony\Component\Routing\Generator\UrlGenerator
{
    static private $declaredRouteNames = array(
       'Test' => true,
       'Test2' => true,
    );

    /**
     * Constructor.
     */
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function generate($name, $parameters = array(), $absolute = false)
    {
        if (!isset(self::$declaredRouteNames[$name])) {
            throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
        }

        $escapedName = str_replace('.', '__', $name);

        list($variables, $defaults, $requirements, $tokens) = $this->{'get'.$escapedName.'RouteInfo'}();

        return $this->doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $absolute);
    }

    private function getTestRouteInfo()
    {
        return array(array (  0 => 'foo',), array (), array (), array (  0 =>   array (    0 => 'variable',    1 => '/',    2 => '[^/]+?',    3 => 'foo',  ),  1 =>   array (    0 => 'text',    1 => '/testing',  ),));
    }

    private function getTest2RouteInfo()
    {
        return array(array (), array (), array (), array (  0 =>   array (    0 => 'text',    1 => '/testing2',  ),));
    }
}
```

After my changes in second commit:

```php
class ProjectUrlGenerator extends Symfony\Component\Routing\Generator\UrlGenerator
{
    static private $declaredRoutes = array(
        'Test' => array (  0 =>   array (    0 => 'foo',  ),  1 =>   array (  ),  2 =>   array (  ),  3 =>   array (    0 =>     array (      0 => 'variable',      1 => '/',      2 => '[^/]+?',      3 => 'foo',    ),    1 =>     array (      0 => 'text',      1 => '/testing',    ),  ),),
        'Test2' => array (  0 =>   array (  ),  1 =>   array (  ),  2 =>   array (  ),  3 =>   array (    0 =>     array (      0 => 'text',      1 => '/testing2',    ),  ),),
    );

    /**
     * Constructor.
     */
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function generate($name, $parameters = array(), $absolute = false)
    {
        if (!isset(self::$declaredRoutes[$name])) {
            throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
        }

        list($variables, $defaults, $requirements, $tokens) = self::$declaredRoutes[$name];

        return $this->doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $absolute);
    }
}
```

As you can see, there is no need to escape the route name and invoke a special method anymore. Instead the route properties are included in the static route array directly, that existed anyway. Is also easier to read as defined routes and their properties are in the same place.
2012-04-12 12:27:45 +02:00
Fabien Potencier c1aa618c44 merged branch jalliot/patch-1 (PR #3895)
Commits
-------

36d96e6 Update changelog for latest fix in ACL component

Discussion
----------

Update changelog for latest fix in ACL component
2012-04-12 12:27:32 +02:00
Fabien Potencier 2bad8350f7 merged branch bschussek/issue3539 (PR #3898)
Commits
-------

2e5182f [Form] Clarified the CHANGELOG entry about the activation of addXxx()/removeXxx() methods

Discussion
----------

[Form] Clarified the CHANGELOG entry about the activation of addXxx()/removeXxx() methods
2012-04-12 12:26:35 +02:00
Fabien Potencier 3bd2e01ea7 merged branch drak/eventsubscriber_notice (PR #3900)
Commits
-------

57dd914 [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities

Discussion
----------

[EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber

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

This fixes a case that was not covered by the existing tests.
2012-04-12 12:25:57 +02:00
Drak 57dd9147d9 [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities 2012-04-12 15:56:02 +05:45
Bernhard Schussek 2e5182f79b [Form] Clarified the CHANGELOG entry about the activation of addXxx()/removeXxx() methods 2012-04-12 11:42:32 +02:00
Jordan Alliot 36d96e6337 Update changelog for latest fix in ACL component 2012-04-12 11:03:00 +03:00
Tobias Schultze 382b08361b [Routing] improved generated class by PhpGeneratorDumper 2012-04-12 07:35:08 +02:00
Fabien Potencier bf1131cc50 merged branch Tobion/generator-cache (PR #3892)
Commits
-------

03d30fd [Routing] remove duplicated cache of compiled routes

Discussion
----------

[Routing] remove duplicated cache of compiled routes

The UrlGenerator caches compiled routes for generating URLs. But the Route class caches it's compiled route itself as long as it does not get modified. So compiled routes are cached twice which makes no sense in my opinion.

Test pass: yes
BC break: no
2012-04-12 06:57:29 +02:00
Fabien Potencier 3923ade0aa merged branch kimhemsoe/process_deadlock (PR #3888)
Commits
-------

89a5c1a [process] Added destructor to process to make sure handles are always closed in the right order.

Discussion
----------

[process] Added destructor to process to make sure handles are always cl...

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-12 06:56:15 +02:00