Commit Graph

13559 Commits

Author SHA1 Message Date
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
Fabien Potencier
2b4cfbdbb7 merged branch bamarni/http-uploaded-file (PR #7201)
This PR was merged into the master branch.

Discussion
----------

[2.3] moved a security check in HttpUploadedFile

closes #6802

- [x] fix the testsuite, I've only run the component suite, but it needs to be updated in other places too (according to travis)

Commits
-------

5bb44f5 [HttpFoundation] UploadedFile - moved a security check
2013-03-23 11:04:42 +01:00
Bilal Amarni
5bb44f52a0 [HttpFoundation] UploadedFile - moved a security check
Squashed commit of the following:

commit b03b32ecc985c4a4f9dc7df2d3336a4cd75aae30
Merge: fb7004b fc70e13
Author: Bilal Amarni <bilal.amarni@gmail.com>
Date:   Wed Feb 27 11:33:37 2013 +0100

    [HttpFoundation] UploadedFile - moved a security check

commit fc70e138c1d3858775c9efe51268cae6d7ec3f69
Author: Bilal Amarni <bilal.amarni@gmail.com>
Date:   Thu Jan 24 11:07:29 2013 +0100

    explicitly passed UPLOAD_ERR_OK constant in a test

commit dda03a2faab9539ca3a93736dd2bc0ec27feb4e7
Author: Bilal Amarni <bilal.amarni@gmail.com>
Date:   Fri Jan 18 17:24:06 2013 +0100

    [HttpFoundation] UploadedFile - moved a security check from move() to isValid()
2013-03-23 10:56:11 +01:00
Fabien Potencier
550df5a85a moved the request scope creation to the ContainerAwareHttpKernel class 2013-03-23 10:14:37 +01:00
Fabien Potencier
69dbbdda3d added missing entries in CHANGELOGs 2013-03-23 10:10:35 +01:00
Fabien Potencier
f465d2aa6f merged branch marcosQuesada/serializer/denormalize-camelcase (PR #6951)
This PR was merged into the master branch.

Discussion
----------

[2.3] [Serializer] Enabled camelCase format to be used on denormalize method

 Enabled camelCase formater , that way when hydrating from arrays, attributes as attribute_name could be implemented as attributteName parameter, with getAttributeName and setAttributeName, giving different formating option from setAttribute_name  getAttribute_name.

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

Commits
-------

fbffdf0 Enabled camelCase format to be used on denormalize method, that way camel_case attribute can be used on object as getCamelCase()
2013-03-23 09:19:40 +01:00
Fabien Potencier
25a5395d9d merged branch lmcnearney/querystring (PR #7028)
This PR was squashed before being merged into the master branch (closes #7028).

Discussion
----------

[2.3] [Routing] Added access to querystring in RequestContext

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

This is related to a Silex change request: https://github.com/fabpot/Silex/pull/623

Commits
-------

4a2b755 [2.3] [Routing] Added access to querystring in RequestContext
2013-03-23 09:12:44 +01:00
Lance McNearney
4a2b75536e [2.3] [Routing] Added access to querystring in RequestContext 2013-03-23 09:12:43 +01:00
Fabien Potencier
77ec799751 Merge branch '2.2'
* 2.2:
  #7106 - fix for ZTS builds
  Added '@@' escaping strategy for YamlFileLoader and YamlDumper
  [Yaml] fixed bugs with folded scalar parsing
  [Form] made DefaultCsrfProvider using session_status() when available
  Added unit tests to Dumper
  Update .travis.yml (closes #7355)
  [HttpFoudantion] fixed Request::getPreferredLanguage()
  Revert "merged branch jfsimon/issue-6928 (PR #7378)"
  Routing issue with installation in a sub-directory ref: https://github.com/symfony/symfony/issues/7129
2013-03-23 09:06:49 +01:00
Fabien Potencier
a045925d2a [ClassLoader] added missing CHANGELOG entry for previous merge 2013-03-23 09:02:48 +01:00
Fabien Potencier
86d76195fb merged branch Smart-Core/master (PR #7076)
This PR was merged into the master branch.

Discussion
----------

[2.3] Add missing WinCacheClassLoader

Commits
-------

af86e5b Add missing WinCacheClassLoader
2013-03-23 09:00:58 +01:00
Fabien Potencier
03fc97d11a Merge branch '2.1' into 2.2
* 2.1:
  #7106 - fix for ZTS builds
  Added '@@' escaping strategy for YamlFileLoader and YamlDumper
  [Yaml] fixed bugs with folded scalar parsing
  [Form] made DefaultCsrfProvider using session_status() when available
  Added unit tests to Dumper
  Update .travis.yml (closes #7355)
  [HttpFoudantion] fixed Request::getPreferredLanguage()
  Revert "merged branch jfsimon/issue-6928 (PR #7378)"
  Routing issue with installation in a sub-directory ref: https://github.com/symfony/symfony/issues/7129

Conflicts:
	.travis.yml
	src/Symfony/Bundle/FrameworkBundle/Routing/Router.php
	src/Symfony/Component/Routing/RouteCollection.php
2013-03-23 08:49:54 +01:00
Fabien Potencier
8ae7d98569 merged branch DHorchler/2.1 (PR #7193)
This PR was merged into the 2.1 branch.

Discussion
----------

Routing issue with installation in a sub-directory

ref: https://github.com/symfony/symfony/issues/7129

Commits
-------

8d9cd42 Routing issue with installation in a sub-directory ref: https://github.com/symfony/symfony/issues/7129
2013-03-23 08:47:35 +01:00
Fabien Potencier
78ebba558e merged branch lizjulien/7106 (PR #7248)
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7248).

Discussion
----------

#7106 - check php version for getcwd()

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

Commits
-------

11d3855  #7106 - fix for ZTS builds
2013-03-23 08:44:02 +01:00
Julien Moulin
11c0fb580d #7106 - fix for ZTS builds 2013-03-23 08:44:01 +01:00
Fabien Potencier
bbf9ec93e9 [Finder] added a CHANGELOG entry for the previous merge 2013-03-23 08:42:25 +01:00
Fabien Potencier
e5be0ded50 merged branch jfsimon/finder-access-denied-exception (PR #7256)
This PR was merged into the master branch.

Discussion
----------

[Finder] Adds AccessDeniedException

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

Commits
-------

714ace8 [finder] Introduced AccessDeniedException
2013-03-23 08:39:29 +01:00
Fabien Potencier
2f7a9fde7f updated various CHANGELOG files that were not updated when the PRs were merged 2013-03-23 08:35:36 +01:00
Fabien Potencier
9fba645cb2 [Console] added a note in the CHANGELOG for the previous merge, fixed some CS 2013-03-23 08:15:46 +01:00
Fabien Potencier
062cce0018 merged branch pkruithof/progress-helper-enhancements (PR #7300)
This PR was squashed before being merged into the master branch (closes #7300).

Discussion
----------

[Console] Progress helper enhancements

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

Two enhancements:

1. The progress bar clears the current line before writing the current progress. This can cause some flickering in the terminal. I've modified the write method to append whitespace to the line to be written, so it matches the previous line's length.
2. Added a `setCurrent` method to set the current progress. Rather than advancing by 1 or more steps, sometimes you want to just set the current state. For example if you are downloading a file, and a callback provides you with the current download status. A workaround for this could be to keep track of the previous event, calculate the difference, and advancing by the diff. But it's easier to just set the current progress.

Sidenotes:
* The [`overwrite`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Helper/ProgressHelper.php#L387) method copied documentation of the Output's [`write`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Output/Output.php#L139) method. The difference is, the overwrite method does not handle an array of messages. I've updated the documentation for this.
* The helper uses `strlen` to calculate line lengths. This could cause a problem when using multibyte strings. I'd change it to `mb_strlen`, but I'm not sure if the `mb_string` extension is required by Symfony.

Commits
-------

5ae76f0 [Console] Progress helper enhancements
2013-03-23 08:10:00 +01:00