Commit Graph

13188 Commits

Author SHA1 Message Date
Christophe Coevoet
80438c2dd9 Fixed the XPath filtering to have the same behavior than Symfony 2.4 2014-05-21 15:39:40 +02:00
Robbert Klarenbeek
711ac32d71 [DomCrawler] Fixed filterXPath() chaining 2014-05-21 15:37:53 +02:00
Christophe Coevoet
8f706c97b9 [DomCrawler] Added more tests for the XPath filtering
This will ensure we don't introduce regressions again when fixing #10206.
2014-05-21 15:33:53 +02:00
realmfoo
6f56d878c9 [HttpKernel] fixed file uploads in functional tests when no file was selected
Allow user to submit a form with no file selected.
2014-05-21 14:41:36 +02:00
Bernhard Schussek
fad38e82f4 Fixed test cases failing when the Intl extension is not installed 2014-05-21 13:33:13 +02:00
Fabien Potencier
11816c5e51 fixed CS 2014-05-18 17:36:43 +02:00
Benoît Lévêque
4735e56c44 Fix "absolute path" when we look to the cache directory
We should get __DIR__ instead of __DIR__ . '/.'
2014-05-18 17:35:30 +02:00
Fabien Potencier
309046a207 minor #10928 [DomCrawler] Fixed the coding standards to use strict comparisons (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed the coding standards to use strict comparisons

| 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

Many places in DomCrawler are using loose comparison instead of strict comparison. I saw them while checking the whole component for DOMNode vs DOMElement usage whe working on #10927. However, I submitted this change to 2.3 instead, to ease merging between branches (applying the change only in master would likely create conflicts regularly when merging changes in DomCrawler between branches later)

Commits
-------

77b446c [DomCrawler] Fixed the coding standards to use strict comparisons
2014-05-17 18:25:57 +02:00
Fabien Potencier
8c71454f47 bug #10908 [HttpFoundation] implement session locking for PDO (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] implement session locking for PDO

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

This is probably the first Session Handler for databases that actually works with locking. I've seen many implementations of session handlers (mostly only for one database vendor) while researching and none used locking. Not even the [PHPs SQLite session handler](https://github.com/php/php-src/blob/PHP-5.3/ext/sqlite/sess_sqlite.c) or [PECL Postgres Handler](http://svn.php.net/viewvc/pecl/session_pgsql/trunk/session_pgsql.c?revision=326806&view=markup) implemented locking  correctly which is probably the reason why they have been discontinued. [Zend Session](https://github.com/zendframework/zf2/blob/master/library/Zend/Session/SaveHandler/DbTableGateway.php) seems not to use locking either. But it saves the lifetime together with the session which seems like a good idea because you could have different lifetimes for different sessions.

- Implements session locking for MySQL, Postgres, Oracle, SQL Server and SQLite.
Only tested it for MySQL. So would be good if someone can confirm it works as intended on the other databases as well.
- Also removed the custom RuntimeException which is not useful and a PDOException extends RuntimeException anyway, so no BC break.
- I added a default for the table name to be in line with the DoctrineSessionHandler.
- Check session.gc_maxlifetime in read(). Imagine we have only ever one user on an app. If maxlifetime is not checked in read, his session would never expire! What I don't get is why PHP calls gc() after read() instead of calling it before... Strange decision. For this reason I also had to do the following to improve performance.
- I delay gc() to close() so that it is executed outside the transactional and blocking read-write process. This way, pruning expired sessions does not block them from being started while the current session is used.
- Fixed time update for Oracle and SQL Server.

Commits
-------

50ec828 [HttpFoundation] implement session locking for PDO
2014-05-17 18:24:28 +02:00
Tobias Schultze
50ec828642 [HttpFoundation] implement session locking for PDO 2014-05-17 17:01:15 +02:00
Christophe Coevoet
77b446c904 [DomCrawler] Fixed the coding standards to use strict comparisons 2014-05-17 15:36:43 +02:00
Fabien Potencier
735e9a4768 bug #10894 [HttpKernel] removed absolute paths from the generated container (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] removed absolute paths from the generated container

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | first step to resolve #6484, #3079, and #9238
| License       | MIT
| Doc PR        | n/a

This PR converts absolute paths to relative ones in the dumped container. The code is a bit "ugly", but it gets the job done and I'm not sure that there is a more elegant way without breaking everything.

Commits
-------

c1450b4 [HttpKernel] removed absolute paths from the generated container
2014-05-17 15:25:10 +02:00
Fabien Potencier
c1450b465c [HttpKernel] removed absolute paths from the generated container 2014-05-17 14:44:20 +02:00
Fabien Potencier
5c91dc1a3a bug #10926 [DomCrawler] Fixed the initial state for options without value attribute (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed the initial state for options without value attribute

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

Commits
-------

78cff96 [DomCrawler] Fixed the initial state for options without value attribute
2014-05-17 13:54:50 +02:00
Christophe Coevoet
78cff96230 [DomCrawler] Fixed the initial state for options without value attribute 2014-05-17 12:51:37 +02:00
Christophe Coevoet
b505708ddd Fixed the handling of boolean attributes in ChoiceFormField
An option is marked as selected by the presence of the selected attribute,
not by the presence of a non-empty selected attribute. The same is true
for checked radio buttons or checkboxes.
2014-05-17 12:38:54 +02:00
Fabien Potencier
0762bae059 bug #10777 [Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed (tucksaun)
This PR was squashed before being merged into the 2.3 branch (closes #10777).

Discussion
----------

[Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed

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

Same issue as #9976 and #10203: when you add a `time` field to a form with options `single_text` (so HTML5) and `with_seconds`, the generated input does not contain the `step` attribute, therefore the browser does not show them, leading to an error at the submit because of an invalid format.

Compared to #9976/#10203:
* Unit testable
* Available directly in the component
* Available in other templating format than twig
* Still able to customise the step attribute by hand

Commits
-------

a379298 [Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed
2014-05-16 13:54:17 +02:00
Tugdual Saunier
a379298db9 [Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed 2014-05-16 13:54:15 +02:00
Charles Sarrazin
c7a77c55b7 Fixed incorrect regular plural for -ves words
Fixes singularization for words like caves (cave), staves (staff).
2014-05-16 11:27:00 +02:00
Jakub Zalas
619ff5818f Explicitly define the encoding. 2014-05-14 14:35:53 +01:00
Fabien Potencier
7b93db5ba8 bug #10897 [Console] Fix a console test (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] Fix a console test

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

re #10714

Every wide character in the fixture file is actually 3 ansi-characters long.

Commits
-------

61108b9 Disable 5.6 until it is stable again.
8cadb49 Update the fixtures.
2014-05-14 08:44:39 +02:00
Fabien Potencier
a44945a306 bug #10896 [HttpKernel] Fixed cache behavior when TTL has expired and a default "global" TTL is defined (alquerci, fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Fixed cache behavior when TTL has expired and a default "global" TTL is defined

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

From #9919:

"When the cache is stale the `validate` method `forward` the request to the backend. A new response will be created with or without TTL configuration. If the TTL was not set then the default one should be set like in the `fetch` method."

This PR fixes this issue, the tests provided in #9919 pass, and I've tweaked them to avoid the costly sleep calls.

Commits
-------

e3983e8 [HttpKernel] fixed default TTL not applied under certain conditions
bc42dae Added test when TTL has expired
2014-05-13 17:22:15 +02:00
Jakub Zalas
8cadb49613 Update the fixtures. 2014-05-13 14:44:05 +01:00
Fabien Potencier
46725c9cc8 fixed CS 2014-05-13 10:47:23 +02:00
Fabien Potencier
e3983e8ec5 [HttpKernel] fixed default TTL not applied under certain conditions 2014-05-12 17:25:47 +02:00
alquerci
bc42dae162 Added test when TTL has expired 2014-05-12 17:07:07 +02:00
Geoffrey Brier
ab1198f4da [DomCrawler] Fixed image input case sensitive 2014-05-12 11:38:26 +02:00
Fabien Potencier
d9fec7065b minor #10890 Lower mbstring dep, remove it for Yaml and CssSelector components (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Lower mbstring dep, remove it for Yaml and CssSelector components

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

Commits
-------

a4b805d Lower mbstring dep, remove it for Yaml and CssSelector components
2014-05-12 11:26:07 +02:00
Fabien Potencier
a29a60debd bug #10714 [Console]Improve formatter for double-width character (denkiryokuhatsuden)
This PR was squashed before being merged into the 2.3 branch (closes #10714).

Discussion
----------

[Console]Improve formatter for double-width character

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes for one that expecting current broken output
| Deprecations? | no
| Fixed tickets |
| Tests pass?   | yes
| License       | MIT
| Doc PR        |

EDIT: fixed the table above not to remove irrelevant line

As mb_strlen just returns "how many chars in the string",
formatting with double-width character is bit broken.

The test I add is skipped when mbstring extension is not loaded.
I'm afraid if some of you cannot properly display japanese string.
(表示するテキスト just means "Some text to display")

Commits
-------

a52f41d [Console]Improve formatter for double-width character
2014-05-12 11:19:00 +02:00
Daisuke Ohata
a52f41d414 [Console]Improve formatter for double-width character 2014-05-12 11:16:18 +02:00
Nicolas Grekas
a4b805dbf2 Lower mbstring dep, remove it for Yaml and CssSelector components 2014-05-12 11:13:35 +02:00
Fabien Potencier
1a64fef828 bug #10872 [Form] Fixed TrimListenerTest as of PHP 5.5 (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Fixed TrimListenerTest as of PHP 5.5

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

Commits
-------

b0bc83d [Form] Fixed TrimListenerTest as of PHP 5.5
2014-05-12 11:08:11 +02:00
Fabien Potencier
894b4a09b5 bug #10762 [BrowserKit] Allow URLs that don't contain a path when creating a cookie from a string (thewilkybarkid)
This PR was merged into the 2.3 branch.

Discussion
----------

[BrowserKit] Allow URLs that don't contain a path when creating a cookie from a string

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

The Cookie class doesn't require a path, but the `fromString()` static method does, so when URL given is something like http://www.example.com (ie no trailing slash) it currently throws an exception. This PR removes the requirement.

Commits
-------

fc1223f Allow URLs that don't contain a path
2014-05-09 17:26:55 +02:00
Arturs Vonda
a605a3d925 [Security] Add check for supported attributes in AclVoter 2014-05-08 18:38:48 +02:00
Bernhard Schussek
b0bc83d2ac [Form] Fixed TrimListenerTest as of PHP 5.5 2014-05-08 17:34:38 +02:00
Wouter J
239b738e98 Added more IDE links 2014-05-05 21:19:04 +02:00
n-aleha
93544aadfa [DependencyInjection] Fix parameter description in ConfigurationExtensionInterface
| Q             | A
| ------------- | ---
| Fixed tickets | #10845
| License       | MIT

This fixes the description of parameter `array $config` in file ConfigurationExtensionInterface.php by removing the extra `$config`.
2014-05-02 22:42:57 +00:00
Fabien Potencier
c6d88a8cf8 bug #10833 [TwigBridge][Transchoice] set %count% from the current context. (aitboudad)
This PR was merged into the 2.3 branch.

Discussion
----------

[TwigBridge][Transchoice] set %count% from the current context.

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

Commits
-------

8f7b2cc [TwigBridge][Transchoice] set %count% from the current context.
2014-05-02 09:31:13 +02:00
Hugo Hamon
f3b0ef1a6f [Finder] fixed typehint of the Finder::addAdapter() method 2014-05-02 00:38:16 +02:00
Abdellatif Ait boudad
8f7b2cc44d [TwigBridge][Transchoice] set %count% from the current context. 2014-05-01 19:10:47 +01:00
Fabien Potencier
d1267cb2d7 minor #10819 Fix a test that was ambiguous (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix a test that was ambiguous

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | see #9634 for a discussion of this and #9383 for the report
| License       | MIT
| Doc PR        | n/a

This PR fixes a test that was always passing as the exception catch was catching the PHP notice but also the exception sent by `fail`, so it was useless. That said, I'm not even convinced that this test is useful at all.

Commits
-------

a94b4e0 [Validator] fixed wrong test
2014-05-01 08:28:42 +02:00
Fabien Potencier
1b6daf304f minor #10826 [2.3] Fix phpunit test suite on travis #2 (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] Fix phpunit test suite on travis #2

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

This is a second approach to solve #10821.
Something is weird: `Symfony\Component\Form\Tests\Extension\Core\EventListener\TrimListenerTest` passes when using PHPUnit as phar and fails when using a composer global install

Commits
-------

32e5f67 [DependencyInjection] Fix travis unit tests
c7befd5 Update PHPUnit before run
2014-04-30 18:56:37 +02:00
Romain Neutron
32e5f6727a [DependencyInjection] Fix travis unit tests 2014-04-30 17:29:47 +02:00
Fabien Potencier
a94b4e0ae2 [Validator] fixed wrong test 2014-04-30 16:30:03 +02:00
Tugdual Saunier
16dd0e5dda [WebProfilerBundle] added test case for #10773 2014-04-30 10:15:45 +02:00
Tugdual Saunier
5b91e70777 [WebProfilerBundle] fixed profiler homepage, fixed #10806 2014-04-30 10:11:17 +02:00
Tugdual Saunier
7b425d229d [WebProfilerBundle] Added test case for #10806 2014-04-30 10:11:11 +02:00
umpirsky
f308f521a6 Fixed issue #5427 2014-04-30 08:40:38 +02:00
Nicolas Grekas
b147cfaf15 [Debug] fix #10313: FlattenException not found because of https://bugs.php.net/42098 2014-04-29 21:42:43 +02:00
Nicolas Grekas
988a5dc937 [Debug] fix ErrorHandlerTest when context is not an array 2014-04-28 20:50:14 +02:00