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
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.
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?
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
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.
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.
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
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
👍
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.
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.
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
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.
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
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: -
Commits
-------
6483d88 [Security][ACL] Fixed ObjectIdentity::fromDomainObject and UserSecurityIdentity::from(Account|Token) when working with proxies
Discussion
----------
[WIP] Fixed ACL handling of Doctrine proxies
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/jalliot/symfony.png?branch=acl_proxies-2)](http://travis-ci.org/jalliot/symfony)
Fixes the following tickets: #3818, #2611, #2056, #2048, #2035 and probably others
Todo: Fix tests, update changelog
Hi,
As per @fabpot's request, here is #3818 ported to `master`.
> Here is a new attempt to fix all the issues related to Symfony ACL identities and Doctrine proxies.
> It only fixes the issue for Doctrine >=2.2 (older versions of Doctrine will still not work properly with ACL because `Doctrine\Common\Util\ClassUtils` didn't exist before and proxy naming strategy was not consistent between all Doctrine implementations (ORM/ODM/etc.)).
/cc @schmittjoh @beberlei
---------------------------------------------------------------------------
by schmittjoh at 2012-04-09T00:07:52Z
I'm -1 on adding a dependency on the Doctrine class.
The naming scheme was designed in a generic way, we should just copy the method.
---------------------------------------------------------------------------
by jalliot at 2012-04-09T00:13:07Z
@schmittjoh The ACL component requires Doctrine DBAL already (and as such Common) so I don't think this is really an issue at the moment. If (when?) the component is refactored to be decoupled from Doctrine, then maybe we will have to change that.
But I can also copy the class (where?) if you think it is better :)
---------------------------------------------------------------------------
by schmittjoh at 2012-04-09T01:01:27Z
I'd suggest ``Symfony\Component\Security\Core\Util\ClassUtils``.
---------------------------------------------------------------------------
by jalliot at 2012-04-09T11:16:19Z
@fabpot @schmittjoh It's done: I've backported the ClassUtils class and its tests from Doctrine Common into the Security component. Maybe this PR can be merged into 2.0 as well now, what do you think?
---------------------------------------------------------------------------
by oscherler at 2012-04-11T06:27:20Z
There seems to be a consensus that ACLs don’t (fully?) work with Doctrine < 2.2, i.e. in Symfony 2.0. Can it therefore be documented somewhere, typically on the main documentation page on the subject? http://symfony.com/doc/current/cookbook/security/acl.html
---------------------------------------------------------------------------
by jalliot at 2012-04-11T07:36:25Z
@oscherler You can make ACL work with Doctrine < 2.2 and without this patch if you use something like this code (note this is for ORM only but it can be adapted for ODM; it also assumes that your identifier can be retrieved with `getId()`):
``` php
<?php
use Doctrine\ORM\Proxy\Proxy;
use Symfony\Component\Acl\Domain\ObjectIdentity;
$domainObject = ... // some Doctrine entity (maybe a proxy...)
if ($domainObject instanceof Proxy) {
$objectIdentity = new ObjectIdentity($domainObject->getId(), get_parent_class($domainObject));
} else {
$objectIdentity = new ObjectIdentity($domainObject->getId(), get_class($domainObject));
}
```
It is ugly but it is the only way to get the correct identity for < 2.2. Never use `ObjectIdentity::fromDomainObject` with a proxy and without this patch!
The same applies to `UserSecurityIdentity`.
This should indeed be documented in the doc for 2.0. /cc @weaverryan
---------------------------------------------------------------------------
by jalliot at 2012-04-11T22:34:37Z
I just fixed the tests and squashed the commits.
I didn't write a test for `UserSecurityIdentity::fromAccount` and `fromToken` because I didn't really have time to look for a clean solution (without creating a full UserInterface implementation for instance...). Anyway the test for `ObjectIdentity::fromDomainObject` should be enough I guess...
Don't hesitate to add one if you think it is necessary. /cc @schmittjoh
@fabpot Apart from @beberlei approval to use MIT license, I think it is ready for merge.
Commits
-------
771ab45 Updated croatian validator translation and deleted validator xliff file
Discussion
----------
[FrameworkBundle][translations]Updated croatian validator translation and deleted validator xliff file
Updated croatian validator messages.
Also, "validators.hr.xliff" file was in translations folder so I deleted it (how did it get there? It should be in the 2.0 branch only).
Commits
-------
6f56dfc [Form] Fixed DateType default options
779d3bb [Form] Fixed documentation, and the DateType (default options)
Discussion
----------
[Form] Fixed documentation, and the DateType (default options)
---------------------------------------------------------------------------
by fabpot at 2012-04-11T16:48:04Z
That breaks the tests.
---------------------------------------------------------------------------
by willdurand at 2012-04-11T16:50:35Z
I got an error with the Form test suite before to write this patch..
---------------------------------------------------------------------------
by willdurand at 2012-04-11T16:53:30Z
Nevermind, I can see broken tests.. I'm on, sorry
---------------------------------------------------------------------------
by willdurand at 2012-04-11T16:57:52Z
@fabpot fixed.
```
OK, but incomplete or skipped tests!
Tests: 945, Assertions: 1439, Incomplete: 11.
```
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(),
...).
Commits
-------
7276a04 Added some more bc breaks to UPGRADE-2.1.md from the changelog
Discussion
----------
Added some more bc breaks to UPGRADE-2.1.md from the changelog
Commits
-------
f666836 [Routing] simplified regex with named variables
Discussion
----------
[Routing] simplified regex with named variables
Test pass: yes
BC break: no
Since PHP 5.2.2 subpatterns in regex can be simplified from `?P<name>` to `?<name>` (see http://www.php.net/manual/en/regexp.reference.subpatterns.php).
This enhances readability.