Commit Graph

19918 Commits

Author SHA1 Message Date
Fabien Potencier e756135f64 feature #12960 [FrameworkBundle] Container parameters in Route#condition (nikita2206)
This PR was squashed before being merged into the 2.7 branch (closes #12960).

Discussion
----------

[FrameworkBundle] Container parameters in Route#condition

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

Adds ability to use parameters in route conditions like you can use them in container definitions:

```php
contact:
    path:     /contact
    defaults: { _controller: AcmeDemoBundle:Main:contact }
    condition: "request.headers.get('User-Agent') matches '%allowed_user_agents%'"
```

As you could see replacement of the placeholder happens before ExpressionLanguage will tokenize and compile the expression so it looks kinda ad-hoc and primitive. This means a BC break for us, because some of conditions out there that had percentage symbol might be invalid now, f.e.: `10%var_name%2`- without the patch this will be currently compiled to `10 % $var_name % 2`, with the patch it will try to replace `%var_name%` with a parameter. The same goes for percentage symbols inside string literals.

This PR is a different implementation of #12869 which is I think is too overcomplicated for this feature.

Commits
-------

505e474 [FrameworkBundle] Container parameters in Route#condition
2015-01-16 23:05:28 +01:00
nikita2206 505e474dee [FrameworkBundle] Container parameters in Route#condition 2015-01-16 23:03:48 +01:00
Fabien Potencier 245c5147e0 minor #13397 [2.7] Added deprecated in debug command (saro0h)
This PR was squashed before being merged into the 2.7 branch (closes #13397).

Discussion
----------

[2.7] Added deprecated in debug command

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

Commits
-------

31aad0f [2.7] Added deprecated in debug command
2015-01-16 22:25:23 +01:00
sarah khalil 31aad0f117 [2.7] Added deprecated in debug command 2015-01-16 22:25:19 +01:00
Fabien Potencier ec1cae8b14 minor #13431 [Form] Improved exception message if the data class is not found (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Improved exception message if the data class is not found

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

Commits
-------

4145836 [Form] Improved exception message if the data class is not found
2015-01-16 22:23:29 +01:00
Fabien Potencier 564ae34dd7 minor #13434 fixed some deprecated notices (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed some deprecated notices

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

Commits
-------

84f3753 fixed some deprecated notices
2015-01-16 22:22:25 +01:00
Fabien Potencier df76faaa39 minor #13435 [Validator] fixed remaining notice (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] fixed remaining notice

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

Commits
-------

5fcfd1b [Validator] fixed some legacy tests
f187d9a [Validator] fixed remaining notice
2015-01-16 22:20:59 +01:00
Fabien Potencier f0a185d6a6 minor #13406 [2.7] [FrameworkBundle] remove usage of deprecated Definition::setFactoryClass(), Definition::setFactoryService() and Definition::setFactoryMethod() methods. (hhamon)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] [FrameworkBundle] remove usage of deprecated Definition::setFactoryClass(), Definition::setFactoryService() and Definition::setFactoryMethod() methods.

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

Commits
-------

fbcc574 [FrameworkBundle] remove usage of deprecated Definition::setFactoryClass(), Definition::setFactoryService() and Definition::setFactoryMethod() methods.
2015-01-16 22:19:27 +01:00
Hugo Hamon fbcc574c8c [FrameworkBundle] remove usage of deprecated Definition::setFactoryClass(), Definition::setFactoryService() and Definition::setFactoryMethod() methods. 2015-01-16 19:49:13 +01:00
Fabien Potencier 84f3753b33 fixed some deprecated notices 2015-01-16 19:08:37 +01:00
Fabien Potencier 5fcfd1b9f6 [Validator] fixed some legacy tests 2015-01-16 18:23:24 +01:00
Fabien Potencier f187d9aa1c [Validator] fixed remaining notice 2015-01-16 18:12:38 +01:00
Fabien Potencier 7fdb07b206 minor #13430 [Yaml] execute cheaper checks before more expensive ones (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] execute cheaper checks before more expensive ones

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

Minor improvements to the checks as suggested by @stof in #13262.

Commits
-------

cd4349d execute cheaper checks before more expensive ones
2015-01-16 17:22:21 +01:00
Fabien Potencier 414583607c [Form] Improved exception message if the data class is not found 2015-01-16 16:35:59 +01:00
Fabien Potencier 56f315495c bug #13332 [Console] ArgvInput and empty tokens (Taluu)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #13332).

Discussion
----------

[Console] ArgvInput and empty tokens

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

If an empty token is provided (from automated tools, or on purpose when running a command), the argument getter was not checking the other tokens, as '' == false in php, which is the stop condition of the while loop in this method.

This method should now rely on the count of tokens rather than on the value of the return of `array_shift`

If the fix is removed on the ArgvInput, the test `testGetParameterOptionEqualSign` should fail, as it shows why this fix is needed (last line of its provider `provideGetParameterOptionValues`)

This is relevant on 2.4+, but as 2.4 has stopped expecting bug fixes since july 2014, I based this PR on 2.5+. So this should be merged in 2.5, 2.6, 2.7 and possibly on master. This should also be cherry-pickable on 2.3 (as it is the current LTS)

Commits
-------

afa1e20 Fixes ArgvInput's argument getter with empty tokens
2015-01-16 16:21:58 +01:00
Baptiste Clavié afa1e2079d Fixes ArgvInput's argument getter with empty tokens
If an empty token is provided (from automated tools, or on purpose when
running a command), the argument getter was not checking the other
tokens, as '' == false in php, which is the stop condition of the while
loop in this method.

This method should now rely on the count of tokens rather than the value
of the return of array_shift
2015-01-16 16:21:58 +01:00
Fabien Potencier 820b973dab bug #13353 [DependencyInjection] Fix missing ExpressionLanguageProviders (szicsu)
This PR was merged into the 2.6 branch.

Discussion
----------

[DependencyInjection] Fix missing ExpressionLanguageProviders

Fix missing ExpressionLanguageProviders extension bild

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

Commits
-------

b248368 [DependencyInjection] Fix missing ExpressionLanguageProviders on extension bild
2015-01-16 16:13:39 +01:00
Fabien Potencier da9d88d8c5 feature #13418 [DX] Attempt to improve logging messages with parameters (iltar)
This PR was squashed before being merged into the 2.7 branch (closes #13418).

Discussion
----------

[DX] Attempt to improve logging messages with  parameters

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/12594#issuecomment-68589400
| License       | MIT
| Doc PR        | n/a

This PR is a follow-up of #12594 `[DX] [HttpKernel] Use "context" argument when logging route in RouterListener`.

I have attempted to improve the log messages, as well as updating the usage context. I wasn't sure if the log messages should end with a `.` or not, if so I can update all messages to confirm a standard.

Commits
-------

ea80c9b [DX] Attempt to improve logging messages with  parameters
2015-01-16 16:11:56 +01:00
Iltar van der Berg ea80c9b4c2 [DX] Attempt to improve logging messages with parameters 2015-01-16 16:11:12 +01:00
Christian Flothmann cd4349df50 execute cheaper checks before more expensive ones 2015-01-16 15:59:09 +01:00
Fabien Potencier 8936c33afd Merge branch '2.6' into 2.7
* 2.6:
  fixed tests
  [EventDispatcher] Add missing checks to RegisterListenersPass
  Inline private 'is quoting required' methods in Escaper
  [Debug] fix loading order for legacy classes
  Add comment as requested
  Remove duplicate 'require'
  [Yaml] Improve YAML boolean escaping
2015-01-16 15:55:54 +01:00
Fabien Potencier 39520c0cdd Merge branch '2.5' into 2.6
* 2.5:
  fixed tests
  [EventDispatcher] Add missing checks to RegisterListenersPass
  Inline private 'is quoting required' methods in Escaper
  [Debug] fix loading order for legacy classes
  Add comment as requested
  Remove duplicate 'require'
  [Yaml] Improve YAML boolean escaping

Conflicts:
	src/Symfony/Component/Yaml/Tests/InlineTest.php
2015-01-16 15:55:47 +01:00
Fabien Potencier 99a627a040 Merge branch '2.3' into 2.5
* 2.3:
  fixed tests
  [EventDispatcher] Add missing checks to RegisterListenersPass
  Inline private 'is quoting required' methods in Escaper
  [Debug] fix loading order for legacy classes
  Add comment as requested
  Remove duplicate 'require'
  [Yaml] Improve YAML boolean escaping

Conflicts:
	src/Symfony/Component/Debug/Exception/FatalErrorException.php
	src/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php
2015-01-16 15:51:58 +01:00
Fabien Potencier b08115bd63 fixed tests 2015-01-16 15:49:28 +01:00
Fabien Potencier 8a870c24a6 bug #13293 [EventDispatcher] Add missing checks to RegisterListenersPass (znerol)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #13293).

Discussion
----------

[EventDispatcher] Add missing checks to RegisterListenersPass

* Support services using a parameter for their class name.
* Prevent abstract services as event subscribers.

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

Commits
-------

0a50b63 [EventDispatcher] Add missing checks to RegisterListenersPass
2015-01-16 15:48:26 +01:00
Lorenz Schori 0a50b63da1 [EventDispatcher] Add missing checks to RegisterListenersPass
* Support services using a parameter for their class name.
* Prevent abstract services as event subscribers.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
2015-01-16 15:48:25 +01:00
Fabien Potencier 98b06f6a95 minor #13429 removed notices for some constants as it does not work well (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

removed notices for some constants as it does not work well

| 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
-------

ee42544 removed notices for some constants as it does not work well
2015-01-16 15:37:20 +01:00
Fabien Potencier 689cf99c4e bug #13262 [Yaml] Improve YAML boolean escaping (petert82, larowlan)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] Improve YAML boolean escaping

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

This PR ensures that PHP [values which would be interpreted as booleans][1] in older versions of the YAML spec are escaped with single quotes when dumped by the Dumper.

For example, dumping this:

```php
array(
    'country_code' => 'no',
    'speaks_norwegian' => 'y',
    'heating' => 'on',
)
```

Will produce this YAML:

```yaml
country_code: 'no'
speaks_norwegian: 'y'
heating: 'on'
```

[1]: http://yaml.org/type/bool.html

Commits
-------

8fa056b Inline private 'is quoting required' methods in Escaper
afe827a Merge pull request #2 from larowlan/patch-2
a0ec0fe Add comment as requested
1e0633e Merge pull request #1 from larowlan/patch-1
81a8090 Remove duplicate 'require'
3760e67 [Yaml] Improve YAML boolean escaping
2015-01-16 14:53:48 +01:00
pthompson 8fa056bc95 Inline private 'is quoting required' methods in Escaper 2015-01-16 14:15:13 +01:00
Fabien Potencier e52daa3bd9 feature #13320 [HttpKernel][2.7] Add request uri to Logger context (Rvanlaak)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel][2.7] Add request uri to Logger context

... so host info does not get lost in the logging. The current situation does not allow the user, that receives a `Monolog` email for instance, to determine at which host an error occurred.

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

Commits
-------

c8f1f19 [HttpKernel] Add request uri to Logger context
2015-01-16 13:41:12 +01:00
Richard van Laak c8f1f192b5 [HttpKernel] Add request uri to Logger context
... so host info does not get lost in the logging. The current situation does not allow the user to determine at which host an error occured.

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

Fixed typo

Distinguish route-params from request-uri

Update context consistency

... and inline the context variable.

Rename `route_params` to `route_parameters`
2015-01-16 12:27:55 +01:00
Fabien Potencier ee42544124 removed notices for some constants as it does not work well 2015-01-16 11:48:14 +01:00
Peter Rehm 3d43caef88 Deprecated setDefaultOptions() in favor of configureOptions() 2015-01-16 10:30:42 +01:00
Fabien Potencier 62f3a29dd0 bug #13420 [Debug] fix loading order for legacy classes (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Debug] fix loading order for legacy classes

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

Looks like declaration order is important.

Commits
-------

cb34789 [Debug] fix loading order for legacy classes
2015-01-16 07:29:20 +01:00
Nicolas Grekas cb347896b2 [Debug] fix loading order for legacy classes 2015-01-15 13:58:08 +01:00
Fabien Potencier d752f74161 Merge branch '2.6' into 2.7
* 2.6:
  [FrameworkBundle] fix routing descriptor for options
  exit when Twig environment is not set
  [Routing] fix misleading test for condition
  [Debug] fix test
  [Debug] add missing conflict dep rules
  [TwigBundle] allowed SecurityBundle to use the latest versions of FrameworkBundle
  [HttpFoundation] Make use of isEmpty() method
  fix missing comma in YamlDumper
  [VarDumper] fix very special vars handling
  [Console] Helper\Table->addRow optimization
  [Console] Helper\Table->addRow optimization

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md
	src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md
2015-01-15 13:16:13 +01:00
Fabien Potencier e87d4f7110 Merge branch '2.5' into 2.6
* 2.5:
  [FrameworkBundle] fix routing descriptor for options
  exit when Twig environment is not set
  [Routing] fix misleading test for condition
2015-01-15 13:15:12 +01:00
Fabien Potencier b53ceb1fb6 bug #13421 [FrameworkBundle] fix routing descriptor for options (Tobion)
This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] fix routing descriptor for options

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

The markdown descriptor for routes missed brackets, so that the `options` where actually ignored. Also fixed some other inconsistencies.

Commits
-------

b0c29a0 [FrameworkBundle] fix routing descriptor for options
2015-01-15 13:14:56 +01:00
Tobias Schultze b0c29a0c18 [FrameworkBundle] fix routing descriptor for options 2015-01-15 12:18:50 +01:00
Fabien Potencier 8d12652162 feature #13401 [TwigBundle] use the new Twig autoescaping strategy (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] use the new Twig autoescaping strategy

| 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
-------

55c4b41 [TwigBundle] use the new Twig autoescaping strategy
2015-01-14 11:54:20 +01:00
Fabien Potencier 8d07449414 bug #13405 [TwigBridge] exit when Twig environment is not set in the LintCommand (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

[TwigBridge] exit when Twig environment is not set in the LintCommand

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

The `LintCommand` from the TwigBridge requires the `Twig_Environment`
to be set. Thus, if the `setTwigEnvironment()` were not called, the
command execution would have been aborted with a PHP error.

Commits
-------

05a4602 exit when Twig environment is not set
2015-01-14 10:26:36 +01:00
Fabien Potencier 52e18c51ed bug #13403 [TwigBridge] exit when Twig environment is not set in the DebugCommand (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBridge] exit when Twig environment is not set in the DebugCommand

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

The `DebugCommand` from the TwigBridge requires the `Twig_Environment`
to be set. Thus, if the `setTwigEnvironment()` were not called, the
command execution would have been aborted with a PHP error.

Commits
-------

1cfc1b7 exit when Twig environment is not set
2015-01-14 10:26:03 +01:00
Fabien Potencier 2195235c4c minor #13408 [TwigBundle] added some missing deprecation notices (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] added some missing deprecation notices

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

Commits
-------

ec6793c [TwigBundle] added some missing deprecation notices
2015-01-14 10:25:30 +01:00
Fabien Potencier ec6793ca72 [TwigBundle] added some missing deprecation notices 2015-01-14 07:07:14 +01:00
Fabien Potencier 55c4b41c29 [TwigBundle] use the new Twig autoescaping strategy 2015-01-14 06:59:05 +01:00
Fabien Potencier 98243180df minor #13402 [HttpKernel] fixed missing use cases (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] fixed missing use cases

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

Commits
-------

969c5d9 [HttpKernel] fixed missing use cases
2015-01-14 06:58:16 +01:00
Fabien Potencier 59270de161 minor #13392 moved AppVariable to the bridge (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

moved AppVariable to the bridge

| 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
-------

293765a moved AppVariable to the bridge
2015-01-14 06:56:32 +01:00
Christian Flothmann 05a4602450 exit when Twig environment is not set
The `LintCommand` from the TwigBridge requires the `Twig_Environment`
to be set. Thus, if the `setTwigEnvironment()` were not called, the
command execution would have been aborted with a PHP error.
2015-01-13 20:56:15 +01:00
Christian Flothmann 1cfc1b7fe7 exit when Twig environment is not set
The `DebugCommand` from the TwigBridge requires the `Twig_Environment`
to be set. Thus, if the `setTwigEnvironment()` were not called, the
command execution would have been aborted with a PHP error.
2015-01-13 20:54:23 +01:00
Fabien Potencier 969c5d92b3 [HttpKernel] fixed missing use cases 2015-01-13 18:52:06 +01:00