Commit Graph

12430 Commits

Author SHA1 Message Date
Florin Patan
ef652e2d8f Added context to JsonEncoder 2013-01-05 16:36:09 +02:00
Benjamin Eberlei
eacb7e2a36 Rename $options to $context, as it makes the intent much more clear. 2013-01-04 20:06:05 +02:00
Benjamin Eberlei
8854b85abf Fix CS issues, removed global options 2013-01-04 20:06:04 +02:00
Benjamin Eberlei
9c54a4b552 [Serializer] Allow options to be passed to SerialiizerInterface#serialize and #unserialize. Thsee options are available to all encoders/decoders/normalizers that implement SerializerAwareInterface. 2013-01-04 20:06:04 +02:00
Fabien Potencier
31ff3db517 Merge branch '2.1'
* 2.1: (24 commits)
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Form] Fixed inheritance of "error_bubbling" in RepeatedType
  [Form] Fixed DateType when used with the intl extension disabled.
  [HttpFoundation] fix return types and handling of zero in Response
  [HttpFoundation] better fix for non-parseable Expires header date
  Fixed missing plural message in portuguese validator
  Fix Expires when the header is -1
  [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
  [Console] fixed unitialized properties (closes #5935)
  [Process] Prevented test from failing when pcntl extension is not enabled.
  Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
  [Form] Fixed failing tests for DateTimeToStringTransformer.
  [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  [Form] Fixed test regression introduced in #6440
  [Tests] Fix namespaces
  Fixed php doc of GenericEvent::__construct
  HttpUtils must handle RequestMatcher too
  use preferred_choices in favor of preferred_query
  ...

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
2013-01-04 18:02:19 +01:00
Fabien Potencier
8349816dc5 Merge branch '2.0' into 2.1
* 2.0:
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Console] fixed unitialized properties (closes #5935)
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  bumped Symfony version to 2.0.21-DEV
  updated VERSION for 2.0.21
  updated CHANGELOG for 2.0.21

Conflicts:
	src/Symfony/Bundle/SwiftmailerBundle/LICENSE
	src/Symfony/Component/Filesystem/LICENSE
	src/Symfony/Component/HttpFoundation/Response.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-01-04 18:00:54 +01:00
Fabien Potencier
df5c171490 updated license year 2013-01-04 17:59:43 +01:00
Fabien Potencier
18856428b6 updated license year 2013-01-04 17:58:00 +01:00
Fabien Potencier
7863f8890f merged branch lmcd/autocomplete (PR #6391)
This PR was squashed before being merged into the master branch (closes #6391).

Commits
-------

7bad0ef [Console] Add autocomplete as you type

Discussion
----------

[Console] Add autocomplete as you type

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

Finally got around to reviving the console autocomplete code.
Is now up to date with Symfony master. Also changed backspace behaviour to remove one character instead of two.

stty stuff is a mystery to a lot of people, so I've commented verbosely.

See also: https://github.com/symfony/symfony/pull/2364

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

by lmcd at 2012-12-17T10:11:16Z

@stof - updated with a better solution

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

by Seldaek at 2012-12-17T10:25:15Z

Seems pretty cool, but could you replace all `/usr/bin/env stty` calls by simply `stty`? That way it would also work on windows - if you have mingw or cygwin installed and stty is in the path at least. I don't see the benefit of doing the /usr/bin/env trick here. That's good for shebang lines because you need an absolute path, but in an exec/shell_exec call, you can rely on the PATH and just type the command name.

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

by lmcd at 2012-12-17T18:33:06Z

@Seldaek makes sense. Changed.

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

by lmcd at 2012-12-17T21:32:17Z

Tested on Mac OS X 10.8 and Ubuntu 12.04. Would be great to hear from people on Windows, cygwin and those with exotic terminal setups.

I'll update my fork of SensioGeneratorBundle a little later with support for this.

@fabpot - is there still time for this to land in 2.2?

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

by fabpot at 2012-12-17T21:34:23Z

If we have good feedback from Windows users, yes it can land in 2.2. ping @pborreli

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

by michelsalib at 2012-12-17T23:39:50Z

A am about to try on windows 7 with cmd, powershell and cygwin. Any other way to test without writing a new command using the helper ?

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

by michelsalib at 2012-12-18T00:01:42Z

I tried on Windows 7 with cmd, powershell and cygwin and got this error: `Le chemin d'accès spécifié est introuvable.`. You can translate it to `The specified path could not be found`.

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

by lmcd at 2012-12-18T00:01:43Z

I've updated SensioGeneratorBundle to support autocompletion on the `generate:doctrine:entity` command. It autocompletes bundle names, configuration formats and field types. See here: c627c67ce7

@michelsalib ping

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

by lmcd at 2012-12-18T00:03:43Z

@michelsalib - hmm. I imagine it's either a problem locating stty or some configuration issue on your end. Do you have file/line number?

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

by michelsalib at 2012-12-18T00:04:41Z

Verbose mode did not help. Let me try with some dirty line by line check to see if I can give you a line.

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

by michelsalib at 2012-12-18T00:09:54Z

My bad, I should have guessed that line 144 `exec('/usr/bin/env stty', $output, $exitcode);` cannot work on regular Windows environment. This should at least fails silently for users using cmd or powershell. Apparently cygwin users can activate stty. Let me investigate.

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

by michelsalib at 2012-12-18T00:16:30Z

Ok, cygwin comes pre-bundled with stty. I applied the fix recommended by @Seldaek and it fixed the cygwin command.
The only remaining problem is that your redirect the output of the exec call to the console, in this case cmd and powershell output the error telling that stty is not defined in the system: `'stty' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.`.

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

by lmcd at 2012-12-18T00:17:41Z

Ah, I see you're running the unit tests. The `hasSttyAvailable` method was lifted from `DialogHelper` where it is also used in `askHiddenResponse`. Question: is `defined('PHP_WINDOWS_VERSION_BUILD')` true for cygwin?

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

by michelsalib at 2012-12-18T00:22:14Z

I am not running test, I am actually running a homemade command:
```
$dialog = $this->getHelper('dialog');

$ask = $dialog->ask($output, 'Autocomplete example', null, array(
    'French', 'English', 'Chineese',
));

$output->writeln($ask);
```

`hasSttyAvailable` is called in the ask function at line 80. The incriminated function is here : 9ebcd4bac9/src/Symfony/Component/Console/Helper/DialogHelper.php (L411).

Also `defined('PHP_WINDOWS_VERSION_BUILD')` is true in the three of my consoles.

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

by lmcd at 2012-12-18T00:27:16Z

@michelsalib see 7be142481c

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

by michelsalib at 2012-12-18T00:28:20Z

Why keeping `/usr/bin/env` in your calls ? Cygwin cannot interpret it as long a stty is not in this folder.

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

by lmcd at 2012-12-18T00:29:30Z

@michelsalib `/usr/bin/env` was put there by someone else for the `askHiddenResponse` method. I can remove it, so long as it doesn't break something else.

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

by michelsalib at 2012-12-18T00:34:11Z

IMO users who want's to use stty should have it configured in the PATH, as @Seldaek said. Prefixing the folder where the stty "should" be is a nonsense to me. Moreover it might work well on *nix systems, but will never be compatible with cygwin.
I tested it locally (without the `/usr/bin/env` prefix) and now I have a nice autocomplete on Cygwin, and nothing on cmd or powershell. Which is just what I expected.

@lmcd very nice work :)

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

by lmcd at 2012-12-18T05:17:32Z

For anyone interested, you can scroll through available autocomplete options that match typed characters by using up and down arrow keys. This has been implemented in a seperate branch here: https://github.com/lmcd/symfony/tree/autocomplete-arrows

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

by drak at 2012-12-18T19:13:34Z

@lmcd - The console PRs never cease to amaze me. Really well done!

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

by fabpot at 2012-12-19T13:58:33Z

@lmcd Is it mergeable now?

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

by lmcd at 2012-12-19T17:59:09Z

@fabpot Yes.

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

by lmcd at 2012-12-19T20:03:31Z

Edit: commits squashed

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

by lmcd at 2012-12-19T21:29:07Z

@stloyd I have addressed the two things mentioned. I'm now using $i in place of strlen($ret) as it held the same value.

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

by fabpot at 2012-12-20T07:09:27Z

@lmcd: Thanks a lot for finishing this in time for 2.2. Before I can merge, there are two remaining tasks:

 * add a note about the new feature in the CHANGELOG file of the Console component;
 * create a PR on `symfony/symfony-docs` to explain the new feature.

Can you take care of that?

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

by lmcd at 2012-12-20T07:11:15Z

@fabpot sure

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

by stloyd at 2012-12-29T09:15:23Z

@lmcd You should squash your "merge" commit.

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

by lmcd at 2012-12-29T13:49:37Z

Well that screwed up. File Changed: 216 :S
Edit: hard reset to an earlier hash and reapplied the CHANGELOG commit. Should be good now ping @stloyd

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

by stloyd at 2012-12-29T14:33:58Z

@lmcd `ask()` method is quite long now, but in overall looks ok =)

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

by lmcd at 2013-01-02T20:49:49Z

Anything preventing this being merged? Ping @fabpot
2013-01-03 23:03:04 +01:00
Lee McDermott
7bad0ef691 [Console] Add autocomplete as you type 2013-01-03 23:03:04 +01:00
Fabien Potencier
66b5818cf9 merged branch jorgemaiden/patch-1 (PR #6525)
This PR was submitted for the master branch but it was merged into the 2.0 branch instead (closes #6525).

Commits
-------

0b5f1e3 Update src/Symfony/Component/HttpFoundation/Response.php

Discussion
----------

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

Fix phpdoc typo
2013-01-03 20:29:37 +01:00
Jorge Maiden
d337ad5133 Update src/Symfony/Component/HttpFoundation/Response.php 2013-01-03 20:29:37 +01:00
Fabien Potencier
6d3ed7a79a merged branch jakzal/finder-glob-support (PR #6531)
This PR was merged into the master branch.

Commits
-------

29b9611 [Finder] Added support for GLOB patterns in the directories passed to the in() method.

Discussion
----------

[Finder] Added support for wildcard characters (GLOB patterns)

Added support for wildcard characters in the paths passed to the *in()* method. Each pattern has to resolve to at least one directory, otherwise exception is thrown (just like when path to an invalid directory is passed).

Example usage:

```php
$finder = new \Symfony\Component\Finder\Finder();
$files = $finder->files()
    ->name('validators.en.*')
    ->in(array(
        'src/Symfony/*/*/Resources/translations',
    ));

foreach ($files as $file) {
    var_dump($file->getRealPath());
}
```

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5450
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#2089
2013-01-03 20:27:55 +01:00
Fabien Potencier
9153f1980d merged branch jakzal/date-type-fix (PR #6543)
This PR was merged into the 2.1 branch.

Commits
-------

6c5e615 [Form] Fixed DateType when used with the intl extension disabled.

Discussion
----------

[Form] Fixed DateType when used with the intl extension disabled

DateType's month select box returns timestamps when used with intl extension disabled (see #6485).

The reason for this is that stubbed formats use *L* instead of *M* for month representation. My fix is simply taking this into account when building array for the select box.

I didn't provide unit tests since they're disabled when intl extension is not enabled. I've only manually verified if the months array contains correct data.

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

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

by bschussek at 2013-01-03T17:41:47Z

Doesn't this call for fixing the stub instead of changing the Form component?

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

by stof at 2013-01-03T17:50:49Z

@bschussek L and M are both valid for the month in Intl

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

by jakzal at 2013-01-03T17:52:41Z

[StubIntlDateFormatter uses FullTransformer](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php#L206) to format the date. [FullTransformer supports both *L* and *M*](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php#L50) formats. Both formats are treated interchangeably.
2013-01-03 20:25:35 +01:00
Fabien Potencier
14be3e014d merged branch bschussek/issue5428 (PR #6545)
This PR was merged into the 2.1 branch.

Commits
-------

c526ad9 [Form] Fixed inheritance of "error_bubbling" in RepeatedType

Discussion
----------

[Form] Fixed inheritance of "error_bubbling" in RepeatedType

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: -
2013-01-03 20:23:22 +01:00
Bernhard Schussek
c526ad9db6 [Form] Fixed inheritance of "error_bubbling" in RepeatedType 2013-01-03 18:55:30 +01:00
Jakub Zalas
6c5e615c0b [Form] Fixed DateType when used with the intl extension disabled. 2013-01-03 18:07:53 +01:00
Fabien Potencier
173426674f [HttpFoundation] fixed fluent interface on BinaryFileResponse::prepare() (closes #6537) 2013-01-03 09:05:35 +01:00
Fabien Potencier
114bbce806 merged branch Tobion/expires-header (PR #6535)
This PR was merged into the 2.1 branch.

Commits
-------

10b01c9 [HttpFoundation] fix return types and handling of zero in Response
75952af [HttpFoundation] better fix for non-parseable Expires header date

Discussion
----------

[HttpFoundation] Response fixes

First commit is a better solution for #6471 and also fixes several phpdocs.
The second commit fixes the return types and handling of zero.

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

by Tobion at 2013-01-02T21:16:25Z

@dlsniper cc
2013-01-02 22:19:05 +01:00
Tobias Schultze
10b01c9159 [HttpFoundation] fix return types and handling of zero in Response 2013-01-02 22:06:26 +01:00
Tobias Schultze
75952af0c3 [HttpFoundation] better fix for non-parseable Expires header date
It also fixes several phpdocs
2013-01-02 22:03:29 +01:00
Fabien Potencier
25f970a6d7 merged branch andreabreu98/master (PR #6534)
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #6534).

Commits
-------

a5e7fdf Fixed missing plural message in portuguese validator

Discussion
----------

[Validator] Fixed missing plural message

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Fixes the following tickets: #6151
Todo: -
License of the code: -
Documentation PR: -
2013-01-02 16:51:07 +01:00
andreabreu98
ba5cd6ad2b Fixed missing plural message in portuguese validator 2013-01-02 16:51:06 +01:00
Fabien Potencier
d9a55ed8cf merged branch dlsniper/fix-expiry (PR #6471)
This PR was squashed before being merged into the 2.1 branch (closes #6471).

Commits
-------

87b6cc2 Fix Expires when the header is -1

Discussion
----------

Fix Expires when the header is -1

This fixes the issue described in #6469.

Let me know if I've missed something.

Thanks.

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

by blaugueux at 2012-12-27T20:22:23Z

@dlsniper how can i help here, i really need to fix this issue

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

by dlsniper at 2012-12-27T20:28:53Z

I think @fabpot needs to get me some feedback on this but meanwhile you should try the proposed patch and let me know if it fixes the problem for you or I should add more tests to this.

Thanks!

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

by blaugueux at 2012-12-30T14:37:58Z

@dlsniper your patch is working great for me but it breaks tests. I agree that @fabpot point of view is required.

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

by dlsniper at 2012-12-30T18:38:38Z

@blaugueux Can you let me know what tests are failing? the one included in this PR or some custom ones from you? If it's the later, can you share some so that I can add them?

Thanks!

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

by arendjantetteroo at 2013-01-02T12:45:48Z

The headerbag fix works here. I'm not sure if the extra check in Response is really necessary, it works here without it.
2013-01-02 14:34:47 +01:00
Florin Patan
87b6cc2e19 Fix Expires when the header is -1 2013-01-02 14:34:47 +01:00
Jakub Zalas
29b961107f [Finder] Added support for GLOB patterns in the directories passed to the in() method.
Pattern has to resolve to at least one directory, otherwise exception is thrown (just like when path to an invalid directory is passed).
2013-01-02 12:29:42 +01:00
Fabien Potencier
36627c4c3c merged branch tammyd/bugfix/memcache-port-0 (PR #6529)
This PR was merged into the 2.1 branch.

Commits
-------

c282a2b [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.

Discussion
----------

[DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.

[DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Fixes the following tickets: #6527
Todo: -
License of the code: MIT
Documentation PR: ~
2013-01-02 10:33:53 +01:00
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