Commit Graph

15102 Commits

Author SHA1 Message Date
Bernhard Schussek 9efdb8e5d0 [Form] Deprecated ChoiceList::getIndicesFor*() methods 2013-09-10 18:24:36 +02:00
Bernhard Schussek 67ba131458 [DoctrineBridge] Improved test coverage of EntityChoiceList 2013-09-10 18:24:34 +02:00
Bernhard Schussek 31e5ce5de1 [Form] Improved test coverage of ChoiceList classes 2013-09-10 14:39:29 +02:00
Bernhard Schussek 6283b0e93d [Form] Fixed expanded choice field to be marked invalid when unknown choices are submitted 2013-09-10 14:39:29 +02:00
Bernhard Schussek 79a214fa75 [Form] Fixed ChoiceList::get*By*() methods to preserve order and array keys 2013-09-10 14:39:29 +02:00
Bernhard Schussek 62fbed608a [Form] Removed usage of the ChoiceList::getIndicesFor*() methods where they don't offer any performance benefit 2013-09-10 14:39:29 +02:00
Fabien Potencier 599c86509e merged branch fabpot/request-stack (PR #8904)
This PR was merged into the master branch.

Discussion
----------

Synchronized Service alternative, backwards compatible

This is a rebased version #7707.

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

Todo/Questions

 - [x] do we deprecate the synchronize feature (and removed it in 3.0)?
 - [x] deal with BC for listeners
 - [x] rename RequestContext as we already have a class with the same name in the Routing component?
 - [x] move RequestStack and RequestContext to HttpFoundation?
 - [x] update documentation

Prototype for introducing a ``RequestContext`` in HttpKernel.

This PR keeps the synchronized services feature, however introduces a ``RequestContext`` object additionally, that allows to avoid using synchronized service when injecting ``request_context`` instead of ``request`` into a service. The FrameworkBundle is modified such that it does not depend on synchronized services anymore. Users however can still depend on ``request``, activating the synchronized services feature.

Features:

* Introduced ``REQUEST_FINSHED`` (name is up for grabs) event to handle global state and environment cleanup that should not be done in ``RESPONSE``. Called in both exception or success case correctly
* Changed listeners that were synchronized before to using ``onKernelRequestFinished`` and ``RequestContext`` to reset to the parent request (RouterListener + LocaleListener).
* Changed ``FragmentHandler`` to use the RequestContext. Added some more tests for this class.

* ``RequestStack`` is injected into the ``HttpKernel`` to handle the request finished event and push/pop the stack with requests.

Todos:
* RequestContext name clashes with Routing components RequestContext. Keep or make unique?
* Name for Kernel Request Finished Event could be improved.

Commits
-------

1b2ef74 [Security] made sure that the exception listener is always removed from the event dispatcher at the end of the request
b1a062d moved RequestStack to HttpFoundation and removed RequestContext
93e60ea [HttpKernel] modified listeners to be BC with Symfony <2.4
018b719 [HttpKernel] tweaked the code
f9b10ba [HttpKernel] renamed the kernel finished event
a58a8a6 [HttpKernel] changed request_stack to a private service
c55f1ea added a RequestStack class
2013-09-08 22:22:53 +02:00
Fabien Potencier 1b2ef74a9a [Security] made sure that the exception listener is always removed from the event dispatcher at the end of the request 2013-09-08 15:18:27 +02:00
Fabien Potencier b1a062d232 moved RequestStack to HttpFoundation and removed RequestContext 2013-09-08 07:38:03 +02:00
Fabien Potencier 93e60eaeab [HttpKernel] modified listeners to be BC with Symfony <2.4 2013-09-07 21:48:44 +02:00
Fabien Potencier 018b71936f [HttpKernel] tweaked the code 2013-09-07 21:43:50 +02:00
Fabien Potencier f9b10ba1d5 [HttpKernel] renamed the kernel finished event 2013-09-07 21:43:50 +02:00
Fabien Potencier a58a8a69fd [HttpKernel] changed request_stack to a private service 2013-09-07 21:43:49 +02:00
Benjamin Eberlei c55f1ea8af added a RequestStack class 2013-09-07 21:43:49 +02:00
Fabien Potencier 08ec911c8e merged branch Tobion/deprecate-debuggerinterface (PR #8929)
This PR was merged into the master branch.

Discussion
----------

[Templating] deprecate DebuggerInterface

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes: deprecated DebuggerInterface and Debugger
| Tests pass?   | yes
| Fixed tickets | #8926
| License       | MIT

- [x] add suggested optional dependency in templating component to Psr log
- [x] remove ProjectTemplateDebugger from tests

Commits
-------

b853438 [Templating] deprecate DebuggerInterface
2013-09-07 19:45:30 +02:00
Fabien Potencier ccf2094752 [Console] reverted change in the XML root name (refs #8928) 2013-09-07 18:46:00 +02:00
Fabien Potencier 703fda3b8b merged branch deguif/console_xml_list_improvement (PR #8928)
This PR was squashed before being merged into the master branch (closes #8928).

Discussion
----------

[Console] Improved xml generated when listing commands

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

I marked this PR as a BC break, as it breaks the xml schema generated by the command __app/console list --xml__

It replaces the first node (currently _symfony_) by a more generic node name ( _application_ ) and adds the application name and application version if specified in the _Symfony\Component\Console\Application_ constructor.

Before (using composer console that uses symfony console component):
```
<?xml version="1.0" encoding="UTF-8"?>
<symfony>
    ...
</symfony>
```

After (using composer console that uses symfony console component):
```
<?xml version="1.0" encoding="UTF-8"?>
<application name="Composer" version="x.x.x">
    ...
</application>
```

Commits
-------

7958227 [Console] Improved xml generated when listing commands
2013-09-07 18:43:43 +02:00
François-Xavier de Guillebon 7958227d8b [Console] Improved xml generated when listing commands 2013-09-07 18:43:42 +02:00
Romain Neutron 2370c798df Fix testIdleTimeoutNotExceededWhenOutputIsSent on windows 2013-09-07 18:33:27 +02:00
Fabien Potencier 69265876b1 Merge branch '2.3' (closes #8956)
* 2.3:
  [HttpFoundation] removed extra parenthesis
  [Process][2.2] Fix Process component on windows
  [HttpFoundation] improve perf of previous merge (refs #8882)
  Request->getPort() should prefer HTTP_HOST over SERVER_PORT
  Fixing broken http auth digest in some circumstances (php-fpm + apache).
  fixed typo

Conflicts:
	src/Symfony/Component/Process/Process.php
2013-09-07 18:33:13 +02:00
Fabien Potencier 3689849e8b Merge branch '2.2' into 2.3 (closes #8955)
* 2.2:
  [HttpFoundation] removed extra parenthesis
  [Process][2.2] Fix Process component on windows
  [HttpFoundation] improve perf of previous merge (refs #8882)
  Request->getPort() should prefer HTTP_HOST over SERVER_PORT
  Fixing broken http auth digest in some circumstances (php-fpm + apache).
  fixed typo

Conflicts:
	src/Symfony/Component/Process/Process.php
2013-09-07 18:30:19 +02:00
Fabien Potencier d05ab6b940 [HttpFoundation] removed extra parenthesis 2013-09-07 14:10:08 +02:00
Fabien Potencier 8e71bfe3b2 merged branch craue/patch-27 (PR #8909)
This PR was merged into the 2.2 branch.

Discussion
----------

fixed typo

Commits
-------

42c7b95 fixed typo
2013-09-07 08:45:07 +02:00
Fabien Potencier 2dead87b31 merged branch romainneutron/process-windows (PR #8924)
This PR was squashed before being merged into the 2.2 branch (closes #8924).

Discussion
----------

[Process][2.2] Fix Process component on windows

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

This PR fixes Process on windows (almost, see note below).
 - Some unit tests were not Windows compatible
 - Use a file handle for STDERR as well as STDOUT to avoid blocking
 - Decouple pipes and descriptors from Process

As this move some a part of Process in a sub class, I hope merging this in 2.3 and master would not be a PITA. I'm here to make some adjustments after theses merge if needed.

**Important note** :

We are using file handles instead of streams for `proc_open` pipes as described in the code (see [PHP bug #51800](https://bugs.php.net/bug.php?id=51800)). Unfortunately, this workaround may produce corrupted output/error output in some race conditions. That's why `AbstractProcessTest::testProcessPipes` randomly fails when using file handles (on unix and windows).

Commits
-------

4a76c76 [Process][2.2] Fix Process component on windows
2013-09-07 08:18:58 +02:00
Romain Neutron 4a76c76698 [Process][2.2] Fix Process component on windows 2013-09-07 08:18:57 +02:00
Fabien Potencier 729ac7b967 [HttpFoundation] improve perf of previous merge (refs #8882) 2013-09-07 08:13:51 +02:00
Fabien Potencier 85eaec3eda merged branch dhotson/request-http-host-port (PR #8882)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8882).

Discussion
----------

[HttpFoundation] Request->getPort() should prefer HTTP_HOST over SERVER_PORT

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/3420
| License       | MIT
| Doc PR        | none

What is this?
----

_Note to reviewer: This follows on from a previous pull request: https://github.com/symfony/symfony/pull/8184
Since the introduction of `Request->setTrustedHosts()` — the implementation of this fix has been simplified._

This fixes the semantics of the `Request#getPort()` method to prefer the HTTP_HOST header over SERVER_PORT.

This is relevant in situations where the web server is running on a different port to the public facing website. e.g. load balancers, proxies, port forwarding.

Consistency
----

This change makes Symfony more consistent with other popular web frameworks.

Preferring HTTP_HOST over SERVER_NAME and SERVER_PORT is the strategy used by Ruby's Rack and Python's Django.

Python has a PEP that describes how to reconstruct URLs:
http://www.python.org/dev/peps/pep-0333/#url-reconstruction

b6290a184c/lib/rack/request.rb (L92)

Commits
-------

fa97d80 Request->getPort() should prefer HTTP_HOST over SERVER_PORT
2013-09-07 08:11:06 +02:00
Dennis Hotson 65814bae27 Request->getPort() should prefer HTTP_HOST over SERVER_PORT 2013-09-07 08:11:05 +02:00
Fabien Potencier 1086faf0fb merged branch shouze/fix/auth-digest (PR #8952)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8952).

Discussion
----------

[HttpFoundation] Fixing broken http auth digest in some circumstances.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | can be refered in issue #1813
| License       | MIT
| Doc PR        | n/a

With some apache + php-fpm setup we need to set ```PHP_AUTH_DIGEST``` value if not already setted in GLOBAL vars.

Added some unit tests too.

Commits
-------

9fc994b [HttpFoundation] Fixing broken http auth digest in some circumstances (php-fpm + apache).
2013-09-07 07:57:27 +02:00
Sébastien HOUZÉ e75d2842cd Fixing broken http auth digest in some circumstances (php-fpm + apache). 2013-09-07 07:57:27 +02:00
Fabien Potencier 091a96ca3d Merge branch '2.3'
* 2.3:
  Fixing singular form for kisses, accesses and addresses.
  fixed some circular references
  [Security] fixed a leak in ExceptionListener
  [Security] fixed a leak in the ContextListener
  Ignore posix_istatty warnings
  removed unused variable
  [Form] fix iterator typehint
  typos
  Button missing getErrorsAsString() fixes #8084 Debug: Not calling undefined method anymore. If the form contained a submit button the call would fail and the debug of the form wasn't possible. Now it will work in all cases. This fixes #8084
  Use isset() instead of array_key_exists() in DIC
  Fixed annotation
  [BrowserKit] fixed method/files/content when redirecting a request
  [BrowserKit] removed some headers when redirecting a request
  [BrowserKit] fixed headers when redirecting if history is set to false (refs #8697)
  [HttpKernel] fixed route parameters storage in the Request data collector (closes #8867)
  [BrowserKit] Pass headers when `followRedirect()` is called
  Return BC compatibility for `@Route` parameters and default values

Conflicts:
	src/Symfony/Component/Security/Http/Firewall/ContextListener.php
2013-09-06 20:21:06 +02:00
Fabien Potencier 702e652002 Merge branch '2.2' into 2.3
* 2.2:
  Fixing singular form for kisses, accesses and addresses.
  fixed some circular references
  [Security] fixed a leak in ExceptionListener
  [Security] fixed a leak in the ContextListener
  Ignore posix_istatty warnings
  typos
  [HttpKernel] fixed route parameters storage in the Request data collector (closes #8867)
  Return BC compatibility for `@Route` parameters and default values

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
	src/Symfony/Component/Console/Application.php
2013-09-06 20:20:34 +02:00
Fabien Potencier 535cf50c3a merged branch fabpot/firewall-leaks (PR #8946)
This PR was merged into the 2.2 branch.

Discussion
----------

[Security] fixed a leak in the ContextListener

| 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

Trying to fix leaks when using the same Kernel to handle several requests in a row without resetting the Container or shutting down the Kernel.

Commits
-------

899f176 [Security] fixed a leak in ExceptionListener
2fd8a7a [Security] fixed a leak in the ContextListener
2013-09-06 20:18:09 +02:00
Fabien Potencier 20fadcdbaf merged branch fabpot/bundle-leaks (PR #8947)
This PR was merged into the master branch.

Discussion
----------

[HttpKernel] fixes some memory leaks

| Q             | A
| ------------- | ---
| Bug fix?      | kinda
| New feature?  | no
| BC breaks?    | kinda as the Bundle `$reflected` property was removed
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

6307f41 [HttpKernel] removed a circular reference that prevents PHP GC to do its job
49fe3c7 [HttpKernel] removed the need to use reflection to get a bundle namespace
2013-09-06 20:17:41 +02:00
Fabien Potencier c753d68771 merged branch fabpot/random-leaks (PR #8948)
This PR was merged into the 2.2 branch.

Discussion
----------

Fixed some random leaks

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

970405f fixed some circular references
2013-09-06 20:17:18 +02:00
Fabien Potencier 8432950a37 merged branch tgabi333/di_minor_code_duplication (PR #8949)
This PR was merged into the master branch.

Discussion
----------

[DependencyInjection] remove code duplication from ContainerBuilder

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

Commits
-------

485fb15 [DependencyInjection] remove code duplication from ContainerBuilder
2013-09-06 18:19:41 +02:00
tgabi333 485fb15c91 [DependencyInjection] remove code duplication from ContainerBuilder 2013-09-06 17:04:46 +02:00
Fabien Potencier a42ad21003 merged branch jjanvier/master (PR #8943)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8943).

Discussion
----------

[PropertyAccess] Fixing singular form for kisses, accesses and addresses.

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

Plural form of noums finishing by *sses* is always *ss* (contrary to plural form of noums finishing by *ses*).

Commits
-------

ebae88f Fixing singular form for kisses, accesses and addresses.
2013-09-06 16:56:44 +02:00
jjanvier 011434a54d Fixing singular form for kisses, accesses and addresses. 2013-09-06 16:56:44 +02:00
Fabien Potencier 970405f293 fixed some circular references 2013-09-06 16:26:52 +02:00
Fabien Potencier 899f1760a6 [Security] fixed a leak in ExceptionListener 2013-09-06 16:13:07 +02:00
Fabien Potencier 6307f41306 [HttpKernel] removed a circular reference that prevents PHP GC to do its job 2013-09-06 16:05:39 +02:00
Fabien Potencier 49fe3c7c39 [HttpKernel] removed the need to use reflection to get a bundle namespace 2013-09-06 16:05:35 +02:00
Fabien Potencier 2fd8a7acf3 [Security] fixed a leak in the ContextListener 2013-09-06 15:53:58 +02:00
Fabien Potencier abb8042249 merged branch norzechowicz/posix_isatty (PR #8939)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8939).

Discussion
----------

[Console] Ignore posix_istatty warnings

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

When input stream is ``php://memory`` or ``php://temp`` function ``posix_isatty`` throws following warning

> posix_isatty(): could not use stream of type 'MEMORY' in ....

Commits
-------

cc255dd Ignore posix_istatty warnings
2013-09-05 15:35:47 +02:00
Norbert Orzechowicz 4e9d99032b Ignore posix_istatty warnings 2013-09-05 15:35:47 +02:00
Fabien Potencier 17f4a3dd10 removed unused variable 2013-09-05 13:25:56 +02:00
Fabien Potencier d1ef0f3fdd merged branch pkruithof/firewall-host-option (PR #8905)
This PR was merged into the master branch.

Discussion
----------

Added 'host' option to firewall configuration

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

This is a follow-up of #8880.

Commits
-------

94d648b Added 'host' option to firewall configuration
2013-09-05 10:35:20 +02:00
Tobias Schultze b853438088 [Templating] deprecate DebuggerInterface
set logger in extension , so its only done in debug mode
add psr/log to suggest of templating
add test for setLogger and refactor tests to not depend that much an
deprecated functionality
2013-09-04 21:57:45 +02:00
Fabien Potencier eb9571e2b0 merged branch Tobion/form-phpdoc (PR #8925)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] fix iterator phpdoc

It returns IteratorAggregate. But we probably only want to specify Traversable because that is was counts.

Fix from #8852

Commits
-------

f438ac3 [Form] fix iterator typehint
2013-09-04 08:17:01 +02:00