Commit Graph

13933 Commits

Author SHA1 Message Date
Bilal Amarni
4edf29d04a added helperSet to console event objects 2013-03-24 09:16:16 +01:00
Francesco Levorato
f224102c72 Added events for CLI commands
This adds an init and terminate event for commands. They are
dispatched from ContainerAwareCommand.

The cache:clear command can't implement this (cf. #3889 on Github).
2013-03-24 09:15:39 +01:00
Fabien Potencier
d9009cb3c6 merged branch franmomu/reuse_variable_formpass (PR #7464)
This PR was merged into the 2.1 branch.

Discussion
----------

[FrameworkBundle] Reuse definition variable in FormPass

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

Commits
-------

f52320d [FrameworkBundle] Reuse definition variable in FormPass
2013-03-24 08:11:17 +01:00
Fran Moreno
f52320d4b9 [FrameworkBundle] Reuse definition variable in FormPass 2013-03-23 21:50:01 +01:00
Fabien Potencier
9c4ba6f1b2 merged branch loalf/add_serializer_service (PR #6815)
This PR was merged into the master branch.

Discussion
----------

[2.3] [FrameworkBundle] [Serializer] Loads the Serializer component as a service in the Framework Bundle

This PR is the same as
https://github.com/symfony/symfony/pull/5347

but since I am struggling to squash all the commits I better create a new one. Sorry for the inconveniences, :)

Commits
-------

b4e4844 Add the serializer service
2013-03-23 20:43:25 +01:00
Fabien Potencier
2e236423ba [CssSelector] fixed BC break 2013-03-23 20:31:06 +01:00
Fabien Potencier
b7eb8da8fb [CssSelector] removed obsolete file 2013-03-23 20:30:48 +01:00
Fabien Potencier
600eb1e6a5 [CssSelector] removed unneeded use statements 2013-03-23 20:30:33 +01:00
loalf
b4e4844235 Add the serializer service 2013-03-23 19:05:00 +00:00
Jean-François Simon
21291cabe7 improved bytes conversion method 2013-03-23 19:46:38 +01:00
Fabien Potencier
d855650577 merged branch jfsimon/css-selector-rewriting (PR #7463)
This PR was merged into the master branch.

Discussion
----------

[CssSelector] fully rewritted component

The `CssSelector` component is a port of the Python https://github.com/SimonSapin/cssselect library. Previous implementation was a port of the `v0.1` tag, this implementation is a port of the `v0.7.1` tag. As Python and PHP have different philosophies, this is not a simple language-to-language translation, I needed to re-architecture the lib.

**Note about BC:** This new version introduces some changes making fail legacy tests.
New XPath should be equivalents, these changes are:
-  When having a condition on an class, legacy condition is prefixed with a test of class existence. Example: `[contains(@class, 'foo')]` is transformed to `[@class and contains(@class, 'foo')]`.
-  When having conditions on descendants, `/descendant::*` is transformed to `/descendant-or-self::*/*`.

I updated legacy tests (stored in `CssSelectorTest` class) accordingly.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | see above
| Deprecations? | no
| Tests pass?   | yes

Should fix #3615 and #4271

Commits
-------

c6f87d0 [CssSelector] fully rewritted component
2013-03-23 19:42:38 +01:00
Jean-François Simon
c6f87d0026 [CssSelector] fully rewritted component
Squashed commits:
[CssSelector] removed previous implementation
[CssSelector] rewriting, step 1
[CssSelector] rewriting, step 2
[CssSelector] rewriting, step 3
[CssSelector] rewriting, step 4
[CssSelector] rewriting, step 5
[CssSelector] rewriting, step 6
[CssSelector] fixed shortcuts regex
[CssSelector] tests, step1
[CssSelector] tests, step2
[CssSelector] tests, step3
[CssSelector] tests, step4
[CssSelector] fixed problems based @stof's on feedback
[CssSelector] tests, step5
[CssSelector] tests, step6
[CssSelector] tests, step7
[CssSelector] added my name in composer.json
2013-03-23 19:04:09 +01:00
Fabien Potencier
bd53382c8e merged branch gunnarlium/fix-security-forward-http-code (PR #6957)
This PR was merged into the master branch.

Discussion
----------

[Security] Return 401 when using use_forward for form authentication

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

- [x] document the BC breaks in UPDATE and CHANGELOG

Currently, unauthenticated requests gets handled as exceptions and forwarded to the FormAuthenticationEntryPoint::start. When using use_forward = true, this method does not modify the status code, which means that final response to the end user will use a 500 status code. This is not right, as there is not a server problem, the problem is that the user is not authenticated. The status code should be 401.

This PR checks if the sub request to the form view is successful, and sets an X-Status-Code header if it is.This might break applications that rely on the 500 error code being returned for unauthenticated requests.

Commits
-------

b5597e8 [Security] Return 401 when using use_forward for form authentication
2013-03-23 15:33:24 +01:00
Fabien Potencier
da96476b56 reverted unwanted change (closes #7460) 2013-03-23 15:32:25 +01:00
Fabien Potencier
5dee43c186 tweaked previous merge 2013-03-23 15:29:58 +01:00
Gunnar Lium
b5597e8209 [Security] Return 401 when using use_forward for form authentication 2013-03-23 15:10:50 +01:00
Igor Wiedler
e602122f97 Add plain-text exception to exception page 2013-03-23 15:04:43 +01:00
Fabien Potencier
d901afdd2f [FrameworkBundle] updated the CHANGELOG 2013-03-23 14:51:10 +01:00
Fabien Potencier
3b1147ed06 merged branch inmarelibero/2.2-RouterMatch (PR #6950)
This PR was submitted for the 2.2 branch but it was merged into the master branch instead (closes #6950).

Discussion
----------

[2.3] [FrameworkBundle] added route debug information when path matches url

the result of the command `app/console router:match /demo/hello/foo` would be:

![Schermata 02-2456326 alle 17 04 42](https://f.cloud.github.com/assets/254808/120934/a1499432-6d52-11e2-8b67-46a164c30ea0.png)

instead of just:

    Route "_demo_hello" matches

Commits
-------

36098e1 [FrameworkBundle] added route debug information when path matches url
2013-03-23 14:49:10 +01:00
inmarelibero
c46e3e1748 added route debug information when path matches url
included required class
2013-03-23 14:49:10 +01:00
Fabien Potencier
1d778cf5c8 [FrameworkBundle] added a missing entry in the CHANGELOG 2013-03-23 14:42:22 +01:00
Fabien Potencier
57a0f1bb78 merged branch bgarret/timed-php-engine (PR #6836)
This PR was merged into the master branch.

Discussion
----------

[2.3] [FrameworkBundle] [Templating] added Stopwatch support to the PHP engine

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

I did not include tests nor documentation because there weren't any for TimedTwigEngine (I took it as an example). If I'm mistaken and they are needed, I'll gladly write them.

Commits
-------

3c3d34d [FrameworkBundle] [Templating] added Stopwatch support to the PHP engine
2013-03-23 14:38:26 +01:00
Fabien Potencier
a072ae2794 [HttpKernel] fixed tests as addScope() is now called first 2013-03-23 14:37:49 +01:00
Fabien Potencier
c28fe566fc [Security] added missing entry to the CHANGELOG 2013-03-23 14:30:20 +01:00
Fabien Potencier
aa26e663b1 merged branch adrienbrault/security-feature (PR #4776)
This PR was merged into the master branch.

Discussion
----------

[2.2] [Security] Add an option to disable the hasPreviousSession() check in AbstractAuthenticationListener

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/adrienbrault/symfony.png?branch=security-feature)](http://travis-ci.org/adrienbrault/symfony)
Fixes the following tickets: #3703
Todo: Add this option to the symfony doc security configuration reference
License of the code: MIT
Documentation PR: N/A

As stated in #3703, all authentication listeners that inherit from AbstractAuthenticationListener, only work when a previous session has been created.
This PR allows to change the default behavior in the security.yml file.

Example:

```yml
security:
    firewalls:
        secured_area:
            pattern:    ^/demo/secured/
            form_login:
                check_path: /demo/secured/login_check
                login_path: /demo/secured/login
                require_previous_session: false # The default value is true
            logout:
                path:   /demo/secured/logout
                target: /demo/
            #anonymous: ~
            #http_basic:
            #    realm: "Secured Demo Area"
```

PS: While removing my old commit, it closed the #4774 PR ...

Commits
-------

0562463 [Security] Add an option to disable the hasPreviousSession() check in AbstractAuthenticationListener
2013-03-23 14:17:47 +01:00
Fabien Potencier
74f96bfebf merged branch fabpot/contagious-services (PR #7007)
This PR was merged into the master branch.

Discussion
----------

[2.3] [WIP] Synchronized services...

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #5300, #6756
| License       | MIT
| Doc PR        | symfony/symfony-docs#2343

Todo:

 - [x] update documentation
 - [x] find a better name than contagious (synchronized)?

refs #6932, refs #5012

This PR is a proof of concept that tries to find a solution for some problems we have with scopes and services depending on scoped services (mostly the request service in Symfony).

Basically, whenever you want to inject the Request into a service, you have two possibilities:

 * put your own service into the request scope (a new service will be created whenever a sub-request is run, and the service is not available outside the request scope);

 * set the request service reference as non-strict (your service is always available but the request you have depends on when the service is created the first time).

This PR addresses this issue by allowing to use the second option but you service still always has the right Request service (see below for a longer explanation on how it works).

There is another issue that this PR fixes: edge cases and weird behaviors. There are several bug reports about some weird behaviors, and most of the time, this is related to the sub-requests. That's because the Request is injected into several Symfony objects without being updated correctly when leaving the request scope. Let me explain that: when a listener for instance needs the Request object, it can listen to the `kernel.request` event and store the request somewhere. So, whenever you enter a sub-request, the listener will get the new one. But when the sub-request ends, the listener has no way to know that it needs to reset the request to the master one. In practice, that's not really an issue, but let me show you an example of this issue in practice:

 * You have a controller that is called with the English locale;
 * The controller (probably via a template) renders a sub-request that uses the French locale;
 *  After the rendering, and from the controller, you try to generate a URL. Which locale the router will use? Yes, the French locale, which is wrong.

To fix these issues, this PR introduces a new notion in the DIC: synchronized services. When a service is marked as synchronized, all method calls involving this service will be called each time this service is set. When in a scope, methods are also called to restore the previous version of the service when the scope leaves.

If you have a look at the router or the locale listener, you will see that there is now a `setRequest` method that will called whenever the request service changes (because the `Container::set()` method is called or because the service is changed by a scope change).

Commits
-------

17269e1 [DependencyInjection] fixed management of scoped services with an invalid behavior set to null
bb83b3e [HttpKernel] added a safeguard for when a fragment is rendered outside the context of a master request
5d7b835 [FrameworkBundle] added some functional tests
ff9d688 fixed Request management for FragmentHandler
1b98ad3 fixed Request management for LocaleListener
a7b2b7e fixed Request management for RequestListener
0892135 [HttpKernel] ensured that the Request is null when outside of the Request scope
2ffcfb9 [FrameworkBundle] made the Request service synchronized
ec1e7ca [DependencyInjection] added a way to automatically update scoped services
2013-03-23 14:07:03 +01:00
Fabien Potencier
17269e137d [DependencyInjection] fixed management of scoped services with an invalid behavior set to null
The optimization for references has been removed as it does not take
scopes into account.
2013-03-23 13:59:30 +01:00
Fabien Potencier
ddd30d0b8e merged branch fabpot/request-scope (PR #7457)
This PR was merged into the master branch.

Discussion
----------

moved the request scope creation to the ContainerAwareHttpKernel class

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

While updating the scope documentation, I realized that the request scope was created in the FrameworkBundle while the HttpKernel that manages it was in the HttpKernel component. So, this PR makes things more consistent.

Commits
-------

cec98c1 [DependencyInjection] fixed PHP notice when the scope is not defined
550df5a moved the request scope creation to the ContainerAwareHttpKernel class
2013-03-23 13:54:47 +01:00
Fabien Potencier
9885798dd1 merged branch schmittjoh/routingFix (PR #7458)
This PR was merged into the 2.2 branch.

Discussion
----------

Reverts behavior change to UrlGenerator

I do not want to talk much about the behavior change and whether it makes sense or not because I think it does not matter in this situation anyway.

The ``generate`` method is tagged with ``@api``, there is no security issue that was fixed. According to the rules set forth at http://symfony.com/doc/current/book/stable_api.html, the semantics of such a method must not be changed.

There is some more discussion in #6814 and the commit changing the behavior is this one: c66d1f9de3 (diff-0)

Commits
-------

a765375 reverts some behavior changes made in c66d1f9de30fd1b6a86cca10dd79d12c9ba9ff25
2013-03-23 13:53:00 +01:00
Fabien Potencier
26750075b8 merged branch fabpot/deprecated (PR #7227)
This PR was merged into the master branch.

Discussion
----------

[WIP] Removed deprecated stuff

Commits
-------

f2a8908 removed deprecated functionality from RouteCollection
4f4a5d1 [TwigBundle] removed deprecated syntax
45bd413 [FrameworkBundle] removed deprecated options
0bb5d01 [FrameworkBundle] removed deprecated cookie options
b3081e8 [Form] removed deprecated methods and classes
e0385a2 [Validator] removed deprecated methods
65e3b16 [Validator] removed deprecated constraints
4a70ddf [HttpFoundation] removed deprecated session methods
4e7943f [Yaml] removed deprecated support of PHP parsin when parsing YAML files
09a5969 [HttpFoundation] removed deprecated Request::splitHttpAcceptHeader() method
c28f1b0 removed deprected way to declared trusted proxies
5ff6006 removed deprecated stuff in the fragment sub-framework
0a06a7c [Translation] removed deprecated classes
67f6397 [Security] removed deprecated classes
2013-03-23 13:50:05 +01:00
Johannes M. Schmitt
a765375e91 reverts some behavior changes made in c66d1f9de30fd1b6a86cca10dd79d12c9ba9ff25 2013-03-23 13:03:22 +01:00
Tobias Schultze
f2a8908615 removed deprecated functionality from RouteCollection 2013-03-23 12:55:23 +01:00
Fabien Potencier
4f4a5d1643 [TwigBundle] removed deprecated syntax 2013-03-23 12:55:23 +01:00
Fabien Potencier
45bd4135ec [FrameworkBundle] removed deprecated options 2013-03-23 12:55:18 +01:00
Fabien Potencier
0bb5d01f32 [FrameworkBundle] removed deprecated cookie options 2013-03-23 11:48:19 +01:00
Fabien Potencier
b3081e85a0 [Form] removed deprecated methods and classes 2013-03-23 11:48:19 +01:00
Fabien Potencier
e0385a2c1c [Validator] removed deprecated methods 2013-03-23 11:48:19 +01:00
Fabien Potencier
65e3b1684b [Validator] removed deprecated constraints 2013-03-23 11:48:18 +01:00
Fabien Potencier
4a70ddff4d [HttpFoundation] removed deprecated session methods 2013-03-23 11:48:18 +01:00
Fabien Potencier
4e7943fad0 [Yaml] removed deprecated support of PHP parsin when parsing YAML files 2013-03-23 11:48:18 +01:00
Fabien Potencier
09a5969b89 [HttpFoundation] removed deprecated Request::splitHttpAcceptHeader() method 2013-03-23 11:48:18 +01:00
Fabien Potencier
c28f1b0926 removed deprected way to declared trusted proxies 2013-03-23 11:48:18 +01:00
Fabien Potencier
5ff6006fa6 removed deprecated stuff in the fragment sub-framework 2013-03-23 11:46:55 +01:00
Fabien Potencier
0a06a7c107 [Translation] removed deprecated classes 2013-03-23 11:46:26 +01:00
Fabien Potencier
67f6397a83 [Security] removed deprecated classes 2013-03-23 11:46:26 +01:00
Fabien Potencier
9e7a877f7c merged branch fabpot/webprofiler-customization (PR #7003)
This PR was merged into the 2.2 branch.

Discussion
----------

[2.3] [WebProfiler] added the possibility to override the application name/version in the WDT

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

Commits
-------

d35cb9f [WebProfiler] added the possibility to override the application name/version in the WDT
2013-03-23 11:44:58 +01:00
Fabien Potencier
d35cb9f880 [WebProfiler] added the possibility to override the application name/version in the WDT 2013-03-23 11:43:44 +01:00
Fabien Potencier
cec98c1d7a [DependencyInjection] fixed PHP notice when the scope is not defined 2013-03-23 11:39:42 +01:00
Fabien Potencier
5b5c7db23a merged branch igorw/css-display (PR #6624)
This PR was merged into the master branch.

Discussion
----------

[2.3][TwigBundle] Use display instead of visibility for exception page icons

Originally spawned from #6612, this allows us to get rid of the ugly margins for the open and close icons on the exception page.

Commits
-------

e66bd14 [TwigBundle] Use display instead of visibility for exception page icons
2013-03-23 11:31:30 +01:00
Fabien Potencier
55f0e76495 [HttpFoundation] added missing entry in the CHANGELOG 2013-03-23 11:06:01 +01:00