Commit Graph

9204 Commits

Author SHA1 Message Date
Arnaud Le Blanc
d17ba0e147 Fixed base URL detection when request URI contains encoded chars
Signed-off-by: Victor Berchet <victor@suumit.com>
2012-04-10 10:15:43 +02:00
Alessandro Desantis
78d6f3f0e0 [Filesystem] Written missing tests. 2012-04-10 10:15:30 +02:00
Alessandro Desantis
1998f3f5ec [Filesystem] Added silence operator to rename(). 2012-04-10 10:15:18 +02:00
Alessandro Desantis
7ce5a526ec [Filesystem] Fixed docs for rename(). 2012-04-09 21:19:37 +02:00
Alessandro Desantis
3f2865b90f [Filesystem] rename() throws RuntimeException on error (fixes #3848). 2012-04-09 20:56:50 +02:00
Jakub Zalas
efad5d5452 [Filesystem] Prevented infiite loop on windows while calling mirror on symlink. Added test for mirroring symlinks. 2012-04-09 15:14:36 +01:00
Fabien Potencier
d8652785cf merged branch eriksencosta/locale (PR #3840)
Commits
-------

31dde14 [Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4

Discussion
----------

[Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

[![Build Status](https://secure.travis-ci.org/eriksencosta/symfony.png?branch=locale)](http://travis-ci.org/eriksencosta/symfony)

---------------------------------------------------------------------------

by drak at 2012-04-08T23:20:20Z

This looks like a feature addition as opposed to a bug fix and if so, should probably go in the master branch rather than 2.0.

---------------------------------------------------------------------------

by stof at 2012-04-08T23:30:25Z

@drak it is a bug fix as the stub is meant to have the same behavior than the real intl

---------------------------------------------------------------------------

by drak at 2012-04-08T23:36:08Z

ok, thanks for the clarification, I wasnt sure.

---------------------------------------------------------------------------

by eriksencosta at 2012-04-08T23:44:22Z

@stof is right. I myself fixed it in master and then remembered that bug fixes should be made in 2.0.
2012-04-09 15:05:51 +02:00
Kim Hemsø Rasmussen
c36651bb6e Fixed spelling error 2012-04-09 10:21:42 +02:00
Eriksen Costa
31dde144ff [Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4 2012-04-08 19:21:28 -03:00
Fabien Potencier
127cff0aa8 merged branch Seldaek/process_fix (PR #3838)
Commits
-------

6dca141 [Process] Skip signal assertion on windows
4cd0fb4 [Process] Skip test that is still getting stuck on windows
e82a05d [Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation
f4227b5 [Process] Removing useless code (this is already done in updateStatus)
2d586d2 [Process] Fix a mistake triggering stream_select errors

Discussion
----------

Process fixes

A few fixes, including making the tests pass on windows and fixing composer/composer#543. Given the sensitivity of this code I did a bunch of very granular commits explaining everything.
2012-04-08 20:44:36 +02:00
Jordi Boggiano
6dca141de8 [Process] Skip signal assertion on windows 2012-04-08 20:29:02 +02:00
Jordi Boggiano
4cd0fb4c69 [Process] Skip test that is still getting stuck on windows 2012-04-08 20:28:28 +02:00
Jordi Boggiano
e82a05d3e7 [Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation 2012-04-08 20:27:37 +02:00
Jordi Boggiano
f4227b5f82 [Process] Removing useless code (this is already done in updateStatus) 2012-04-08 20:26:27 +02:00
Jordi Boggiano
2d586d245d [Process] Fix a mistake triggering stream_select errors 2012-04-08 20:26:04 +02:00
Fabien Potencier
da0eaa63cc merged branch Seldaek/at_op (PR #3837)
Commits
-------

f3408cc [Finder] Avoid unnecessary use of the @ operator

Discussion
----------

[Finder] Avoid unnecessary use of the @ operator

Tests are passing

---------------------------------------------------------------------------

by stof at 2012-04-08T17:42:01Z

Does PHP really throw an exception on failure or is it only the case when an error handler converts a warning to an exception ? It would be weird given the small amount of cases where PHP uses exceptions.

---------------------------------------------------------------------------

by Seldaek at 2012-04-08T17:43:51Z

```
$ php -r 'new DateTime("foo");'

Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (foo) at
position 0 (f): The timezone could not be found in the database' in Command line code on line 1
```

---------------------------------------------------------------------------

by Seldaek at 2012-04-08T17:45:09Z

In a constructor it's pretty hard to return false, so it has to throw an exception. The php.net docs also say it so I'm fairly sure it's nothing specific to my setup.
2012-04-08 20:00:30 +02:00
Jordi Boggiano
f3408ccf2c [Finder] Avoid unnecessary use of the @ operator 2012-04-08 19:39:04 +02:00
Fabien Potencier
27c41f1e8e merged branch stloyd/crawler_phpdoc (PR #3834)
Commits
-------

292364a [DomCrawler] Added some docbocks into DomCrawler classes. Closes #3832

Discussion
----------

[DomCrawler] Added some docbocks into DomCrawler classes, reordered func...

...tions to follow Symfony 2 CS. Closes #3832

---------------------------------------------------------------------------

by fabpot at 2012-04-08T10:38:39Z

Can you revert the code move as it makes merges between 2.0 and master much more complex. Thanks.

---------------------------------------------------------------------------

by stloyd at 2012-04-08T11:36:53Z

Reverted and changed commit message.

@fabpot Should I make PR for `master` according to CS ?

---------------------------------------------------------------------------

by stof at 2012-04-08T11:40:58Z

@stloyd this can be considered as a bugfix as you are fixing the phpdoc. So 2.0 is fine
2012-04-08 14:03:25 +02:00
Joseph Bielawski
292364ad70 [DomCrawler] Added some docbocks into DomCrawler classes. Closes #3832 2012-04-08 13:35:35 +02:00
Fabien Potencier
d6948581ac [TwigBundle] simplified code 2012-04-08 12:56:21 +02:00
Fabien Potencier
a11ec3e71c [TwigBundle] added correct file name in twig:lint exception reporting 2012-04-08 12:53:40 +02:00
Fabien Potencier
57c6aaa397 [TwigBundle] tweaked previous merge 2012-04-08 12:41:50 +02:00
Fabien Potencier
9c0fba93b2 merged branch marcw/feat-twig-lint (PR #3804)
Commits
-------

8726ade Adds more features to twig:lint command
1d7e9d9 Adds a linter command for templates

Discussion
----------

Adds a linter command for templates

Let's this PR be stoffed. ;)

---------------------------------------------------------------------------

by Tobion at 2012-04-06T15:48:18Z

Checking a single file is very limited. Checking a whole directory would be more useful, wouldn't it?

---------------------------------------------------------------------------

by willdurand at 2012-04-06T17:56:57Z

I think you should provide a way to validate all templates for a given bundle, something like:

    php app/console twig:lint @MySuperBundle

---------------------------------------------------------------------------

by henrikbjorn at 2012-04-06T18:03:45Z

Wouldnt it be better to throw some kind of exception if the lint is erroneous?

---------------------------------------------------------------------------

by marcw at 2012-04-07T11:22:34Z

@Tobion @willdurand  You can do that by combining unix tools.
@henrikbjorn Why ?

---------------------------------------------------------------------------

by marcw at 2012-04-07T11:27:11Z

Updated.

---------------------------------------------------------------------------

by dlsniper at 2012-04-07T13:15:53Z

@marcw it would be indeed nice to have support for a bundle/directory out of the box as some of the Symfony2 users might not be running unix or know the right commands to make this work.

I could help you with a PR in your repo if you want.

---------------------------------------------------------------------------

by henrikbjorn at 2012-04-07T18:55:34Z

@marcw as the console component will catch them and convert them into the right error code, also will display what went wrong instead of just dieing.

---------------------------------------------------------------------------

by marcw at 2012-04-08T09:15:37Z

Updated with all comments and requested features.
2012-04-08 12:39:25 +02:00
Bernhard Schussek
c4e68a3295 [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class
Setting a property path like "article.tags" will now automatically try to
favor addTag() and removeTag() over setTags(), if found. If you want to
set up a property path with an irregular singular that is not detected,
you can use "|" to separate the plural from the singular form in the
path: "article.genera|genus".

Another consequence of this commit is that the MergeCollectionListener has
been simplified a lot. Forms returning an array or a collection will
always result in adders/removers being called now without having to add
this listener.
2012-04-08 12:32:17 +02:00
Bernhard Schussek
65aa387da0 [Form] Fixed index generation in EntityChoiceList if ID is not an integer 2012-04-08 12:32:10 +02:00
marc.weistroff
8726ade310 Adds more features to twig:lint command 2012-04-08 11:14:51 +02:00
Fabien Potencier
5122d68c24 merged branch ruimarinho/exception_css_tweaks (PR #3827)
Commits
-------

fad114b Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags

Discussion
----------

Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build status](https://secure.travis-ci.org/ruimarinho/symfony.png?branch=exception_css_tweaks)
Fixes the following tickets: -
Todo: -

Ever been in a situation when you're debugging code wrapped around `<pre>` tags and that code throws an exception? If you're familiar with this screenshot, you have :-) ![Image](http://i.imgur.com/dwxdD.png)

This PR is just a little tweak to the exceptions layout CSS in order to allow your to view the exception message. It also fixes a word break when messages are too long. ![Image 2](http://i.imgur.com/whxZv.png).

The build is currently failing due to an unmerged patch from the 2.0 branch.
2012-04-08 09:24:17 +02:00
Fabien Potencier
0e525fc5ce merged 2.0 2012-04-08 09:22:35 +02:00
Fabien Potencier
c6096e323e merged branch eriksencosta/test-fixes (PR #3830)
Commits
-------

fdee352 [TwigBridge] updated suggested packages
dad1750 [TwigBridge] updated TestCase as an abstract class
140ac20 [TwigBridge] fixed bootstrap

Discussion
----------

[TwigBridge] updated Composer suggested packages and test fixes

---------------------------------------------------------------------------

by eriksencosta at 2012-04-08T06:13:53Z

Rebased.
2012-04-08 09:18:17 +02:00
Fabien Potencier
bca8c5feac merged branch jakzal/FilesystemBugFix (PR #3828)
Commits
-------

22e2ad8 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path.
bc93787 [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators.

Discussion
----------

[Filesystem] Fixed relative path calculation

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-04-08 09:16:07 +02:00
Eriksen Costa
fdee352619 [TwigBridge] updated suggested packages 2012-04-08 03:12:14 -03:00
Eriksen Costa
dad1750dfa [TwigBridge] updated TestCase as an abstract class 2012-04-07 18:49:17 -03:00
Eriksen Costa
140ac2014e [TwigBridge] fixed bootstrap 2012-04-07 18:47:00 -03:00
Jakub Zalas
22e2ad80c9 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path. 2012-04-07 21:52:26 +01:00
Jakub Zalas
bc93787a0d [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators. 2012-04-07 21:19:12 +01:00
Fabien Potencier
dee79e910d merged branch jakzal/SetCookieWithMultipleCookiesBugFix (PR #3823)
Commits
-------

7f92833 [BrowserKit] Fixed cs.
df3da28 [BrowserKit] Using assertNull instead of assertEquals.
87890d3 [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie.

Discussion
----------

[BrowserKit] Fixed CookieJar being unable to parse multiple cookies

Fix proposition for #3109

My fix splits value of *Set-Cookie* header by comma. Than it checks each extracted part if it starts with a cookie-name (token). If check is positive cookie is added to the list. Otherwise it's appended to the previous value. First element is always added to the list.

[rfc6265](http://tools.ietf.org/html/rfc6265) defines cookie-name with token:

    cookie-name = token
    token = <token, defined in [RFC2616], Section 2.2>

token is defined in [rfc2616](http://tools.ietf.org/html/rfc2616#section-2.2) as follows:

    token = 1*<any CHAR except CTLs or separators>
    CHAR = <any US-ASCII character (octets 0 - 127)>
    separators = "(" | ")" | "<" | ">" | "@"
                  | "," | ";" | ":" | "\" | <">
                  | "/" | "[" | "]" | "?" | "="
                  | "{" | "}" | SP | HT

That means cookie-name can be built out of following set of characters: *! # $ % & ' * + - . ^ _ ` | ~ 0-9 A-Z a-z*

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-04-07 21:57:48 +02:00
Jakub Zalas
7f928332a9 [BrowserKit] Fixed cs. 2012-04-07 19:45:50 +01:00
Fabien Potencier
0a7f4668e0 [Process] added a note about user-defined error exist codes 2012-04-07 20:15:50 +02:00
Fabien Potencier
34b1b6b17d merged branch bschussek/issue3661 (PR #3821)
Commits
-------

e0ce6b4 [Form] Fixed required value guessed by ValidatorTypeGuesser

Discussion
----------

[Form] Fixed required value guessed by ValidatorTypeGuesser

Bug fix: yes
Feature addition: no
Backwards compatibility break: no*
Symfony2 tests pass: yes
Fixes the following tickets: #3661
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3661)

The documentation states that a field is set to required if constrained with NotBlank or NotNull and to not required otherwise. Due to a bug this was not the case and fields were always required. This is now fixed.

The consequence is that some fields that were required before by default are not required anymore. The only difference is that the HTML5 "required" attribute disappears, because server-side validation did not occur before anyway.
2012-04-07 20:06:18 +02:00
Jakub Zalas
df3da289ad [BrowserKit] Using assertNull instead of assertEquals. 2012-04-07 18:45:48 +01:00
Jakub Zalas
87890d3a7c [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie. 2012-04-07 18:38:39 +01:00
Tom Van Looy
039ff6fc8e allow more control on GetSetMethodNormalizer by using callback functions and an ignoreAttributes list 2012-04-07 18:07:14 +02:00
Rui Marinho
fad114b76a Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags 2012-04-07 16:28:29 +01:00
Kim Hemsø Rasmussen
f1236844a8 Removed leftover from c/p 2012-04-07 17:15:32 +02:00
Bernhard Schussek
e0ce6b4c11 [Form] Fixed required value guessed by ValidatorTypeGuesser 2012-04-07 16:26:16 +02:00
marc.weistroff
1d7e9d9753 Adds a linter command for templates 2012-04-07 13:26:03 +02:00
Fabien Potencier
13aa515d65 merged branch jakzal/FilesystemTests (PR #3811)
Commits
-------

100e97e [Filesystem] Fixed warnings in makePathRelative().
f5f5c21 [Filesystem] Fixed typos in the docblocks.
d4243a2 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory.
11a676d [Filesystem] Added unit tests for mirror method.
8c94069 [Filesystem] Added unit tests for isAbsolutePath method.
2ee4b88 [Filesystem] Added unit tests for makePathRelative method.
21860cb [Filesystem] Added unit tests for symlink method.
a041feb [Filesystem] Added unit tests for rename method.
8071859 [Filesystem] Added unit tests for chmod method.
bba0080 [Filesystem] Added unit tests for remove method.
8e861b7 [Filesystem] Introduced workspace directory to limit complexity of tests.
a91e200 [Filesystem] Added unit tests for touch method.
7e297db [Filesystem] Added unit tests for mkdir method.
6ac5486 [Filesystem] Added unit tests for copy method.
1c833e7 [Filesystem] Added missing docblock comment.

Discussion
----------

[Filesystem] Fixed a bug in remove() being unable to unlink broken symlinks

While working on test coverage for Filesystem class I discovered a bug in remove() method.

Before removing a file a check is made if it exists:

    if (!file_exists($file)) {
        continue;
    }

Problem is [file_exists()](http://php.net/file_exists) returns false if link's target file doesn't exist. Therefore remove() will fail to delete a directory containing a broken link. Solution is to handle links a bit different:

    if (!file_exists($file) && !is_link($file)) {
        continue;
    }

Additionally, this PR improves test coverage of Filesystem component.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

---------------------------------------------------------------------------

by cordoval at 2012-04-07T00:55:59Z

✌.|•͡˘‿•͡˘|.✌

---------------------------------------------------------------------------

by fabpot at 2012-04-07T06:12:34Z

Tests do not pass for me:

    PHPUnit 3.6.10 by Sebastian Bergmann.

    Configuration read from /Users/fabien/work/symfony/git/symfony/phpunit.xml.dist

    .........................EE.......

    Time: 0 seconds, Memory: 5.25Mb

    There were 2 errors:

    1) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #0 ('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../')
    Uninitialized string offset: 29

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    2) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #1 ('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../')
    Uninitialized string offset: 16

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    FAILURES!
    Tests: 34, Assertions: 67, Errors: 2.

---------------------------------------------------------------------------

by jakzal at 2012-04-07T07:26:15Z

Sorry for this. For some reason my PHP error reporting level was to low to catch this...

Should be fixed now but I needed to modify the makePathRelative() (this bug existed before).
2012-04-07 10:18:55 +02:00
Fabien Potencier
e7dbc38941 merged branch eriksencosta/pt_BR-translations (PR #3817)
Commits
-------

bf51a58 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :)
dc94e27 [FrameworkBundle] synced pt_BR translations

Discussion
----------

synced and fixed pt_BR translations
2012-04-07 10:18:49 +02:00
Eriksen Costa
bf51a58f37 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :) 2012-04-07 04:30:12 -03:00
Eriksen Costa
dc94e27dbb [FrameworkBundle] synced pt_BR translations 2012-04-07 04:29:23 -03:00