Commit Graph

7450 Commits

Author SHA1 Message Date
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
Pavel Campr
15910a015b fixed coding standards 2012-02-24 09:04:00 +01:00
Pavel Campr
24a3cd3540 Finder - allow sorting when searching in multiple directories 2012-02-24 01:10:57 +01:00
John Bohn
6e75fd16c8 Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure. 2012-02-22 16:21:34 -08:00
Fabien Potencier
f6b4f89f8f merged branch stof/fix_monolog_processor (PR #3418)
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
2012-02-23 00:10:20 +01:00
Christophe Coevoet
d02ca2512b [MonologBundle] Fixed a bug when adding a processor on a service handler 2012-02-22 22:42:42 +01:00
Fabien Potencier
2f33b5d1f2 merged branch marcw/patch-license-copyright (PR #3411)
Commits
-------

89868f7 Updated LICENSE files copyright

Discussion
----------

Updated LICENSE files copyright
2012-02-22 10:13:19 +01:00
marc.weistroff
89868f7901 Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
Fabien Potencier
ac19b206c4 merged branch adrienbrault/2.0 (PR #3386)
Commits
-------

ae8704c [Console] Fix wrong ref in phpdoc

Discussion
----------

[Console] Fix wrong ref in phpdoc

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

Hey guys, found that typo.
2012-02-17 08:19:13 +01:00
Adrien BRAULT
ae8704cdce [Console] Fix wrong ref in phpdoc 2012-02-16 22:26:30 +01:00
Fabien Potencier
54e6516d46 merged branch kriswallsmith/monolog/missing-class (PR #3368)
Commits
-------

1cec4f5 [MonologBundle] added missing class to compile

Discussion
----------

[MonologBundle] added missing class to compile

`Symfony\Bridge\Monolog\Handler\DebugHandler` extends a class which was not being included in the compiled class file.

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

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

by stof at 2012-02-15T14:27:29Z

@kriswallsmith Can you send the same PR to the standalone repo for 2.1 ?

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

by kriswallsmith at 2012-02-15T14:30:05Z

Can I just commit to that repository directly? /ping @Seldaek

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

by stof at 2012-02-15T14:33:51Z

yeah indeed, you have the needed permissions, and the change is OK
2012-02-16 07:22:19 +01:00
Victor Berchet
651f4c5d2d [Routing] Added a missing property declaration 2012-02-16 07:03:32 +01:00
Kris Wallsmith
1cec4f5b22 [MonologBundle] added missing class to compile 2012-02-15 06:19:20 -08:00
Eugene Babushkin
2434552aa9 [Translation] Fixed fallback location if location is longer than three characters (possibly by mistake). 2012-02-15 00:04:44 +01:00
Fabien Potencier
b86e6db035 merged branch eriksencosta/ticket_2781 (PR #3350)
Commits
-------

beb4fc0 [WIP][Locale] StubIntlDateFormatter::parse was throwing exception instead of returning Boolean false like intl implementation
b61dff7 fixed CS

Discussion
----------

[WIP][Locale] StubIntlDateFormatter::parse was throwing exception instead of returning Boolean false like intl implementation

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![travis.ci](https://secure.travis-ci.org/eriksencosta/symfony.png?branch=ticket_2781)
Fixes the following tickets: #2781
Todo: A test fail in 32 bit environment, executed tests only with PHP 5.3.2 and ext-intl ICU 4.2 based

Failed test:

    1) Symfony\Tests\Component\Locale\Stub\StubIntlDateFormatterTest::testFormatWithDefaultTimezoneIntl
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'1969-12-31 21:00:00'
    +'1969-12-31 16:00:00'
2012-02-14 23:34:14 +01:00
Fabien Potencier
ec7fb0bdd6 [Routing] added a proper exception when a route pattern references the same variable more than once (closes #3344) 2012-02-14 11:41:45 +01:00
Eriksen Costa
beb4fc0899 [WIP][Locale] StubIntlDateFormatter::parse was throwing exception instead of returning Boolean false like intl implementation 2012-02-14 01:35:14 -02:00
Eriksen Costa
b61dff7e4e fixed CS 2012-02-14 00:49:04 -02:00
Fabien Potencier
802fe644fb merged branch stof/phpdoc (PR #3332)
Commits
-------

8e34f43 Fixed the phpdoc for the Response class

Discussion
----------

Fixed the phpdoc for the Response class

This adds the missing phpdoc for some return values.
2012-02-12 13:09:50 +01:00
Christophe Coevoet
8e34f43723 Fixed the phpdoc for the Response class 2012-02-12 02:04:15 +01:00
Fabien Potencier
9ac6918624 bumped Symfony version to 2.0.11-DEV 2012-02-06 12:35:18 +01:00
Fabien Potencier
7f97b60d50 update CONTRIBUTORS for 2.0.10 2012-02-06 10:49:11 +01:00
Fabien Potencier
011b09ad1d updated VERSION for 2.0.10 2012-02-06 10:25:56 +01:00
Fabien Potencier
af46ea53c6 updated CHANGELOG for 2.0.10 2012-02-06 10:20:07 +01:00
Fabien Potencier
d134776d93 updated vendors for 2.0.10 2012-02-06 10:11:49 +01:00
Fabien Potencier
c9e87491b4 merged branch stof/unescape_paramaters (PR #3260)
Commits
-------

a7b48c0 Renamed the method
8e13095 Fixed the unescaping of parameters to handle arrays
045f936 Changed the testcase to expect the unescaping only after the resolution
a1b6d4c Added a failing testcase for escaped % in array parameters

Discussion
----------

Unescape paramaters

This fixes the unescaping of % in parameters when it is used in an array.

It is a replacement for @lsmith77's work done in #3241 but with a working fix this time :)
2012-02-04 07:58:12 +01:00
Christophe Coevoet
a7b48c058b Renamed the method 2012-02-02 18:59:53 +01:00
Christophe Coevoet
8e13095e5c Fixed the unescaping of parameters to handle arrays 2012-02-02 18:34:11 +01:00
Christophe Coevoet
045f936038 Changed the testcase to expect the unescaping only after the resolution
String values are not unescaped either in resolveValue() because it can
be called several times for the same parameter.
2012-02-02 18:34:05 +01:00
lsmith77
a1b6d4c46b Added a failing testcase for escaped % in array parameters 2012-02-02 18:33:55 +01:00
Fabien Potencier
9fa3201c11 removed unneeded code 2012-02-02 10:00:42 +01:00
Fabien Potencier
048fc2f6b9 merged branch ManuelKiessling/ticket_3124 (PR #3188)
Commits
-------

6090dee [FormType] Adopted MoneyTypeTest::testMoneyPatternWorksForYen to CS
e814d27 [FormType] Fixed broken MoneyType regexp for JPY

Discussion
----------

[Bugfix][Form] Fixed broken MoneyType regexp for JPY

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

The regexp in MoneyType doesn't work if currency format has no decimal
(like JPY) and doesn't work either if the currency symbol is unicode

This change fixes both issues and adds a unit test
2012-02-02 09:59:01 +01:00
Fabien Potencier
47598c6d94 merged branch beberlei/Doctrine2.2Compatibilty (PR #3202)
Commits
-------

c3f0ec7 Make DoctrineBundle fowards compatible with Doctrine 2.2

Discussion
----------

[DoctrineBundle] Doctrine 2.2 compatibilty

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

Doctrine 2.2 does not initialize reflection anymore when in a code-generation context. This fails with the Symfony Metadata Factory that acceses the ReflectionClass after checking that the entity class_exists. This occurs when using code-generation in combination with the annotation driver.

This PR fixes the problem.
2012-01-28 15:14:48 +01:00
Benjamin Eberlei
c3f0ec74a1 Make DoctrineBundle fowards compatible with Doctrine 2.2 2012-01-28 09:08:30 +01:00
Manuel Kiessling
6090deef90 [FormType] Adopted MoneyTypeTest::testMoneyPatternWorksForYen to CS 2012-01-26 15:43:25 +01:00
Manuel Kiessling
e814d273c2 [FormType] Fixed broken MoneyType regexp for JPY
The regexp in MoneyType doesn't work if currency format has no decimal
(like JPY) and doesn't work either if the currency symbol is unicode

This change fixes both issues and adds a unit test
2012-01-26 15:43:25 +01:00
Fabien Potencier
4ae41a56c4 merged branch Seldaek/esi_escape (PR #3185)
Commits
-------

7f96c8a [HttpKernel] Prevent php script execution in cached ESI pages using HttpCache

Discussion
----------

[HttpKernel] Escape php tags to avoid eval() injection in HttpCache
2012-01-25 16:03:50 +01:00
Jordi Boggiano
7f96c8ad17 [HttpKernel] Prevent php script execution in cached ESI pages using HttpCache 2012-01-24 19:27:21 +01:00
Gerard van Helden
7c338de412 changed docs as proposed in #3110 2012-01-22 10:13:52 +01:00