Commit Graph

7338 Commits

Author SHA1 Message Date
Fabien Potencier
e335fa208c merged branch stof/doctrine_autoload (PR #3584)
Commits
-------

878c239 Fixed autoloader leakage in tests

Discussion
----------

Doctrine autoload

The autoloader for proxies is now unregistered on shutdown to avoid
having several instances registered at the same time in tests.
2012-03-13 10:26:39 +01:00
Christophe Coevoet
878c2399f1 Fixed autoloader leakage in tests
The autoloader for proxies is now unregistered on shutdown to avoid
having several instances registered at the same time in tests.
2012-03-13 10:01:34 +01:00
Alan Chen
17c3482309 fixed timezone bug in DateTimeToTimestampTransformer 2012-03-12 22:51:14 +08:00
Fabien Potencier
b062cc78d4 merged branch iambrosi/issue2653 (PR #3564)
Commits
-------

aa53b88 Sets _format attribute only if it wasn't set previously by the user

Discussion
----------

Sets _format attribute only if it wasn't set previously by the user.

Fixes #2653
2012-03-12 09:34:46 +01:00
Fabien Potencier
d338c762c2 merged branch meandmymonkey/xml-output-fix (PR #3569)
Commits
-------

705e460 provided unmerged definition for correct help generation
45bbb5b added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation

Discussion
----------

[Console] Xml output fix

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2667
Todo: add specific test

As per my comment [here](https://github.com/symfony/symfony/issues/2667#issuecomment-4431944), added the ability to provide an InputDefinition that will not be changed by merging with the Application InputDefinition..
2012-03-12 09:18:38 +01:00
Andreas Hucks
705e46018e provided unmerged definition for correct help generation 2012-03-12 01:11:44 +01:00
Andreas Hucks
45bbb5be01 added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation 2012-03-12 01:10:54 +01:00
Ismael Ambrosi
aa53b887d1 Sets _format attribute only if it wasn't set previously by the user 2012-03-11 16:56:20 -03:00
Fabien Potencier
0d89f13560 fixed CS 2012-03-11 17:59:42 +01:00
Fabien Potencier
a82737528c [CssSelector] fixed CssSelector::toXPath() when the CSS selector is an empty string 2012-03-11 10:18:25 +01:00
Fabien Potencier
1b9b42893f merged branch stof/composer_deps (PR #3553)
Commits
-------

f26c1ce Fixed constraint requirements for Doctrine Common
011791d [Form] Moved the Validator component to the suggest section

Discussion
----------

Composer deps

There is no hard dependency to the Validator component in the Form, as said on Twitter when @harikt tried to use it. I kept the Locale component as a requirement as it is used by the LanguageTyep, CountryType and LocaleType which will be registered when using the CoreExtension.

The constraints for Doctrine deps are fixed too: adding an upper bound everywhere as we don't know the future to guarantee the compatibility (and for instance, 2.0.9 and lower were not compatible with ORM 2.2 as we had to fix the bundle), and the bridge is compatible with Common 2.2 too, not only with 2.1.

I found 2 other places where the dependencies should be discussed:

- the Validator component marks a hard dependency to Doctrine Common for its annotation reader. There is a dependency only when using annotation so it should not be a hard requirement IMO but a suggestion. the issue is that the [ValidatorFactory](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/ValidatorFactory.php) (not used by the framework itself) will add an annotation loader when relying on the default value of the arguments, which means that people that don't take care will need Common. Would it make sense to change the default so that Common is needed only when the user explicitly asks to use annotations ? Moving Common from require to suggest would make it easier for people using the Validator component standalone if they don't use annotations
- the Security component suggests the Finder and ClassLoader components. But these ones are only used by the [dev script](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php) used to generate the SQL schema shipped in the component. Does it really make sense to list them as people cloning the component should probably never use this script (which alters the files in the component) ?

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

by fabpot at 2012-03-11T08:14:46Z

+1 for removing Doctrine Common as a required dependency for the Validator component.

+1 for removing ClassLoader and Finder from the Security suggestions.
2012-03-11 09:15:23 +01:00
Christophe Coevoet
f26c1ce98d Fixed constraint requirements for Doctrine Common 2012-03-11 02:47:07 +01:00
Christophe Coevoet
011791dbef [Form] Moved the Validator component to the suggest section
There is no hard dependency to the Validator component.
2012-03-11 02:32:06 +01:00
Fabien Potencier
85000fc288 merged branch stealth35/patch-18 (PR #3542)
Commits
-------

7aad478 [Locale] Prevent empty bundle

Discussion
----------

[Locale] Prevent empty bundle

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/stealth35/symfony.png?branch=patch-18)](http://travis-ci.org/stealth35/symfony)
Fixes the following tickets: #3486
Todo: -
2012-03-10 16:38:15 +01:00
Fabien Potencier
86444c33f8 merged branch clemherreman/fix-browserkit_client-history (PR #3550)
Commits
-------

ad07a95 [BrowserKit] Fixed Client->back/forward/reload() not keeping all request attributes

Discussion
----------

[BrowserKit] Client->back/forward/reload() is not keeping all request attributes

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Travis CI icon](https://secure.travis-ci.org/clemherreman/symfony.png?branch=fix-browserkit_client-history)
Fixes the following tickets: This one
Todo: -

<hr>

Hello

While using the BrowserKit component with Behat, I noticed that some request attributes, such as files or body, disappeared when using `Symfony\Component\BrowserKit\Client->back/forward/reload()`.

The method used internally in these methods, Client->#requestFromRequest was badly passing the old request parameters to the new request. See the diff.
2012-03-10 16:37:22 +01:00
Clement Herreman
ad07a95818 [BrowserKit] Fixed Client->back/forward/reload() not keeping all request attributes
The method used internally in these methods, Client->#requestFromRequest was badly
passing the old request parameters to the new request.
2012-03-10 16:26:36 +01:00
Victor Berchet
eee5065434 [TwigBundle] Workaround a flaw in the design of the configuration (normalization) 2012-03-09 21:13:44 +01:00
stealth35
7aad478fe2 [Locale] Prevent empty bundle 2012-03-09 16:37:22 +01:00
Pierre Minnieur
0c9b2d47b0 use SecurityContextInterface instead of SecurityContext 2012-03-09 10:08:43 +01:00
Fabien Potencier
55f962d44d merged branch Seldaek/autoload (PR #3515)
Commits
-------

d2f8aa3 Allow autoload to run without vendors being cloned

Discussion
----------

[Tests] Allow autoload to run without vendors being cloned

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-03-07 11:41:14 +01:00
Fabien Potencier
3681dae8eb merged branch Seldaek/param_bag (PR #3516)
Commits
-------

a894431 [DependencyInjection] Allow parsing of parameters near escaped percent signs

Discussion
----------

[DependencyInjection] Allow parsing of parameters near escaped percent signs

Bug fix: yes
Feature addition: no
Backwards compatibility break: no (unless someone relied on the buggy behavior..)
Symfony2 tests pass: yes
2012-03-07 11:40:30 +01:00
Jordi Boggiano
d2f8aa3806 Allow autoload to run without vendors being cloned 2012-03-06 13:36:48 +01:00
Jordi Boggiano
a894431c6c [DependencyInjection] Allow parsing of parameters near escaped percent signs 2012-03-06 13:33:50 +01:00
Fabien Potencier
8e53f791c4 merged branch jcrombez/patch-1 (PR #3494)
Commits
-------

3c6a8e5 [BrowserKit] Missing @return Crawler annotation for the click() Client method.

Discussion
----------

[BrowserKit] Missing @return Crawler annotation for the click() Client method.
2012-03-03 15:08:55 +01:00
Jérémy CROMBEZ
3c6a8e53d3 [BrowserKit] Missing @return Crawler annotation for the click() Client method. 2012-03-03 14:34:04 +01:00
Fabien Potencier
77297b0602 [EventDispatcher] fixed CS 2012-03-03 01:31:12 +01:00
Fabien Potencier
f758884c2b [FrameworkBundle] ContainerAwareEventDispatcher::removeListener() (closes #3115) 2012-03-03 01:31:08 +01:00
Fabien Potencier
ffce6be671 [FrameworkBundle] fixed CS 2012-03-03 01:31:05 +01:00
Fabien Potencier
8fe6ee3d62 [Console] fixed help command when used from the shell (closes #3480) 2012-03-02 23:14:57 +01:00
Fabien Potencier
70fc80292a [BrowserKit] added a unit test (refs #3385) 2012-03-02 23:01:01 +01:00
Fabien Potencier
003c2e4175 merged branch stealth35/patch-17 (PR #3491)
Commits
-------

8fa2ff0 [FrameworkBundle] fix DependencyInjection/*FrameworkExtensionTest for Windows

Discussion
----------

[FrameworkBundle] fix DependencyInjection/*FrameworkExtensionTest for Windows
2012-03-02 19:06:02 +01:00
stealth35
8fa2ff0582 [FrameworkBundle] fix DependencyInjection/*FrameworkExtensionTest for Windows 2012-03-02 17:54:28 +01:00
Fabien Potencier
a705ee9d13 merged branch stealth35/patch-16 (PR #3487)
Commits
-------

caa44ae Only work with the cli sapi
e2fc3cd [Process] PHP_BINARY return the current process

Discussion
----------

[Process] PHP_BINARY only return the current sapi process

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

PHP_BINARY return the current process, so under the apache module I get (on Windows) `httpd.exe`

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

by vicb at 2012-03-02T14:48:04Z

Could it be '.../php5' ?
Is it a PHP bug ?

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

by stealth35 at 2012-03-02T15:00:57Z

@vicb

> Could it be '.../php5' ?

Yes, but it's not the standard installation, you also call you php executable 'blabla.exe'

> Is it a PHP bug ?

I'don't now, I think it's get the SAPI but If it's work under Unix so yes it's a PHP Bug
http://lxr.php.net/opengrok/xref/PHP_5_4/main/main.c#binary_location

I'll test this on my Mac

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

by vicb at 2012-03-02T15:08:25Z

@stealth35

* asking about 'php5' because it seems some systems use this name,
* would testing for a cli sapi be more robust than making assumptions about the process name ?

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

by stealth35 at 2012-03-02T15:24:24Z

@vicb yes I think it's better

Anybody can test `PHP_BINARY` with some sapi like : `cgi`, `cgi-fcgi`, `fpm-fcgi` ... ?
2012-03-02 17:27:58 +01:00
stealth35
caa44aefc1 Only work with the cli sapi 2012-03-02 16:42:35 +01:00
stealth35
e2fc3cde90 [Process] PHP_BINARY return the current process 2012-03-02 14:33:12 +01:00
Fabien Potencier
241e4fccbd merged branch michal-pipa/test-fix (PR #3470)
Commits
-------

515b581 [FrameworkBundle] Fixed test

Discussion
----------

[FrameworkBundle] Fixed test on Ubuntu 10.04 LTS

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

Test was failing on Ubuntu 10.04 LTS because Ubuntu adds it's own PHP extra version number, which was greater than 5.3.2.

The same bug exist in master branch.
2012-03-01 00:56:40 +01:00
Michał Pipa
515b581937 [FrameworkBundle] Fixed test 2012-02-29 07:49:03 +01:00
Fabien Potencier
9e6dcf0746 merged branch beberlei/PDOSessionTest (PR #3462)
Commits
-------

5a6ce20 [Session] Add Test for PDO Session Storage with SQLite in Memory DB.

Discussion
----------

[Session] PDO Session Storage tests

The PDO Session storage was untested previously.

This test is for the 2.0 API. The methods names all changed in the master branch and have to be adjusted when 2.0 is merged into master.
2012-02-27 16:52:10 +01:00
Benjamin Eberlei
5a6ce200e2 [Session] Add Test for PDO Session Storage with SQLite in Memory DB. 2012-02-27 16:32:07 +01:00
Fabien Potencier
8bdd01f633 merged branch beberlei/PdoSessionStorageSqlSrvFix (PR #3461)
Commits
-------

dc2d5a0 [HttpFoundation][Session] Fix bug in PDO Session Storage with SQLSRV making assumptions about parameters with length being OUTPUT not INPUT parameters.

Discussion
----------

[HttpFoundation][Session] PDO session storage sql srv fix

...ing assumptions about parameters with length being OUTPUT not INPUT parameters.

See also http://social.msdn.microsoft.com/Forums/en/sqldriverforphp/thread/c7431849-8594-4da2-bef6-8702b72391cc

Addtionally PDO Session Storage has no tests on either master or 2.0, i will provide a PR with a basic coverage in a seperate commit.
2012-02-27 16:12:17 +01:00
Benjamin Eberlei
dc2d5a0581 [HttpFoundation][Session] Fix bug in PDO Session Storage with SQLSRV making assumptions about parameters with length being OUTPUT not INPUT parameters. 2012-02-27 15:57:52 +01:00
Fabien Potencier
f9f7640422 merged branch pulzarraider/fix_profiler_test (PR #3455)
Commits
-------

e8281cf SqliteProfilerStorage fix

Discussion
----------

[HttpKernel] SqliteProfilerStorage fix

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-02-27 10:01:48 +01:00
Andrej Hudec
e8281cf6f5 SqliteProfilerStorage fix 2012-02-26 16:52:51 +01:00
Fabien Potencier
2d4fb8ad50 updated VERSION for 2.0.11 2012-02-24 22:59:39 +01:00
Fabien Potencier
51ba6ffc6d updated CHANGELOG for 2.0.11 2012-02-24 22:59:05 +01:00
Fabien Potencier
71b62276d3 fixed a test 2012-02-24 22:55:48 +01:00
Jordi Boggiano
3e64d36cbd [Serializer] Fix XML decoding attack vector through external entities 2012-02-24 22:50:04 +01:00
Fabien Potencier
3223f51bb1 merged branch pcampr/patch-1 (PR #3439)
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.)
2012-02-24 11:34:01 +01:00
Fabien Potencier
6af6531bfb merged branch kriswallsmith/doctrine/proxy-loader-fix (PR #3419)
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.
2012-02-24 11:29:42 +01:00
Victor Berchet
66d0d3dd4b [FrameworkBundle] Fix a bug in the RedirectableUrlMatcher 2012-02-24 11:26:41 +01:00