Commit Graph

17812 Commits

Author SHA1 Message Date
Fabien Potencier
94ffc4fab2 bug #11469 [BrowserKit] Fixed server HTTP_HOST port uri conversion (bcremer, fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

 [BrowserKit] Fixed server HTTP_HOST port uri conversion

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11356
| License       | MIT
| Doc PR        | n/a

See #11356

Commits
-------

103fd88 [BrowserKit] refactor code and fix unquoted regex
f401ab9 Fixed server HTTP_HOST port uri conversion
2014-07-25 08:30:34 +02:00
Fabien Potencier
103fd88b40 [BrowserKit] refactor code and fix unquoted regex 2014-07-25 07:47:26 +02:00
Benjamin Cremer
f401ab9032 Fixed server HTTP_HOST port uri conversion 2014-07-25 07:41:17 +02:00
Fabien Potencier
045cbc53cc bug #11425 Fix issue described in #11421 (Ben, ben-rosio)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix issue described in #11421

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11421
| License       | MIT
| Doc PR        | NA

This pull request fixes the issue described in #11421.  It also adds a test for the issue.  The issue is present in 2.0 forward, but I decided to fix it on the 2.3 branch so that I could also write a test for it (2.0 had no tests for the Process component, and 2.1 and 2.2 didn't have tests for the `ExecutableFinder` class).

Commits
-------

4cf50e8 Bring code into standard
9f4313c [Process] Add test to verify fix for issue #11421
02eb765 [Process] Fixes issue #11421
2014-07-25 07:28:54 +02:00
Fabien Potencier
f5bfa9bc9e bug #11423 Pass a Scope instance instead of a scope name when cloning a container in the GrahpvizDumper (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

Pass a Scope instance instead of a scope name when cloning a container in the GrahpvizDumper

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11055
| License       | MIT
| Doc PR        | -

Commits
-------

6787669 [DependencyInjection] Pass a Scope instance instead of a scope name.
2014-07-25 07:22:20 +02:00
Fabien Potencier
dde854d96a bug #11448 [MonologBridge] fixed Console handler priorities (fabpot)
This PR was merged into the 2.4 branch.

Discussion
----------

[MonologBridge] fixed Console handler priorities

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11432
| License       | MIT
| Doc PR        | n/a

alternative to symfony/symfony#11432

ping @Seldaek

Commits
-------

bdf874f [MonologBridge] fixed Console handler priorities
2014-07-25 07:02:35 +02:00
Fabien Potencier
d6bbf0448d minor #11462 [HttpFoundation] moved test file to the right directory (fabpot)
This PR was merged into the 2.5 branch.

Discussion
----------

[HttpFoundation] moved test file to the right directory

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

a260623 [HttpFoundation] moved test file to the right directory
2014-07-25 06:56:08 +02:00
Christian Flothmann
123fc62652 properly handle null data when denormalizing
If null is passed to denormalize(), no property values can be set on
the denormalized object. Additionally, this fixes passing values to
the denormalized object's constructor if the incoming data is an object.
2014-07-24 20:40:16 +02:00
Fabien Potencier
feb4f5cdb6 Merge branch '2.4' into 2.5
* 2.4:
  [Translator] Use quote to surround invalid locale
  Optimize assertLocale regexp
  [ExpressionLanguage] Fixed an issue with # characters in double quoted string literals
  Add some tweaks to the pt_BR translations
  [Validator] Backported #11410 to 2.3: Object initializers are called only once per object
  [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator
  [Process] Reduce I/O load on Windows platform
  [Form] Check if IntlDateFormatter constructor returned a valid object before using it

Conflicts:
	src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php
2014-07-24 19:01:56 +02:00
Fabien Potencier
b07a6b6201 Merge branch '2.3' into 2.4
* 2.3:
  [Translator] Use quote to surround invalid locale
  Optimize assertLocale regexp
  [Validator] Backported #11410 to 2.3: Object initializers are called only once per object
  [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator
  [Process] Reduce I/O load on Windows platform
  [Form] Check if IntlDateFormatter constructor returned a valid object before using it
2014-07-24 18:59:59 +02:00
Fabien Potencier
3177be50f8 minor #11464 [Translator] Use quote to surround invalid locale (lyrixx)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #11464).

Discussion
----------

[Translator] Use quote to surround invalid locale

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I got this message in one application (CLI):

```

  [InvalidArgumentException]
  Invalid locale: en_US .

```

It's not so easy to spot the issue.

Commits
-------

c9742ef [Translator] Use quote to surround invalid locale
2014-07-24 18:59:35 +02:00
Grégoire Pineau
c9742efe99 [Translator] Use quote to surround invalid locale 2014-07-24 18:59:28 +02:00
Bernhard Schussek
d6a783f989 [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls 2014-07-24 16:57:54 +02:00
Tobias Schultze
d6d462a8a7 [Validator] do not call getter inside ExecutionContext to prevent unnecessary calls 2014-07-24 16:44:45 +02:00
Bernhard Schussek
71897d7e35 [Validator] Fixed CS 2014-07-24 13:57:51 +02:00
Bernhard Schussek
cea4155d39 [Validator] Fixed date-to-string conversion tests to match ICU 51 2014-07-24 13:57:51 +02:00
Bernhard Schussek
5aa7e6dbe0 [Validator] Added "{{ value }}" parameters where they were missing 2014-07-24 13:57:51 +02:00
Bernhard Schussek
f3295522ef [Validator] Simplified and explained the LuhnValidator 2014-07-24 13:57:51 +02:00
Bernhard Schussek
bff09f210b [Validator] Simplified IssnValidator 2014-07-24 13:57:51 +02:00
Bernhard Schussek
224e70f709 [Validator] Fixed and simplified IsbnValidator 2014-07-24 13:57:51 +02:00
Bernhard Schussek
fd58870ac0 [Validator] Simplified IBAN validation algorithm 2014-07-24 13:57:51 +02:00
Bernhard Schussek
97243bcd02 [Validator] Fixed value-to-string conversion in constraint violations 2014-07-24 13:57:51 +02:00
Damián Nohales
75e8815566 [Validator] Fix constraint violation message parameterization 2014-07-24 13:57:51 +02:00
Fabien Potencier
a260623b18 [HttpFoundation] moved test file to the right directory 2014-07-24 12:44:07 +02:00
Bernhard Schussek
91bf2774a2 [Validator] Made sure that context changes don't leak out of (Contextual)ValidatorInterface 2014-07-24 12:18:38 +02:00
Fabien Potencier
2f7b702e3b bug #11454 [Validator] Fixed memory leak in ValidatorBuilder (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Fixed memory leak in ValidatorBuilder

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11236
| License       | MIT
| Doc PR        | -

In 23534ca6ab, the following code was introduced in `ValidatorBuilder::getValidator()`:

```php
AnnotationRegistry::registerLoader(function ($class) {
    if (0 === strpos($class, __NAMESPACE__.'\\Constraints\\')) {
        $file = str_replace(__NAMESPACE__.'\\Constraints\\', __DIR__.'/Constraints/', $class).'.php';

        if (is_file($file)) {
            require_once $file;

            return true;
        }
    }

    return false;
});
```

`AnnotationRegistry::registerLoader()` stores all loaders in a global array. Every time that `getValidator()` is called, a new closure is put onto the loader stack, referencing `$this` (i.e. the ValidatorBuilder) and consequently preventing the ValidatorBuilder (and its references) from being garbage-collected.

The call to `registerLoader()` did not exist in 2.4 and I can't find a reason why it should be there. All tests are green without that code. I suppose I used it for debugging and then forgot to remove it again, so I'm removing it here.

Commits
-------

283387a [Validator] Fixed memory leak in ValidatorBuilder
2014-07-23 21:03:58 +02:00
Bernhard Schussek
283387a4ec [Validator] Fixed memory leak in ValidatorBuilder 2014-07-23 18:40:39 +02:00
Fabien Potencier
4dbe0e1c34 bug #11120 [2.3][Process] Reduce I/O load on Windows platform (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Reduce I/O load on Windows platform

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT

When using file handles, no `stream_select` call is done.
On linux platforms, `stream_select` introduce a sleep as it has 0.2s timeout, there is no such pause on Windows, producing lot's of disk I/Os when reading file handles

Commits
-------

ff0bb01 [Process] Reduce I/O load on Windows platform
2014-07-23 17:11:31 +02:00
Fabien Potencier
3f5d4c55ba bug #11370 [FrameworkBundle] avoid raising unexpected RuntimeException when specifying $_SERVER['KERNEL_DIR'] (iteman)
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #11370).

Discussion
----------

[FrameworkBundle] avoid raising unexpected RuntimeException when specifying $_SERVER['KERNEL_DIR']

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Since v2.5.0 (exactly e778cf19cd), all tests that use WebTestCase are to be errors "RuntimeException: Unable to guess the Kernel directory." even though $_SERVER['KERNEL_DIR'] is specified. This has been preventing another test runner (e.g. [MakeGood](https://github.com/piece/makegood)) from running tests for a Symfony application without overriding KernelTestCase::getPhpUnitXmlDir() as follows.

The bootstrap file for testing in the app directory:

```php
<?php
...
$_SERVER['KERNEL_DIR'] = __DIR__;
require_once dirname(__DIR__) . '/var/bootstrap.php.cache';
```

console output:

```console
PHPUnit 4.1.3 by Sebastian Bergmann.

EE

Acme\DemoBundle\Tests\Controller\DemoController
 [ ] Index
 [ ] Secure section

Time: 146 ms, Memory: 9.50Mb

There were 2 errors:

1) Acme\DemoBundle\Tests\Controller\DemoControllerTest::testIndex
RuntimeException: Unable to guess the Kernel directory.

/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:56
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:103
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:156
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:137
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:33
/path/to/symfony-application/src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php:11
/path/to/eclipse/plugins/com.piece_framework.makegood.stagehandtestrunner_3.1.0.v201407050319/resources/php/vendor/piece/stagehand-testrunner/src/Runner/PHPUnitRunner.php:81
/path/to/eclipse/plugins/com.piece_framework.makegood.stagehandtestrunner_3.1.0.v201407050319/resources/php/vendor/piece/stagehand-testrunner/src/Process/TestRunner.php:100
/path/to/eclipse/plugins/com.piece_framework.makegood.stagehandtestrunner_3.1.0.v201407050319/resources/php/vendor/piece/stagehand-testrunner/src/CLI/TestRunnerApplication/Command/PluginCommand.php:149
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:252
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:887
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:193
/path/to/symfony-application/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:124
...
```

Commits
-------

6f58674 [FrameworkBundle] changed KernelTestCase::getKernelClass() to check $_SERVER['KERNEL_DIR'] before invoking getPhpUnitXmlDir()
2014-07-23 17:01:18 +02:00
KUBO Atsuhiro
6f58674832 [FrameworkBundle] changed KernelTestCase::getKernelClass() to check $_SERVER['KERNEL_DIR'] before invoking getPhpUnitXmlDir() 2014-07-23 17:01:18 +02:00
Fabien Potencier
797d8141e3 bug #11342 [2.3][Form] Check if IntlDateFormatter constructor returned a valid object before using it (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Form] Check if IntlDateFormatter constructor returned a valid object before using it

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT

`IntlDateFormatter` constructor [may return false](http://www.php.net/manual/en/intldateformatter.create.php#refsect1-intldateformatter.create-returnvalues). This patches avoids fatal errors in these cases

This PR replaces #11334

Commits
-------

ebf967d [Form] Check if IntlDateFormatter constructor returned a valid object before using it
2014-07-23 16:33:41 +02:00
Fabien Potencier
bdf874f593 [MonologBridge] fixed Console handler priorities 2014-07-23 14:15:23 +02:00
Fabien Potencier
0032abd618 bug #11439 [ExpressionLanguage] Fixed double quoted string literals containing sharps (pylebecq)
This PR was merged into the 2.4 branch.

Discussion
----------

[ExpressionLanguage] Fixed double quoted string literals containing sharps

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11433
| License       | MIT
| Doc PR        | n/a

Commits
-------

0c2622e [ExpressionLanguage] Fixed an issue with # characters in double quoted string literals
2014-07-23 10:01:19 +02:00
Fabien Potencier
0b5348ea3a minor #11441 [Translator] Optimize assertLocale regexp (Jérémy Derussé)
This PR was merged into the 2.3 branch.

Discussion
----------

[Translator] Optimize assertLocale regexp

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Optimize regexp by remove unused variable and using anchored regex.
Thanks @Tobion

Commits
-------

537c39b Optimize assertLocale regexp
2014-07-23 09:58:41 +02:00
Jérémy Derussé
537c39b11e Optimize assertLocale regexp 2014-07-22 23:54:07 +02:00
Pierre-Yves LEBECQ
0c2622e2e7 [ExpressionLanguage] Fixed an issue with # characters in double quoted string literals 2014-07-22 15:26:34 +02:00
Bernhard Schussek
4c97420fef bug #11410 [Validator] Fixed object initializers in 2.5 version of the Validator (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Fixed object initializers in 2.5 version of the Validator

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11159
| License       | MIT
| Doc PR        | -

Object initializers were forgot in the 2.5 Validator API. This PR implements them.

A bug was fixed also in the old version which resulted in the initializers being called multiple times if an object was validated in multiple groups within the same validation run. This fix will be backported separately to older versions.

Commits
-------

ce04073 [Validator] Fixed object initializers in 2.5 version of the Validator
2014-07-21 13:29:59 +02:00
Bernhard Schussek
ce04073b4e [Validator] Fixed object initializers in 2.5 version of the Validator 2014-07-21 10:57:43 +02:00
Ben
4cf50e8d30 Bring code into standard 2014-07-20 22:50:55 -06:00
Ben
9f4313cf6f [Process] Add test to verify fix for issue #11421 2014-07-19 17:48:53 -06:00
Ben
02eb765a9c [Process] Fixes issue #11421 2014-07-19 17:29:08 -06:00
Jakub Zalas
678766900b [DependencyInjection] Pass a Scope instance instead of a scope name. 2014-07-19 21:50:43 +01:00
Fabien Potencier
dfabc4a61a minor #11419 [Validator] Add some tweaks to the pt_BR translations (andreia)
This PR was submitted for the master branch but it was merged into the 2.4 branch instead (closes #11419).

Discussion
----------

[Validator] Add some tweaks to the pt_BR translations

| Q             | A
| ------------- | ---
| Bug fix?      | no]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

28424ee Add some tweaks to the pt_BR translations
2014-07-19 07:51:56 +02:00
Andreia Bohner
28424ee79d Add some tweaks to the pt_BR translations 2014-07-19 07:51:56 +02:00
Fabien Potencier
9572918064 bug #11411 [Validator] Backported #11410 to 2.3: Object initializers are called only once per object (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Backported #11410 to 2.3: Object initializers are called only once per object

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Before, object initializers were called multiple times if an object was validated in different groups in the same validation run. The initializers, however, are not aware of the current validation group, so calling them more than once does not make sense.

Now, object initializers are called exactly once per validated object.

See #11410

Commits
-------

291cbf9 [Validator] Backported #11410 to 2.3: Object initializers are called only once per object
2014-07-18 11:07:06 +02:00
Bernhard Schussek
291cbf9efa [Validator] Backported #11410 to 2.3: Object initializers are called only once per object 2014-07-18 10:20:25 +02:00
Fabien Potencier
efab88490e bug #11403 [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator (takeit)
This PR was squashed before being merged into the 2.3 branch (closes #11403).

Discussion
----------

[Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11396
| License       | MIT

Commits
-------

3176f8b [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator
2014-07-17 12:20:14 +02:00
Rafał Muszyński
3176f8bb98 [Translator][FrameworkBundle] Added @ to the list of allowed chars in Translator 2014-07-17 12:20:11 +02:00
Fabien Potencier
a9af6be54e Merge branch '2.4' into 2.5
* 2.4:
  [Process] Adjust PR #11264, make it Windows compatible and fix CS
  [Process] Fix unit tests on Windows platform
  bumped Symfony version to 2.4.9
  bumped Symfony version to 2.3.19
  updated VERSION for 2.4.8
  updated CHANGELOG for 2.4.8
  updated VERSION for 2.3.18
  update CONTRIBUTORS for 2.3.18
  updated CHANGELOG for 2.3.18
  [Process] Use correct test for empty string in UnixPipes

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2014-07-16 15:13:02 +02:00
Fabien Potencier
2797df89b8 Merge branch '2.3' into 2.4
* 2.3:
  [Process] Adjust PR #11264, make it Windows compatible and fix CS
  [Process] Fix unit tests on Windows platform
  bumped Symfony version to 2.3.19
  updated VERSION for 2.3.18
  update CONTRIBUTORS for 2.3.18
  updated CHANGELOG for 2.3.18
  [Process] Use correct test for empty string in UnixPipes

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Process/Tests/AbstractProcessTest.php
2014-07-16 15:12:41 +02:00