Commit Graph

19807 Commits

Author SHA1 Message Date
Fabien Potencier
388ae55a4e feature #13342 [security] Fetching current stored context when not explicitly specified (jaytaph)
This PR was squashed before being merged into the 2.7 branch (closes #13342).

Discussion
----------

[security] Fetching current stored context when not explicitly specified

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

This patch will use the current stored context found in a token (provided, there is one), if none has been specified.

According to a quick scan of the code, this will be the only place where `getProviderKey()` is used outside a specific class (the authentication providers will check token type before calling `getProviderKey()`, but maybe it's be a good idea to implement a "providerKeyTokenInterface" or something. It's a nicer solution imho than the current `method_exists()`

Commits
-------

f6046ba [security] Fetching current stored context when not explicitly specified
2015-01-18 14:02:57 +01:00
Joshua Thijssen
f6046ba4f3 [security] Fetching current stored context when not explicitly specified 2015-01-18 14:02:55 +01:00
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
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
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
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
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
Fabien Potencier
f6d9f36672 minor #13395 [Debug] fix test (nicolas-grekas)
This PR was merged into the 2.6 branch.

Discussion
----------

[Debug] fix test

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

We really need a way to make tests green before subtree-splits

Commits
-------

df9bb26 [Debug] fix test
2015-01-13 18:07:02 +01:00
Tobias Schultze
1d8fc92dbe minor #13399 [Routing] fix misleading test for condition (Tobion)
This PR was merged into the 2.5 branch.

Discussion
----------

[Routing] fix misleading test for condition

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

Commits
-------

d687a88 [Routing] fix misleading test for condition
2015-01-13 16:05:34 +01:00
Tobias Schultze
d687a885a4 [Routing] fix misleading test for condition 2015-01-13 15:58:43 +01:00
Nicolas Grekas
df9bb2674e [Debug] fix test 2015-01-13 15:49:42 +01:00
Fabien Potencier
40854edb1f fixed typo 2015-01-13 13:55:31 +01:00
Tobias Schultze
9f85517645 feature #13361 [Routing] apply deprecation triggers and fix tests (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] apply deprecation triggers and fix tests

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

Correctly add deprecation for _scheme and _method requirements and fix code to not trigger deprecations itself. And fix test so that they either explicitly test deprecated functionality or alternatively refactor tests to use new style.

It also fixes the deprecation triggers for "pattern" which was not correctly done for YAML/XML loading.

Commits
-------

9af0ff2 [FrameworkBundle] fix routing container param resolving to not access deprecated requirements while maintaining BC
bd91867 [FrameworkBundle] remove superfluous test that is already covered in routing
bc1c5c8 [Routing] apply deprecation triggers and fix tests
2015-01-13 13:45:06 +01:00