Commit Graph

12558 Commits

Author SHA1 Message Date
Fabien Potencier eb3eaf6f5b merged branch fabpot/console-5935 (PR #6523)
This PR was merged into the 2.0 branch.

Commits
-------

2fc41a1 [Console] fixed unitialized properties (closes #5935)

Discussion
----------

[Console] fixed unitialized properties (closes #5935)
2013-01-02 10:32:01 +01:00
Fabien Potencier 13f0a807b1 merged branch dbu/2.1-requestmatcher-httputils (PR #6470)
This PR was merged into the 2.1 branch.

Commits
-------

bfccd28 HttpUtils must handle RequestMatcher too

Discussion
----------

HttpUtils must handle RequestMatcher too

2.1 introduced the RequestMatcher as alternative to UrlMatcher. but HttpUtils was not adjusted.

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

by lsmith77 at 2013-01-01T18:15:13Z

@fabpot could you have a look at this PR? would like to know if this will be addressed in core or if we need to find another solution inside the CMF routing.
2013-01-02 10:30:52 +01:00
Tammy D c282a2bf15 [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets. 2012-12-31 09:26:26 -08:00
Fabien Potencier 2fc41a1ac8 [Console] fixed unitialized properties (closes #5935) 2012-12-30 21:29:27 +01:00
Fabien Potencier bf468ca0e6 merged branch jakzal/process-test-fix (PR #6520)
This PR was merged into the 2.1 branch.

Commits
-------

a5aeb21 [Process] Prevented test from failing when pcntl extension is not enabled.

Discussion
----------

[Process] Prevented test from failing when pcntl extension is not enabled

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

*SIGTERM* constant is only defined if pcntl extension is present. Extension is not needed to use the Process component though.
2012-12-30 16:37:53 +01:00
Jakub Zalas a5aeb21b84 [Process] Prevented test from failing when pcntl extension is not enabled.
SIGTERM constant is only defined if pcntl extension is present. Extension is not needed to use the Process component though.
2012-12-30 13:18:39 +01:00
Fabien Potencier 477ddfb44d merged branch jakzal/stub-tests (PR #6515)
This PR was merged into the 2.1 branch.

Commits
-------

ef6f241 [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.

Discussion
----------

[Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no but for other reason in an another component
Fixes the following tickets: #5517
Todo: -
License of the code: MIT
Documentation PR: -

Symbol for Brazilian Real is BR$ only in ICU 4.8. All previous and later versions use R$.

Links to the relevant data files:
* http://source.icu-project.org/repos/icu/icu/tags/release-4-8/source/data/curr/en.txt
* http://source.icu-project.org/repos/icu/icu/tags/release-4-4/source/data/curr/en.txt
* http://source.icu-project.org/repos/icu/icu/tags/release-49-1/source/data/curr/en.txt

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

by jakzal at 2012-12-29T19:23:25Z

Note that currently *USE_ICU_DATA_VERSION* is required for some tests to pass. This is inconsistent with *Locale::getIcuDataVersion()* which returns *Locale::ICU_DATA_VERSION* if *USE_ICU_DATA_VERSION* is not set. Technically intl extension shouldn't be needed to run the stub tests.

Following code could fix the issue for StubLocale tests:

```php
class StubLocaleTest extends LocaleTestCase
{
    // ...
    protected function getIntlExtensionIcuVersion()
    {
        // Locale::getIcuDataVersion(), which is used to determine the directory of stubs,
        // uses Locale::ICU_DATA_VERSION if USE_INTL_ICU_DATA_VERSION is not given
        if (!getenv('USE_INTL_ICU_DATA_VERSION')) {
            return Locale::ICU_DATA_VERSION;
        }

        return parent::getIntlExtensionIcuVersion();
    }
}
```

This code cannot be placed in the LocaleTestCase as intl tests need the icu data version from the intl extension.

I'm not sure if this is desired and therefore I didn't include it in my PR. Let me know your thoughts and wether I should create another PR for this, use the current PR or forget about it.
2012-12-29 23:37:16 +01:00
Fabien Potencier f4f2ba8e40 merged branch jakzal/form-tests-fix (PR #6517)
This PR was merged into the 2.1 branch.

Commits
-------

81967f6 [Form] Fixed failing tests for DateTimeToStringTransformer.

Discussion
----------

[Form] Fixed failing tests for DateTimeToStringTransformer

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

Tests were only failing at the end of the month. Since February was used in the test cases, date was being moved to the next month (February has less days than other months).

If a day is not passed, \DateTime's constructor will set it to the first day of the month:

```php
var_dump(new \DateTime('2010-02'));

object(DateTime)#1 (3) {
  ["date"]=>
  string(19) "2010-02-01 00:00:00"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(13) "Europe/London"
}
```
\DateTime is used in the test assertions.

However, DateTimeToStringTransformer::reverseTransform() uses \DateTime::createFromFormat(), which sets a missing day to the current day:

```php
var_dump(\DateTime::createFromFormat("Y-m", '2010-02'));

object(DateTime)#1 (3) {
  ["date"]=>
  string(19) "2010-03-01 20:09:26"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(13) "Europe/London"
}
```

I changed the date in the test case to avoid failures. If we need to be sure that month's not going to be changed, I'll update my PR.
2012-12-29 23:36:52 +01:00
Fabien Potencier 1d395ad16d Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
This reverts commit b604eb7b52.

Conflicts:
	src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php
2012-12-29 23:35:33 +01:00
Fabien Potencier ef0497441e merged branch jamogon/patch-3 (PR #6511)
This PR was merged into the master branch.

Commits
-------

5779262 Update src/Symfony/Component/HttpFoundation/Request.php

Discussion
----------

Update src/Symfony/Component/HttpFoundation/Request.php

[HttpFoundation][Request] Align const
2012-12-29 21:09:24 +01:00
Fabien Potencier 352eba385c merged branch hhamon/session_listener_typo (PR #6512)
This PR was merged into the 2.0 branch.

Commits
-------

a88607c [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.

Discussion
----------

[Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
2012-12-29 21:08:40 +01:00
Fabien Potencier ecb22de040 fixed CS 2012-12-29 21:07:36 +01:00
Fabien Potencier 11b0dae32d merged branch ircmaxell/master (PR #6510)
This PR was merged into the master branch.

Commits
-------

c543116 Improve timing safe comparison function

Discussion
----------

Improve timing safe comparison function in Security bundle to not leak length information.

Improve the timing safe comparison function to better handle cases where input is of different length.

Note that it is now important to always pass any string that the user can directly control to the second parameter of the function. Otherwise, length information may be leaked.

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

by ircmaxell at 2012-12-29T13:36:32Z

@apfelbox: No, for two reasons. First, you shouldn't be passing the password directly into this function (it should be hashed first).

Second, it depends only on the length of the user supplied input (the second parameter). So the execution time will vary, but 100% based on user input. No information about the stored string is leaked...

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

by apfelbox at 2012-12-29T14:09:54Z

@ircmaxell yes, I just thought about it for a while and you are right. The `strlen($knownString)` is a constant factor and therefore the  execution time of the function does not vary with it (especially if it is hashed).
2012-12-29 21:07:20 +01:00
Jakub Zalas 81967f6a70 [Form] Fixed failing tests for DateTimeToStringTransformer.
Tests were only failing at the end of the month. PHP uses current day if it is not passed. Since February was used in the test cases, date was being moved to the next month (February has less days than other months).
2012-12-29 20:41:42 +01:00
Jakub Zalas ef6f241bfe [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
Symbol for Brazilian Real is BR$ only in ICU 4.8. All previous and later versions use R$.

Links to the data files:
* http://source.icu-project.org/repos/icu/icu/tags/release-4-8/source/data/curr/en.txt
* http://source.icu-project.org/repos/icu/icu/tags/release-4-4/source/data/curr/en.txt
* http://source.icu-project.org/repos/icu/icu/tags/release-49-1/source/data/curr/en.txt
2012-12-29 20:05:26 +01:00
Hugo Hamon a88607c7ff [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener. 2012-12-29 15:12:58 +01:00
Javier Motos González 57792629ad Update src/Symfony/Component/HttpFoundation/Request.php
[HttpFoundation][Request] Align const
2012-12-29 14:43:44 +01:00
Anthony Ferrara c543116925 Improve timing safe comparison function
Improve the timing safe comparison function to better handle cases where input is of different length.

Note that it is now important to always pass any string that the user can directly control to the second parameter of the function. Otherwise, length information may be leaked.
2012-12-29 07:51:01 -05:00
Fabien Potencier 79148f3c86 Revert "merged branch ricardclau/rename_choice_to_oneof (PR #6360)"
This reverts commit 1de60c902c, reversing
changes made to e3cc337b00.

Conflicts:
	UPGRADE-2.2.md
2012-12-29 10:43:12 +01:00
Fabien Potencier 3778bf916e merged branch lmcd/kernelevents-constants (PR #6499)
This PR was merged into the master branch.

Commits
-------

d5948f1 Use KernelEvents constants in TraceableEventDispatcher

Discussion
----------

[HttpKernel] Use KernelEvents constants in TraceableEventDispatcher

Can't see any reason why we're not using constants here.
2012-12-29 00:07:33 +01:00
Fabien Potencier 9b71f30ade merged branch bschussek/issue6440 (PR #6505)
This PR was merged into the 2.1 branch.

Commits
-------

87dcf25 [Form] Fixed test regression introduced in #6440

Discussion
----------

[Form] Fixed test regression introduced in #6440

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
2012-12-28 23:58:46 +01:00
Fabien Potencier 3931131ebf merged branch drak/bc (PR #6422)
This PR was merged into the master branch.

Commits
-------

7533deb [Form] Prevent trigger of E_USER_DEPRECATED for new API

Discussion
----------

[Form] Prevent trigger of E_USER_DEPRECATED for new API

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

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

by stof at 2012-12-19T13:54:33Z

This is wrong as FormEvent extends DataEvent and so is also an instance.

Thus, DataEvent should never be constructed anymore (Sf2 does not instantiate it asnd there is no reason to dispatch it elsewhere). The BC is for typehints, and so the useful E_USER_DEPRECATED would be when DataEvent is used as typehint (which is not possible to detect AFAIK)

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

by drak at 2012-12-19T14:07:33Z

So in that case I should check specifically for two class names. Remember the intention here is to NOT trigger an error when the NEW class `FormEvent` is used. I'll update the PR.

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

by Tobion at 2012-12-19T14:25:42Z

I like the solution with an overridden constructor more because using the new stuff will not have the performance penalty of calling `get_class` at all.

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

by stof at 2012-12-19T14:52:47Z

@drak and why not simply ``if (!$this instanceof FormEvent)`` ?

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

by drak at 2012-12-19T15:58:28Z

@stof - if that's ok - I was just assuming other classes might have inherited.
@Tobion - the problem is the private name property we have to call parent which will ultimately call the deprecated constructor.

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

by drak at 2012-12-19T15:59:25Z

How about this?

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

by stof at 2012-12-19T16:51:26Z

@drak if your class inherit from DataEvent instead of FormEvent, it is logical to get a deprecation warning

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

by stof at 2012-12-19T16:52:50Z

@drak I think this allows removing some special error catching in a few places in Form tests (and also in the Form class if it was added)

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

by drak at 2012-12-19T17:33:51Z

@stof - yes, the whole idea is, if you inherit from FormEvent, no warning. anything else, gives warning - that's what we want right?

PR squashed and ready from my side.

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

by drak at 2012-12-20T14:00:13Z

ping @fabpot

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

by bschussek at 2012-12-28T15:19:40Z

👍
2012-12-28 23:57:58 +01:00
Fabien Potencier 87591482a9 merged branch francoispluchino/form-fix-deprecated-method (PR #6455)
This PR was merged into the master branch.

Commits
-------

16a196a [Form] Fix deprecated call method

Discussion
----------

[Form] Fix deprecated call method

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: -
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

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

by stof at 2012-12-21T13:21:50Z

This is wrong as the typehint of the constructor is still typehinting the old interface, and so this method is not available.

But the typehint should be changed to use the new interface anyway

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

by francoispluchino at 2012-12-26T09:11:49Z

@fabpot It's OK for you?
(The failure of the Travis test is caused  by the DateTime Form test only in PHP 5.3.3)

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

by bschussek at 2012-12-28T15:00:51Z

Can you please squash the commits?

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

by francoispluchino at 2012-12-28T15:57:47Z

@bschussek OK, it's done.
2012-12-28 23:56:58 +01:00
Fabien Potencier 598e6ee9ea merged branch tgalopin/patch-2 (PR #6507)
This PR was merged into the master branch.

Commits
-------

828eb90 Fix a tag name typo (</ësh> to </target>)

Discussion
----------

[Validator] Fix a tag name typo (</ësh> to </target>) in validators.sq.xlf

Replace </ësh> by </target> line 139.
2012-12-28 23:55:30 +01:00
Fabien Potencier 636c24e5a0 merged branch tgalopin/patch-1 (PR #6506)
This PR was merged into the master branch.

Commits
-------

d2a1e4e Update src/Symfony/Component/Validator/Resources/translations/validators.it.xlf

Discussion
----------

[Validator] Fix structure error in validators.it.xlf

Fix structure error in validators.it.xlf.

Probably a copy-cut that didn't work correctly.

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

by stof at 2012-12-28T17:04:17Z

I suspect a bad resolution of a merge conflict

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

by tgalopin at 2012-12-28T17:06:17Z

Indeed, probably.
2012-12-28 23:55:06 +01:00
Fabien Potencier 57ac683d35 merged branch fabpot/exception-logging (PR #6503)
This PR was merged into the master branch.

Commits
-------

0a42501 [HttpKernel] tweaked logging in the exception listener
1a6c9b3 [HttpKernel] refactored logging in the exception listener

Discussion
----------

[HttpKernel] refactored logging in the exception listener

* avoid code duplication
* allow easier overloading of the default behavior
2012-12-28 23:54:30 +01:00
Fabien Potencier 16702fcd24 merged branch fabpot/resource-tracking (PR #6501)
This PR was merged into the master branch.

Commits
-------

6cd1fd4 [DependencyInjection] removed hard dependency on the Config component

Discussion
----------

[DependencyInjection] removed hard dependency on the Config component

The Config component is a hard dependency for the loaders (but loaders
themselves are optional); all other classes should not have a hard dep
on Config. The introduction of a new flag allows to remove this
dependency.

This commit also fixes skipped test dependencies.

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

by fabpot at 2012-12-28T09:47:13Z

As there is only one location where we are directly using a class from the Config component (`ContainerBuilder::addObjectResource()`), we can also just test this case and do nothing if the class does not exist instead of adding a flag, but that looks dirty.

```php
public function addObjectResource($object)
{
    if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
        return $this;
    }

    $parent = new \ReflectionObject($object);
    do {
        $this->addResource(new FileResource($parent->getFileName()));
    } while ($parent = $parent->getParentClass());

    return $this;
}
```

What do you think?
2012-12-28 23:54:18 +01:00
Fabien Potencier fc43ae4514 merged branch fabpot/synthetic-services (PR #6500)
This PR was merged into the master branch.

Commits
-------

3cac604 [DependencyInjection] fixed setting a synthetic service on a frozen container

Discussion
----------

[DependencyInjection] fixed setting a synthetic service on a frozen container

By definition of a synthetic service, setting it on a frozen container should be possible.

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

by stof at 2012-12-28T08:44:44Z

This allows setting services which are not defined

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

by fabpot at 2012-12-28T08:49:29Z

@stof: right, thinking about it more, it is probably not a so good idea.

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

by fabpot at 2012-12-28T08:52:03Z

I've restricted the condition to only accept setting existing synthetic services. That should be ok.

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

by drak at 2012-12-28T19:10:23Z

This is a good enhancement but I would go further. It should still be possible to add parameters and definitions to the container after it's been compiled but not allow modification of existing services or parameters.
2012-12-28 23:53:14 +01:00
Titouan Galopin 828eb90fa6 Fix a tag name typo (</ësh> to </target>)
Replace </ësh> to </target> line 139.
2012-12-28 18:19:28 +01:00
Fabien Potencier 0a4250122f [HttpKernel] tweaked logging in the exception listener
When there is no logger, we should only log critical errors (this is
more sensible than the current behavior).
2012-12-28 18:08:28 +01:00
Titouan Galopin d2a1e4ef07 Update src/Symfony/Component/Validator/Resources/translations/validators.it.xlf
Fix structure error in validators.it.xlf
2012-12-28 18:01:45 +01:00
François Pluchino 16a196a6b2 [Form] Fix deprecated call method 2012-12-28 16:54:59 +01:00
Bernhard Schussek 87dcf25434 [Form] Fixed test regression introduced in #6440 2012-12-28 16:06:35 +01:00
Fabien Potencier 48920722f7 Revert "merged branch francisbesset/routing_constant_usage (PR #6449)"
This reverts commit c0e341c618, reversing
changes made to 35f5bca585.
2012-12-28 14:21:48 +01:00
Fabien Potencier 1a6c9b3143 [HttpKernel] refactored logging in the exception listener
* avoid code duplication
 * allow easier overloading of the default behavior
2012-12-28 13:40:07 +01:00
Fabien Potencier 6cd1fd4738 [DependencyInjection] removed hard dependency on the Config component
The Config component is a hard dependency for the loaders (but loaders
themselves are optional); all other classes should not have a hard dep
on Config. The introduction of a new flag allows to remove this
dependency.

This commit also fixes skipped test dependencies.
2012-12-28 11:06:10 +01:00
Fabien Potencier 3cac604352 [DependencyInjection] fixed setting a synthetic service on a frozen container 2012-12-28 10:00:21 +01:00
Fabien Potencier 277ababc82 merged branch franmomu/fix_test_namespaces (PR #6497)
This PR was merged into the 2.1 branch.

Commits
-------

a6704f3 [Tests] Fix namespaces

Discussion
----------

[Tests] Fix namespaces
2012-12-28 08:29:59 +01:00
Lee McDermott d5948f10a3 Use KernelEvents constants in TraceableEventDispatcher 2012-12-28 05:46:21 +00:00
Fran Moreno a6704f34f4 [Tests] Fix namespaces 2012-12-27 22:06:37 +01:00
Fabien Potencier a0ea84bbc3 merged branch havvg/feature/propel1-modelchoice-preferred (PR #6454)
This PR was merged into the 2.1 branch.

Commits
-------

05fca6d use preferred_choices in favor of preferred_query
6855cff add preferred_query option to ModelType

Discussion
----------

[Propel1] add preferred_choices option to ModelType

This enables the ModelChoiceList to use 'preferred_choices' of the parent ChoiceType.

Ping @willdurand

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

by willdurand at 2012-12-22T09:39:39Z

👍
2012-12-27 16:10:36 +01:00
Fabien Potencier c0e341c618 merged branch francisbesset/routing_constant_usage (PR #6449)
This PR was merged into the master branch.

Commits
-------

18daa10 [Routing] Used static to call constant in XmlFileLoader

Discussion
----------

[2.2][Routing] Used static to call constant in XmlFileLoader

It is more complicated to override XmlFileLoader if contants are called with `self`.
This PR replace `self` to `static`.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

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

by piotrpasich at 2012-12-21T08:17:14Z

+1
2012-12-27 16:08:42 +01:00
Fabien Potencier f66625d2d3 merged branch lyrixx/fix-eventdispatcher (PR #6487)
This PR was merged into the 2.1 branch.

Commits
-------

abf5e51 [EventDispatcher] Fixed php doc of GenericEvent::__construct

Discussion
----------

[EventDispatcher] Fixed php doc of GenericEvent::__construct

```
Bug fix: yes (doc)
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes (no modified)
Fixes the following tickets: -
Todo: -
License of the code: MIT
```

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

by drak at 2012-12-26T21:51:54Z

Well spotted.
2012-12-27 09:21:49 +01:00
Grégoire Pineau b444a10376 Fixed php doc of GenericEvent::__construct 2012-12-27 09:21:49 +01:00
Fabien Potencier 35f5bca585 [HttpKernel] fixed bundles var initialization 2012-12-27 09:14:47 +01:00
Fabien Potencier 761429e551 [HttpKernel] changed the value of route to the pattern when it is a Route object in the data collector
This allows to have a meaningful information in the WDT when the route
in the Request is not the route name but the route object (like in
Drupal for instance).
2012-12-26 09:59:46 +01:00
Francis Besset 18daa1017c [Routing] Used static to call constant in XmlFileLoader 2012-12-25 12:02:30 +01:00
Fabien Potencier 5096292111 merged branch hpatoio/master (PR #6477)
This PR was merged into the master branch.

Commits
-------

0fa7378 [Validator] Card validation - Italian translations

Discussion
----------

[Validator] Card validation - Italian translations

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no
2012-12-24 13:42:47 +01:00
Simone Fumagalli 0fa7378939 [Validator] Card validation - Italian translations 2012-12-24 12:04:32 +01:00
Fabien Potencier 439ae1ff21 merged branch excelwebzone/validator (PR #6476)
This PR was merged into the master branch.

Commits
-------

b32c37d Hebrew validator - added some missing validator keys

Discussion
----------

Hebrew validator - added some missing validator keys
2012-12-24 08:49:40 +01:00