This PR was merged into the master branch.
Commits
-------
310f691 [Propel1] Fixed preferred choices in the ModelChoiceList.
Discussion
----------
[Propel1] Fixed preferred choices in the ModelChoiceList
Related change was made in #6454 but for some reason part of that change was not merged from 2.1 branch.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: some Locale tests fail, fixed in #6568
Fixes the following tickets:
Todo: -
License of the code: MIT
Documentation PR: -
This PR was merged into the 2.0 branch.
Commits
-------
ba2d035 Restrict Monolog version to be in version <1.3
Discussion
----------
[2.0] Restrict Monolog version to be in version <1.3
Because of conflict between `HttpKernel\Log\LoggerInterface` and `Psr\Log\LoggerInterface` (PSR-3).
Main `composer.json` already restricts to proper version, but bridge allows also conflicting version.
---------------------------------------------------------------------------
by Seldaek at 2013-01-05T14:58:18Z
Looks fine, I will try to wrap up the 1.3.0 soon so you can migrate the code to use it (well it can already be done I guess in the master branch).
This PR was merged into the 2.0 branch.
Commits
-------
f299bd0 [Console] Make getTerminalWith & getTerminalHeight public
Discussion
----------
[Console] Make getTerminalWith & getTerminalHeight public
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Fixes the following tickets: ~
Todo: -
License of the code: MIT
Documentation PR: ~
After demand in #6567, I open an other one on the 2.0 branch.
This makes it consistent with 2.0 and 2.1.
We just need to check if version is 4.4 or 4.8 and we do not need to know if it is 4.8.0 or 4.8.1.1 (at least for now there are no big differences between minor ICU versions).
This PR was merged into the 2.1 branch.
Commits
-------
fa6fb6f [Process] Do not reset stdout/stderr pipes on Interrupted system call
Discussion
----------
[Process][2.1] Do not reset stdout/stderr pipes on stream_select failure
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
When `stream_select` is called and failed, pipes are currently reset to an empty array. As a result, both error-output and output are empty whereas the exitcode is 0 (successful process).
There is no reason (at least I don't see it) to reset pipes when an error occurs.
---------------------------------------------------------------------------
by fabpot at 2013-01-04T08:18:03Z
This behavior was introduced by @Seldaek in bcf8cf91. Any reason?
---------------------------------------------------------------------------
by Seldaek at 2013-01-04T17:22:33Z
The rationale was that if stream_select failed, it will fail every time (maybe this is an incorrect assumption and I introduced a bug there). Since the while loop checks for $this->pipes being not empty, if the process dies off and stream_select() starts failing, it will be stuck in the while loop forever. That's what I was fixing there. As far as I can tell, your fix reintroduces that problem. Can you explain a bit more what you mean by "error-output and output are empty"? Maybe adding a test for the case you are seeing would help too?
---------------------------------------------------------------------------
by romainneutron at 2013-01-04T17:47:00Z
Hi !
I'm actually using `Process` in a amqp client using PhpAmqpLib. Sometimes both output and error-output of a process are empty whereas the process returned with an exitcode equal to 0.
By *empty*, I mean that the output of both `$process->getOuptut()` and `$process->getErrorOuptut()` are equal to `''`.
I removed the `@` before the `stream_select` and realized that some calls where failing :
```
stream_select(): unable to select [4]: Interrupted system call (max_fd=13) in .../vendor/symfony/process/Symfony/Component/Process/Process.php on line 341
```
With my patch, it appears that if a `stream_select` call fails one time, it can be called with success a second time.
Adding a test case that triggers this error does not seem easy as it seems system related.
What do you think about it ?
---------------------------------------------------------------------------
by Seldaek at 2013-01-04T17:52:04Z
Ok I see. So I guess your fix makes sense since stream_select can fail legitimately, but it's not the whole story. If it fails because the process died off (or whatever the cause was on windows) we shouldn't keep trying forever. Maybe just adding a limit of N retries that is reset whenever a call succeeds would be enough to go over the odd system call being interrupted without allowing infinite loops. Not sure what N makes sense.
---------------------------------------------------------------------------
by igorw at 2013-01-04T17:53:45Z
As per the `stream_select` manpage it can return false when interrupted by a system call. That does not indicate that something is broken. However, I'm not sure if it is possible to distinguish between actual errors and interrupts without capturing and parsing the error message.
---------------------------------------------------------------------------
by romainneutron at 2013-01-04T18:50:56Z
I've updated the PR to consider the error message as it's currently the only solution to find out why `stream_select` failed
---------------------------------------------------------------------------
by romainneutron at 2013-01-04T18:59:15Z
Merged fixes suggested by @stloyd and @Seldaek
When `stream_select` is called and return false because of an `Interrupted
system call`, pipes are currently reset to an empty array.
As a result, both error-output and output are empty whereas the
exitcode is 0 (successful process).
This PR was merged into the 2.0 branch.
Commits
-------
73d9cef [Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
b2ce983 [Locale] Fix failing `StubIntlDateFormatter` tests in PHP 5.5
913b564 [Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
8ae773b [Form] Fix failing `MonthChoiceList` in PHP 5.5
f4ce2f1 Update .travis.yml
Discussion
----------
[2.0] Add testing of PHP 5.5 on Travis-CI & fix failing code
This PR was merged into the 2.1 branch.
Commits
-------
d601b13 use the right RequestMatcherInterface
Discussion
----------
use the right RequestMatcherInterface
this fixes#6470 by using the right interface
* 2.1: (24 commits)
updated license year
Update src/Symfony/Component/HttpFoundation/Response.php
[Form] Fixed inheritance of "error_bubbling" in RepeatedType
[Form] Fixed DateType when used with the intl extension disabled.
[HttpFoundation] fix return types and handling of zero in Response
[HttpFoundation] better fix for non-parseable Expires header date
Fixed missing plural message in portuguese validator
Fix Expires when the header is -1
[DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
[Console] fixed unitialized properties (closes#5935)
[Process] Prevented test from failing when pcntl extension is not enabled.
Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
[Form] Fixed failing tests for DateTimeToStringTransformer.
[Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
[Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
[Form] Fixed test regression introduced in #6440
[Tests] Fix namespaces
Fixed php doc of GenericEvent::__construct
HttpUtils must handle RequestMatcher too
use preferred_choices in favor of preferred_query
...
Conflicts:
src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
* 2.0:
updated license year
Update src/Symfony/Component/HttpFoundation/Response.php
[Console] fixed unitialized properties (closes#5935)
[Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
bumped Symfony version to 2.0.21-DEV
updated VERSION for 2.0.21
updated CHANGELOG for 2.0.21
Conflicts:
src/Symfony/Bundle/SwiftmailerBundle/LICENSE
src/Symfony/Component/Filesystem/LICENSE
src/Symfony/Component/HttpFoundation/Response.php
src/Symfony/Component/HttpKernel/Kernel.php
This PR was squashed before being merged into the master branch (closes#6391).
Commits
-------
7bad0ef [Console] Add autocomplete as you type
Discussion
----------
[Console] Add autocomplete as you type
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
License of the code: MIT
Finally got around to reviving the console autocomplete code.
Is now up to date with Symfony master. Also changed backspace behaviour to remove one character instead of two.
stty stuff is a mystery to a lot of people, so I've commented verbosely.
See also: https://github.com/symfony/symfony/pull/2364
---------------------------------------------------------------------------
by lmcd at 2012-12-17T10:11:16Z
@stof - updated with a better solution
---------------------------------------------------------------------------
by Seldaek at 2012-12-17T10:25:15Z
Seems pretty cool, but could you replace all `/usr/bin/env stty` calls by simply `stty`? That way it would also work on windows - if you have mingw or cygwin installed and stty is in the path at least. I don't see the benefit of doing the /usr/bin/env trick here. That's good for shebang lines because you need an absolute path, but in an exec/shell_exec call, you can rely on the PATH and just type the command name.
---------------------------------------------------------------------------
by lmcd at 2012-12-17T18:33:06Z
@Seldaek makes sense. Changed.
---------------------------------------------------------------------------
by lmcd at 2012-12-17T21:32:17Z
Tested on Mac OS X 10.8 and Ubuntu 12.04. Would be great to hear from people on Windows, cygwin and those with exotic terminal setups.
I'll update my fork of SensioGeneratorBundle a little later with support for this.
@fabpot - is there still time for this to land in 2.2?
---------------------------------------------------------------------------
by fabpot at 2012-12-17T21:34:23Z
If we have good feedback from Windows users, yes it can land in 2.2. ping @pborreli
---------------------------------------------------------------------------
by michelsalib at 2012-12-17T23:39:50Z
A am about to try on windows 7 with cmd, powershell and cygwin. Any other way to test without writing a new command using the helper ?
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:01:42Z
I tried on Windows 7 with cmd, powershell and cygwin and got this error: `Le chemin d'accès spécifié est introuvable.`. You can translate it to `The specified path could not be found`.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:01:43Z
I've updated SensioGeneratorBundle to support autocompletion on the `generate:doctrine:entity` command. It autocompletes bundle names, configuration formats and field types. See here: c627c67ce7
@michelsalib ping
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:03:43Z
@michelsalib - hmm. I imagine it's either a problem locating stty or some configuration issue on your end. Do you have file/line number?
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:04:41Z
Verbose mode did not help. Let me try with some dirty line by line check to see if I can give you a line.
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:09:54Z
My bad, I should have guessed that line 144 `exec('/usr/bin/env stty', $output, $exitcode);` cannot work on regular Windows environment. This should at least fails silently for users using cmd or powershell. Apparently cygwin users can activate stty. Let me investigate.
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:16:30Z
Ok, cygwin comes pre-bundled with stty. I applied the fix recommended by @Seldaek and it fixed the cygwin command.
The only remaining problem is that your redirect the output of the exec call to the console, in this case cmd and powershell output the error telling that stty is not defined in the system: `'stty' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.`.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:17:41Z
Ah, I see you're running the unit tests. The `hasSttyAvailable` method was lifted from `DialogHelper` where it is also used in `askHiddenResponse`. Question: is `defined('PHP_WINDOWS_VERSION_BUILD')` true for cygwin?
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:22:14Z
I am not running test, I am actually running a homemade command:
```
$dialog = $this->getHelper('dialog');
$ask = $dialog->ask($output, 'Autocomplete example', null, array(
'French', 'English', 'Chineese',
));
$output->writeln($ask);
```
`hasSttyAvailable` is called in the ask function at line 80. The incriminated function is here : 9ebcd4bac9/src/Symfony/Component/Console/Helper/DialogHelper.php (L411).
Also `defined('PHP_WINDOWS_VERSION_BUILD')` is true in the three of my consoles.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:27:16Z
@michelsalib see 7be142481c
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:28:20Z
Why keeping `/usr/bin/env` in your calls ? Cygwin cannot interpret it as long a stty is not in this folder.
---------------------------------------------------------------------------
by lmcd at 2012-12-18T00:29:30Z
@michelsalib `/usr/bin/env` was put there by someone else for the `askHiddenResponse` method. I can remove it, so long as it doesn't break something else.
---------------------------------------------------------------------------
by michelsalib at 2012-12-18T00:34:11Z
IMO users who want's to use stty should have it configured in the PATH, as @Seldaek said. Prefixing the folder where the stty "should" be is a nonsense to me. Moreover it might work well on *nix systems, but will never be compatible with cygwin.
I tested it locally (without the `/usr/bin/env` prefix) and now I have a nice autocomplete on Cygwin, and nothing on cmd or powershell. Which is just what I expected.
@lmcd very nice work :)
---------------------------------------------------------------------------
by lmcd at 2012-12-18T05:17:32Z
For anyone interested, you can scroll through available autocomplete options that match typed characters by using up and down arrow keys. This has been implemented in a seperate branch here: https://github.com/lmcd/symfony/tree/autocomplete-arrows
---------------------------------------------------------------------------
by drak at 2012-12-18T19:13:34Z
@lmcd - The console PRs never cease to amaze me. Really well done!
---------------------------------------------------------------------------
by fabpot at 2012-12-19T13:58:33Z
@lmcd Is it mergeable now?
---------------------------------------------------------------------------
by lmcd at 2012-12-19T17:59:09Z
@fabpot Yes.
---------------------------------------------------------------------------
by lmcd at 2012-12-19T20:03:31Z
Edit: commits squashed
---------------------------------------------------------------------------
by lmcd at 2012-12-19T21:29:07Z
@stloyd I have addressed the two things mentioned. I'm now using $i in place of strlen($ret) as it held the same value.
---------------------------------------------------------------------------
by fabpot at 2012-12-20T07:09:27Z
@lmcd: Thanks a lot for finishing this in time for 2.2. Before I can merge, there are two remaining tasks:
* add a note about the new feature in the CHANGELOG file of the Console component;
* create a PR on `symfony/symfony-docs` to explain the new feature.
Can you take care of that?
---------------------------------------------------------------------------
by lmcd at 2012-12-20T07:11:15Z
@fabpot sure
---------------------------------------------------------------------------
by stloyd at 2012-12-29T09:15:23Z
@lmcd You should squash your "merge" commit.
---------------------------------------------------------------------------
by lmcd at 2012-12-29T13:49:37Z
Well that screwed up. File Changed: 216 :S
Edit: hard reset to an earlier hash and reapplied the CHANGELOG commit. Should be good now ping @stloyd
---------------------------------------------------------------------------
by stloyd at 2012-12-29T14:33:58Z
@lmcd `ask()` method is quite long now, but in overall looks ok =)
---------------------------------------------------------------------------
by lmcd at 2013-01-02T20:49:49Z
Anything preventing this being merged? Ping @fabpot
This PR was submitted for the master branch but it was merged into the 2.0 branch instead (closes#6525).
Commits
-------
0b5f1e3 Update src/Symfony/Component/HttpFoundation/Response.php
Discussion
----------
Update src/Symfony/Component/HttpFoundation/Response.php
Fix phpdoc typo
This PR was merged into the master branch.
Commits
-------
29b9611 [Finder] Added support for GLOB patterns in the directories passed to the in() method.
Discussion
----------
[Finder] Added support for wildcard characters (GLOB patterns)
Added support for wildcard characters in the paths passed to the *in()* method. Each pattern has to resolve to at least one directory, otherwise exception is thrown (just like when path to an invalid directory is passed).
Example usage:
```php
$finder = new \Symfony\Component\Finder\Finder();
$files = $finder->files()
->name('validators.en.*')
->in(array(
'src/Symfony/*/*/Resources/translations',
));
foreach ($files as $file) {
var_dump($file->getRealPath());
}
```
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5450
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#2089
This PR was merged into the 2.1 branch.
Commits
-------
6c5e615 [Form] Fixed DateType when used with the intl extension disabled.
Discussion
----------
[Form] Fixed DateType when used with the intl extension disabled
DateType's month select box returns timestamps when used with intl extension disabled (see #6485).
The reason for this is that stubbed formats use *L* instead of *M* for month representation. My fix is simply taking this into account when building array for the select box.
I didn't provide unit tests since they're disabled when intl extension is not enabled. I've only manually verified if the months array contains correct data.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6485
Todo: -
License of the code: MIT
Documentation PR: -
---------------------------------------------------------------------------
by bschussek at 2013-01-03T17:41:47Z
Doesn't this call for fixing the stub instead of changing the Form component?
---------------------------------------------------------------------------
by stof at 2013-01-03T17:50:49Z
@bschussek L and M are both valid for the month in Intl
---------------------------------------------------------------------------
by jakzal at 2013-01-03T17:52:41Z
[StubIntlDateFormatter uses FullTransformer](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php#L206) to format the date. [FullTransformer supports both *L* and *M*](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php#L50) formats. Both formats are treated interchangeably.
This PR was merged into the 2.1 branch.
Commits
-------
c526ad9 [Form] Fixed inheritance of "error_bubbling" in RepeatedType
Discussion
----------
[Form] Fixed inheritance of "error_bubbling" in RepeatedType
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
This PR was merged into the 2.1 branch.
Commits
-------
10b01c9 [HttpFoundation] fix return types and handling of zero in Response
75952af [HttpFoundation] better fix for non-parseable Expires header date
Discussion
----------
[HttpFoundation] Response fixes
First commit is a better solution for #6471 and also fixes several phpdocs.
The second commit fixes the return types and handling of zero.
---------------------------------------------------------------------------
by Tobion at 2013-01-02T21:16:25Z
@dlsniper cc
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes#6534).
Commits
-------
a5e7fdf Fixed missing plural message in portuguese validator
Discussion
----------
[Validator] Fixed missing plural message
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Fixes the following tickets: #6151
Todo: -
License of the code: -
Documentation PR: -
This PR was squashed before being merged into the 2.1 branch (closes#6471).
Commits
-------
87b6cc2 Fix Expires when the header is -1
Discussion
----------
Fix Expires when the header is -1
This fixes the issue described in #6469.
Let me know if I've missed something.
Thanks.
---------------------------------------------------------------------------
by blaugueux at 2012-12-27T20:22:23Z
@dlsniper how can i help here, i really need to fix this issue
---------------------------------------------------------------------------
by dlsniper at 2012-12-27T20:28:53Z
I think @fabpot needs to get me some feedback on this but meanwhile you should try the proposed patch and let me know if it fixes the problem for you or I should add more tests to this.
Thanks!
---------------------------------------------------------------------------
by blaugueux at 2012-12-30T14:37:58Z
@dlsniper your patch is working great for me but it breaks tests. I agree that @fabpot point of view is required.
---------------------------------------------------------------------------
by dlsniper at 2012-12-30T18:38:38Z
@blaugueux Can you let me know what tests are failing? the one included in this PR or some custom ones from you? If it's the later, can you share some so that I can add them?
Thanks!
---------------------------------------------------------------------------
by arendjantetteroo at 2013-01-02T12:45:48Z
The headerbag fix works here. I'm not sure if the extra check in Response is really necessary, it works here without it.