Commit Graph

15891 Commits

Author SHA1 Message Date
Michele Orselli
ecb6481117 removed ini check to make uploadedfile work on gae 2014-03-25 17:54:15 +01:00
Fabien Potencier
af1d21954e minor #10528 Update OptionsResolver.php (shadypierre)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10528).

Discussion
----------

Update OptionsResolver.php

Deleting an extra space in the exception.

Commits
-------

7507fbb Update OptionsResolver.php
2014-03-25 14:10:48 +01:00
Shady
79ceb094f0 Update OptionsResolver.php
Deleting an extra space in the exception.
2014-03-25 14:10:48 +01:00
Fabien Potencier
1457ded0ac minor #10514 [FrameworkBundle] fixed comment in forms.xml file (hhamon)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] fixed comment in forms.xml file

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

Commits
-------

f9f7246 [FrameworkBundle] fixed comment in forms.xml file
2014-03-24 19:01:48 +01:00
Hugo Hamon
33c1ba7c79 fixed comment in forms.xml file 2014-03-24 19:01:48 +01:00
Fabien Potencier
234de53b4a minor #10525 [HttpKernel] Clean KernelInterface docblocks (sbward)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10525).

Discussion
----------

[HttpKernel] Clean KernelInterface docblocks

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

- Fixed questionable grammar
- Added missing periods to make it consistent

Commits
-------

4b1f050 Clean KernelInterface docblocks
2014-03-24 19:00:42 +01:00
Sam Ward
e850b38464 Clean KernelInterface docblocks
- Fixed questionable grammar
- Added missing periods to make it consistent
2014-03-24 19:00:42 +01:00
Fabien Potencier
bbaa839a82 bug #10416 [Form] Allow options to be grouped by objects (felds)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10416).

Discussion
----------

[Form] Allow options to be grouped by objects

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

Commits
-------

ae3f02f Cast the group name as a string
2014-03-21 12:48:43 +01:00
Luiz “Felds” Liscia
d685d7d08b Cast the group name as a string
This allows the options to be grouped by association fields.
2014-03-21 12:48:42 +01:00
Fabien Potencier
fb2ce7a171 minor #10497 [SecurityBundle] Fixed doc of InitAclCommand (dunglas)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10497).

Discussion
----------

[SecurityBundle] Fixed doc of InitAclCommand

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

Use {@inheritdoc}. Consistency with https://github.com/symfony/symfony/pull/9990#discussion-diff-10219606.

Commits
-------

aa49009 [SecurityBundle] Fixed doc of InitAclCommand
2014-03-19 21:51:09 +01:00
Kévin Dunglas
c5e8a884f8 Fixed doc of InitAclCommand 2014-03-19 21:51:09 +01:00
Fabien Potencier
fc251dbcd4 bug #10410 [Form] Fix "Array was modified outside object" in ResizeFormListener. (Chekote)
This PR was squashed before being merged into the 2.3 branch (closes #10410).

Discussion
----------

[Form] Fix "Array was modified outside object" in ResizeFormListener.

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

This is the second pull request for this issue. The history of this is as follows:

Original Fix was added Feb 11th under Pull Request #10232.
Users began complaining of Doctrine ArrayCollection not being updated in forms.
Revert was added Feb 15th under Pull Request #10269.
Issue #10405 was opened on 7th Mar for the original bug.

Pull Request #10269 has a failing test that illustrates users concerns.
I have added failing tests to this pull request to illustrate the problems described in #10405.

All tests now pass, and all forms of $data are now supported, including arrays, DoctrineCollection, ArrayObject, and other IteratorAggregates.

__Details as follows:__

The onSubmit() method of the ResizeFormListener class is assuming the data is an array, and calling unset directly inside a foreach. This works fine in most scenarios, but if data is an instance of IteratorAggregate that is iterating over $data by reference, it breaks with the following error:

Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener::onSubmit(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in ./vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php line 142

This is because the foreach loop is using an Iterator in the background, but the ResizeFormListener has unset the underlying data directly, causing the value that the Iterators internal pointer is pointing to to change.

The Iterator provided by IteratorAggregate may or may not have the ability to modify it's underlying data. So it is not possible to rely on the Iterator to modify the data. Instead, it is simpler to avoid modifying $data at all while we are iterating over it. So instead, we simply iterate over $data once to determine the keys we need to delete, and store them. Then we iterate over the keys and delete them from $data.

Commits
-------

aa63fae [Form] Fix "Array was modified outside object" in ResizeFormListener.
2014-03-19 17:44:48 +01:00
Chekote
aa63faea06 [Form] Fix "Array was modified outside object" in ResizeFormListener. 2014-03-19 17:44:48 +01:00
Fabien Potencier
65f024234d bug #10494 [2.3][Validator] Minor fix in IBAN validator (sprain)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Validator] Minor fix in IBAN validator

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

Added more values to unit tests of IBAN validator to make clear it doesn't accept lower case letters.

> Permitted IBAN characters are the digits 0 to 9 and the 26 upper-case Latin alphabetic characters A to Z.
http://en.wikipedia.org/wiki/International_Bank_Account_Number

Also made little adjustment to code which meant to validate lowercase letters but actually was useless.

Commits
-------

3eeb306 Fix IBAN validator
2014-03-19 17:10:10 +01:00
Manuel Reinhard
3eeb3067e3 Fix IBAN validator 2014-03-19 17:04:05 +01:00
Fabien Potencier
c29b4214b6 minor #10492 [2.3][Process] Remove unreachable code + avoid skipping tests in sigchild environment (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Remove unreachable code + avoid skipping tests in sigchild environment

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

As mentioned by @Tobion in https://github.com/symfony/symfony/pull/10480#issuecomment-38002910, I removed the dead code. I also fixed/updated the test suite on PHP compiled with `--enable-sigchild`.

Commits
-------

d52dd32 [Process] Remove unreachable code + avoid skipping tests in sigchild environment
2014-03-19 16:52:49 +01:00
Romain Neutron
d52dd32bad [Process] Remove unreachable code + avoid skipping tests in sigchild environment 2014-03-19 14:56:52 +01:00
Fabien Potencier
8ab7d58138 bug #10491 Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute (fabpot)
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #10491).

Discussion
----------

Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute

According to the HTML5 specification the required attribute should be allowed in this case: "A select element with a required attribute and **without** a multiple attribute, and whose size is “1”, must have a child option element."

Related PR: https://github.com/symfony/symfony/pull/9030

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

Commits
-------

f9aa676 Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute
2014-03-19 14:38:32 +01:00
Nick Stemerdink
861d3075b3 Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute 2014-03-19 14:38:32 +01:00
Fabien Potencier
d4a78fec32 minor #10142 [Tests] Added travis_retry to .travis.yml (lavoiesl)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10142).

Discussion
----------

[Tests] Added travis_retry to .travis.yml

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

As stated on their [blog](http://blog.travis-ci.com/2013-05-20-network-timeouts-build-retries/), this is the recommended way.

Example of a failed build because of it:
https://travis-ci.org/symfony/symfony/jobs/17664775

Commits
-------

702432a Added travis_retry to .travis.yml
2014-03-19 11:54:27 +01:00
Sébastien Lavoie
6db5014f4c Added travis_retry to .travis.yml
As stated on their [blog](http://blog.travis-ci.com/2013-05-20-network-timeouts-build-retries/), this is the recommended way.

Example of a failed build because of it:
https://travis-ci.org/symfony/symfony/jobs/17664775
2014-03-19 11:54:26 +01:00
Fabien Potencier
cc5f606356 minor #10484 [Process] fix some typos and refactor some code (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] fix some typos and refactor some code

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

Commits
-------

b422613 [Process] fix some typos and refactor some code
2014-03-19 07:27:25 +01:00
Fabien Potencier
1e9e8afa5d bug #10479 [2.3][Process] Fix escaping on Windows (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Fix escaping on Windows

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

Windows escaping is broken since the last merges.

After digging more on Windows escaping, I realised some things:
 - We forbid environment variable expansion by escaping `%APPDATA%` to `^%"APPDATA"^%`
 - We explicitly ask for variable expansion at runtime (running the command line with the [`/V:ON`](https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Process/Process.php#L235) flag). Running a command containing `!APPDATA!` will be escaped and expanded (our previous rule is easily overriden)
 - On platform that are not windows, we use strong escaping that prevents any variable expansion (`$PATH` will be escaped to `'$PATH'` that is not interpreted as the current PATH)

We have three possibilities:
 - Keep this behavior as this.
 - Prefer a consistent API and use a strong escaping strategy everywhere, but it would result in a BC break (see #8975).
 - Allow environment variable expansion and escape `%APPDATA%` to `"%APPDATA%"`

Any thoughts about this ?

Commits
-------

0f65f90 [Process] Fix escaping on Windows
2014-03-19 07:22:00 +01:00
Tobias Schultze
b4226137f6 [Process] fix some typos and refactor some code 2014-03-18 21:00:58 +01:00
Fabien Potencier
fccf8b509a minor #10483 [2.3][Process] Fix unit tests in sigchild disabled environment (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Fix unit tests in sigchild disabled environment

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

We've been a bit fast when merging #10480 and tests were broken in the last update I did.

Commits
-------

5f6ee12 [Process] Fix unit tests in sigchild disabled environment
2014-03-18 20:16:36 +01:00
Romain Neutron
5f6ee1205a [Process] Fix unit tests in sigchild disabled environment 2014-03-18 19:09:01 +01:00
Fabien Potencier
c57fbdad25 bug #10480 [Process] Fixed fatal errors in getOutput and getErrorOutput when process was not started (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Fixed fatal errors in getOutput and getErrorOutput when process was not started

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

This PR replaces #9452 and address the latest changes.
Side note : I've not updated `getExitCode`, `getExitCodeText` and `isSuccessful` as they were explicitly tested to return null in case the process is not started or terminated. I think it would be a BC break to do that.

Commits
-------

449fe01 [Process] Trow exceptions in case a Process method is supposed to be called after termination
0ae6858 [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
2014-03-18 19:00:11 +01:00
Romain Neutron
449fe01992 [Process] Trow exceptions in case a Process method is supposed to be called after termination 2014-03-18 18:34:51 +01:00
Fabien Potencier
e4c4a7d538 fixed typo 2014-03-18 17:51:19 +01:00
Fabien Potencier
442c4700a5 bug #10420 [2.3][Process] Make Process::start non-blocking on Windows platform (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Make Process::start non-blocking on Windows platform

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

This PR is a proposition that solves issue #9755.

Let me sum-up what problems we have on Windows platform:
 - We can not use pipes with `proc_open` on Windows because `stream_set_blocking` does not work on this platform, resulting in blocking pipes and a blocking `Process::start` (see https://bugs.php.net/bug.php?id=51800, https://bugs.php.net/bug.php?id=47918 and https://bugs.php.net/bug.php?id=50856).
 - We can not use file handles for both `STDOUT` and `STDERR` as it might produce corrupted content (see https://bugs.php.net/bug.php?id=65650).
 - We currently use file handles for `STDOUT` and pipe for `STDERR` but it makes `Process::start` blocking.

The solution I propose here is to use native redirections, write `STDERR` / `STDOUT` in temporary files, read these files, finally cleanup.
It works pretty well, all tests pass on Windows. Better : [previous tests that were specific to this platform](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Process/Tests/AbstractProcessTest.php#L720-725) disappear as unix one are now okay :).

The drawback of this is the need of using `taskkill`: When stopping a process (`Process::stop` or in case of a timeout reached) `proc_terminate` does not kill the underlying process properly, only the `cmd` parent. The underlying process run by Process still runs after the `proc_terminate` call, having a lock on the temporary files we're using for getting the output, avoiding PHP to remove them (or any user on system) until the underlying process has finish to run).
So I use the `taskkill` Windows command to terminate the underlying process. This works well but I've to admit it's not pretty. If we do not use this hack, let's face that the underlying process is not stopped.

Last but not least, let's deal with the case we're running on Windows platform with PHP having --enable-sigchild environment (I don't know if it can really happen)
In this case:
 - we can not retrieve the `pid`
 - we can not `taskkill` the underlying process
 - it runs
 - locks remain on temporary files, we might not be able to remove them
We can't really deal with this.

Feedback more than welcome

Commits
-------

1f5bf32 [Process] Make Process::start non-blocking on Windows platform
2014-03-18 15:17:47 +01:00
Max Voloshin
0ae685878c [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started 2014-03-18 15:14:03 +01:00
Romain Neutron
0f65f90b06 [Process] Fix escaping on Windows
Windows escaping is broken since the last merges.
2014-03-18 15:00:41 +01:00
Romain Neutron
1f5bf324fe [Process] Make Process::start non-blocking on Windows platform 2014-03-18 10:55:01 +01:00
Fabien Potencier
02088bc62f fixed CS 2014-03-17 16:43:11 +01:00
Fabien Potencier
433a13aef7 minor #10470 [server:run] [#10461] Add docs about custom environment (WouterJ)
This PR was merged into the 2.3 branch.

Discussion
----------

[server:run] [#10461] Add docs about custom environment

| Q             | A
| ------------- | ---
| Fixed tickets | #10461, https://github.com/symfony/symfony-docs/issues/3688
| License       | MIT

It's better to document this specific usecase in the command help.

Commits
-------

6871a61 [#10461] Add docs about custom environment
2014-03-17 16:42:55 +01:00
Wouter J
6871a614b9 [#10461] Add docs about custom environment 2014-03-17 16:16:17 +01:00
Fabien Potencier
2193f3db39 minor #10460 Typo fix at UploadedFile.php documentation (jbruni)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10460).

Discussion
----------

Typo fix at UploadedFile.php documentation

Commits
-------

ced3f04 Typo fix at UploadedFile.php documentation
2014-03-16 09:02:28 +01:00
J Bruni
d02e2aa7e8 Typo fix at UploadedFile.php documentation 2014-03-16 09:02:27 +01:00
Fabien Potencier
5d25c8dd4e bug #10455 [2.3][Process] Fix random failures in test suite on TravisCI (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Fix random failures in test suite on TravisCI

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

Commits
-------

783e377 [Process] Avoid failures because of slow IOs
238565e [Process] Avoid failure because of a slow process
173f8c5 [Process] Avoid failure when calling Process::stop in edge cases
2014-03-15 09:46:55 +01:00
Romain Neutron
783e377eed [Process] Avoid failures because of slow IOs
See example of failure here https://travis-ci.org/symfony/symfony/jobs/20701462
2014-03-14 19:58:01 +01:00
Romain Neutron
238565e93a [Process] Avoid failure because of a slow process
See example of failure here https://travis-ci.org/symfony/symfony/jobs/20761834.
2014-03-14 18:34:18 +01:00
Romain Neutron
173f8c5fd2 [Process] Avoid failure when calling Process::stop in edge cases
See https://travis-ci.org/symfony/symfony/jobs/20664994 for an example of failure.
2014-03-14 18:34:18 +01:00
Fabien Potencier
123dcac063 minor #10436 Update DefaultAuthenticationSuccessHandler.php (ureimers)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10436).

Discussion
----------

Update DefaultAuthenticationSuccessHandler.php

[Security] [Http] [Authentication] Fixed class description of DefaultAuthenticatioNSuccessHander

| Q             | A
| ------------- | ---
| Fixed tickets | none
| License       | MIT

Commits
-------

b458551 Update DefaultAuthenticationSuccessHandler.php
2014-03-14 13:21:43 +01:00
ureimers
7fc0c5f1fd Update DefaultAuthenticationSuccessHandler.php 2014-03-14 13:21:43 +01:00
Fabien Potencier
fe91a2ca62 bug #10448 [2.3][Process] Fix quoted arguments escaping (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Fix quoted arguments escaping

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

This PR replaces #8972

Commits
-------

de681cb [Process] Add tests on ProcessUtils::escapeArgument
85fb495 [Process] Fix: Arguments including space and quote are not correctly escaped (win)
2014-03-14 12:05:38 +01:00
Fabien Potencier
79e92f95d6 bug #10444 [DomCrawler] Fixed incorrect value name conversion in getPhpValues() and getPhpFiles() (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed incorrect value name conversion in getPhpValues() and getPhpFiles()

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

This PR replaces #10193

Commits
-------

89c599e [DomCrawler] Add tests for recursive cases of getPhpValues() and getPhpFiles()
e961f57 [DomCrawler] Fixed incorrect value name conversion in getPhpValues() and getPhpFiles()
2014-03-14 12:04:24 +01:00
Romain Neutron
de681cbf5c [Process] Add tests on ProcessUtils::escapeArgument 2014-03-14 10:50:34 +01:00
Michal Gebauer
85fb495a30 [Process] Fix: Arguments including space and quote are not correctly escaped (win)
Bad
`"bin" "command" \""bin"\"" "\""another command"\"`

Better
`"bin" "command" "\"bin" \"another command\""`
2014-03-14 10:10:26 +01:00
Fabien Potencier
9213a821d5 minor #10447 [Config][Loader] Code style fix (kdauzickas)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10447).

Discussion
----------

[Config][Loader] Code style fix

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

Commits
-------

6d84c04 Minor style fix
2014-03-14 08:52:52 +01:00
Karolis Daužickas
a8fcc416b8 Minor style fix 2014-03-14 08:52:52 +01:00