Commits
-------
eb58dd1 Removed useless parameter from Memcached::set()
Discussion
----------
Removed useless parameter from Memcached::set() which makes users unable to set session expiry time.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
The parameter count is wrong so it makes setting session expiration useless.
---------------------------------------------------------------------------
by stof at 2012-02-25T16:06:16Z
Already fixed in 15c6ba93f
---------------------------------------------------------------------------
by stof at 2012-02-25T16:06:46Z
ah sorry, it was the profiler storage
Commits
-------
09b1bd5 [HttpKernel] Remove the _controller since it is not a route parameter part of the url
Discussion
----------
[HttpKernel] Remove the _controller since it is not a route parameter part of the URL
There is no reason for the _controller to be there, the whole idea behind this _route_params thing was to help re-generating the current page's URL, you can easily grab the _route + _route_params and reconstruct it without having lots of garbage as query parameters like `?_controller=Foo::..`
---------------------------------------------------------------------------
by fabpot at 2012-02-24T10:29:01Z
I agree but isn't it a BC break? I mean, someone may rely on `_controller` in his code.
---------------------------------------------------------------------------
by Seldaek at 2012-02-24T11:45:46Z
This is a new 2.1 feature AFAIK so no it's not breaking anything. If _controller is deemed necessary then we should add it on the attributes, but not in the _route_params IMO.
---------------------------------------------------------------------------
by stof at 2012-02-24T13:32:41Z
indeed, ``_route_params`` is new in 2.1
Commits
-------
8e90903 fixed small typo in UPGRADE-2.1.md
Discussion
----------
fixed small typo in UPGRADE-2.1.md
just replaced endforeach by endfor in UPGRADE-2.1.md in sample code
In 928e352d09, support for MongoDB cursors was implemented by converting an Iterable, non-ArrayAccess object to an array. The ArrayAccess check didn't seem purposeful, since cursors are only Iterable and ORM returns real arrays. Since we only need to access the first element of the cursor (and only in cases where the count is exactly 1), we can simply use current() to handle Iterables and arrays.
Commits
-------
15910a0 fixed coding standards
24a3cd3 Finder - allow sorting when searching in multiple directories
Discussion
----------
[Finder] not searching in multiple dirs with sorting
I hit on a problem with **Finder, when using array of directories passed to ->in() together with sorting** (e.g. ->sortByName()):
*Catchable Fatal Error: Argument 1 passed to AppendIterator::append() must implement interface Iterator, instance of Symfony\Component\Finder\Iterator\SortableIterator given in ......\vendor\symfony\src\Symfony\Component\Finder\Finder.php line 421*
The problem is in Finder.php, line 419. When more than 1 directory is used, \AppendIterator is used to merge iterators for each directory. AppendIterator->append() accepts only objects implementing Iterator interface. But this is broken for SortableIterator, which implements IteratorAggregate and NOT Iterator.
My proposed solution retrieves an Iterator from IteratorAggregate, which is later valid as an input to AppendIterator->append()
(This solved the exception mentioned aboved in my testing project, not tested more.)
Commits
-------
e67f8d4 Properly skip memcached tests when no memcached server is present
005d86f Broaden timer tests limits
001c4fd Fix windows fs tests
Discussion
----------
Fix tests
- Some windows fixes
- Skip memcached for real when it's not there - by the way I think those tests are insane since they seem to run a purge() on the memcached server. If you run this by accident somewhere where it matters it could hurt. I think they should be put in a group disabled by default, I'll be happy to add that change if it's deemed useful.
- Fixed the timer tests for good on windows (which seems to be quite bad at `usleep`). I also documented them so you actually know how it failed when it does, the false instead of true wasn't super useful.
Commits
-------
6e75fd1 Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure.
Discussion
----------
[DoctrineBundle] fixed proxy loader memory leak
[![Build Status](https://secure.travis-ci.org/kriswallsmith/symfony.png?branch=doctrine/proxy-loader-fix)](http://travis-ci.org/kriswallsmith/symfony)
The hack for loading Doctrine proxy classes has an obscure memory leak, fixed here by @jjbohn.
## The Proof
Run this test case before and after this patch:
```php
<?php
namespace Kris\JunkBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
/**
* @dataProvider asdf
*/
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/hello/Fabien');
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
}
public function asdf()
{
return array_fill(0, 500, array());
}
}
```
### Before
```
~/Sites/symfony/standard (2.0) $ phpunit -c app/
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /Users/kriswallsmith/Sites/symfony/standard/app/phpunit.xml.dist
............................................................... 63 / 500 ( 12%)
............................................................... 126 / 500 ( 25%)
............................................................... 189 / 500 ( 37%)
............................................................... 252 / 500 ( 50%)
............................................................... 315 / 500 ( 63%)
............................................................... 378 / 500 ( 75%)
............................................................... 441 / 500 ( 88%)
...........................................................
Time: 31 seconds, Memory: 289.50Mb
OK (500 tests, 500 assertions)
```
### After
```
~/Sites/symfony/standard (2.0) $ phpunit -c app/
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /Users/kriswallsmith/Sites/symfony/standard/app/phpunit.xml.dist
............................................................... 63 / 500 ( 12%)
............................................................... 126 / 500 ( 25%)
............................................................... 189 / 500 ( 37%)
............................................................... 252 / 500 ( 50%)
............................................................... 315 / 500 ( 63%)
............................................................... 378 / 500 ( 75%)
............................................................... 441 / 500 ( 88%)
...........................................................
Time: 40 seconds, Memory: 51.25Mb
OK (500 tests, 500 assertions)
```
## tl;dr
Your test suite will use much less memory — 82% in this case.
```
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```
---------------------------------------------------------------------------
by mvrhov at 2012-02-23T06:25:57Z
IMHO this change warrants a comment inside a source code as somebody might actually try to remove the first by reference assign like stof said.
---------------------------------------------------------------------------
by lsmith77 at 2012-02-23T07:55:48Z
this autoloader sounds like something we also need in the ODM's?
---------------------------------------------------------------------------
by stof at 2012-02-23T08:23:17Z
@lsmith77 if you want to allow unserializing proxies without forcing to generate them before (which would be an issue in debug mode), yeah. But take care that each Doctrine bundle should use a different proxy namespace to allow doing the check (there was some issues for people using both the ORM and the mongo ODM because of this)
---------------------------------------------------------------------------
by lsmith77 at 2012-02-23T08:24:33Z
then maybe this could should be a static method inside the bridge?
---------------------------------------------------------------------------
by beberlei at 2012-02-23T11:50:08Z
I think another side of this problem is that ->boot() ALWAYS adds this method on the autoloading stack. So with N tests you have N more autoloaders on the stack.
---------------------------------------------------------------------------
by pminnieur at 2012-02-23T12:07:00Z
This could be an issue if you use Symfony with Leach as an application server, too. After a while, memory is exhausted in face of `gc_collect_cycles` and `$kernel->boot()` and `$kernel->shutdown()` calls in between each request - which ultimately leads to a segfault after some time. I tried to track down what causes increasing memory usage and I think this could be the error.
---------------------------------------------------------------------------
by beberlei at 2012-02-23T12:28:06Z
its definately the problem, we need to remove the autoloader in shutdown, or move it elsewhere.
---------------------------------------------------------------------------
by lsmith77 at 2012-02-23T14:58:37Z
why isnt this just a setup task for the autoloader just like the annotation registry?
---------------------------------------------------------------------------
by stof at 2012-02-23T16:52:42Z
@lsmith77 because the proxy namespace and the proxy dir are not known in the autoload.php file. They are configured in the config files
---------------------------------------------------------------------------
by fabpot at 2012-02-23T18:05:51Z
The `shutdown()` method is where the autoloader should be removed. Can we include this in this PR as well so that we fix everything once and for all?
---------------------------------------------------------------------------
by kriswallsmith at 2012-02-23T19:12:05Z
The once and for all solution is for the Doctrine O*M projects to provide a ProxyLoader class with register and unregister methods that we call in boot and shutdown. We're not solving anything specific to Symfony here.
This was imported from DoctrineBundle (see: doctrine/DoctrineBundle#23), since it can be used by other Doctrine bundles, too. It utilizes the ContainerAwareEventManager from f15dde6c59.
Commits
-------
15c6ba9 [HttpKernel] Fix call to Memcached::set() once again
Discussion
----------
[HttpKernel] Fix call to Memcached::set() once again
I originally fixed this in #3358, but it appears #3363 (which touched the same line) was merged soon after.
Commits
-------
957bbcb [WebProfiler] Add default route to access the profiler more easily
Discussion
----------
[WebProfiler] Add default route to access the profiler more easily
When you have the toolbar disabled, it's pretty annoying to reach the _profiler, I never remember what to type to get something except `/_profiler`. This shows the last ten runs which is quite useful.
Commits
-------
e6e9b5a [Routing] Return the _route parameter from ApacheUrlMatcher
Discussion
----------
[Routing] Return the _route parameter from ApacheUrlMatcher
---------------------------------------------------------------------------
by fabpot at 2012-02-22T23:13:49Z
Can you squash your commits before I merge? Thanks.
---------------------------------------------------------------------------
by arnaud-lb at 2012-02-23T09:12:45Z
sure, done
Commits
-------
d02ca25 [MonologBundle] Fixed a bug when adding a processor on a service handler
Discussion
----------
Fix monolog processor
This is the proper bugfix replacing #3417, and adding a test for it