Commit Graph

17291 Commits

Author SHA1 Message Date
Nicolas Grekas
e3255bf525 [Debug] better ouf of memory error handling 2014-05-21 14:34:28 +02:00
Nicolas Grekas
dfa8ff87f3 [Debug] cleanup interfaces before 2.5-final 2014-05-20 09:56:04 +02:00
Fabien Potencier
b2855a55dd Merge branch '2.4'
* 2.4:
  fixed CS
  Fix "absolute path" when we look to the cache directory
2014-05-18 17:36:54 +02:00
Fabien Potencier
04fb11305f Merge branch '2.3' into 2.4
* 2.3:
  fixed CS
  Fix "absolute path" when we look to the cache directory
2014-05-18 17:36:48 +02:00
Fabien Potencier
11816c5e51 fixed CS 2014-05-18 17:36:43 +02:00
Fabien Potencier
7dc8931969 bug #10937 [HttpKernel] Fix "absolute path" when we look to the cache directory (BenoitLeveque)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #10937).

Discussion
----------

[HttpKernel] Fix "absolute path" when we look to the cache directory

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

We should get ``__DIR__`` instead of ``__DIR__ . '/.'``

I've seen this issue when trying to play with the symfony standard new directory structure

Commits
-------

4735e56 Fix "absolute path" when we look to the cache directory
2014-05-18 17:35:30 +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
492f7a38c7 bug #10933 Changed the default value of checkbox and radio to match the HTML spec (stof)
This PR was merged into the 2.5-dev branch.

Discussion
----------

Changed the default value of checkbox and radio to match the HTML spec

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

When the checkbox or radio input does not have a value attribute, the [HTML spec](http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#checkbox-state-%28type=checkbox%29) defines that the value [should be ``on``](http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-value-default-on), not ``1``.

This change is a small BC break as a testsuite with an assertion on the ``1`` value would fail after the change. However, this means that such testsuite would assert a different behavior than the real usage of the application.
Note that people using the DomCrawler component on pages using the Symfony Form component are not affected by the change as the Form component always set an explicit value on checkboxes and radio buttons

Commits
-------

186b65e Changed the default value of checkbox and radio to match the HTML spec
2014-05-17 22:50:45 +02:00
Fabien Potencier
53661a2338 Merge branch '2.4'
* 2.4:
  [HttpFoundation] implement session locking for PDO
  [DomCrawler] Fixed the coding standards to use strict comparisons
  [HttpKernel] removed absolute paths from the generated container
  [DomCrawler] Fixed the initial state for options without value attribute
  Fixed the handling of boolean attributes in ChoiceFormField
  Fixed FormDataExtractorTest_SimpleValueExporter::exportValue not implementing the interface correctly
  Updated form dev dependencies
2014-05-17 22:48:44 +02:00
Fabien Potencier
7027068f21 Merge branch '2.3' into 2.4
* 2.3:
  [HttpFoundation] implement session locking for PDO
  [DomCrawler] Fixed the coding standards to use strict comparisons
  [HttpKernel] removed absolute paths from the generated container
  [DomCrawler] Fixed the initial state for options without value attribute
  Fixed the handling of boolean attributes in ChoiceFormField

Conflicts:
	src/Symfony/Component/DomCrawler/Tests/Field/ChoiceFormFieldTest.php
	src/Symfony/Component/HttpKernel/Tests/KernelTest.php
2014-05-17 22:48:34 +02:00
Christophe Coevoet
186b65ea5d Changed the default value of checkbox and radio to match the HTML spec
When the checkbox or radio input does not have a value attribute, the HTML
spec defines that the value should be 'on', not '1'.
2014-05-17 22:15:05 +02:00
Fabien Potencier
2c6bdd82ce bug #10927 [DomCrawler] Changed typehints form DomNode to DomElement (stof)
This PR was merged into the 2.3-dev branch.

Discussion
----------

[DomCrawler] Changed typehints form DomNode to DomElement

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | only for people hacking the internal classes (which requires replacing the crawler too)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10924
| License       | MIT
| Doc PR        | n/a

Commits
-------

f416e70 [DomCrawler] Changed typehints form DomNode to DomElement
2014-05-17 18:27:25 +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
Christophe Coevoet
f416e7044c [DomCrawler] Changed typehints form DomNode to DomElement
Closes #10924
2014-05-17 15:27:23 +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
Fabien Potencier
e4a28dd420 bug #10925 [DomCrawler] Fixed the handling of boolean attributes in ChoiceFormField (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed the handling of boolean attributes in ChoiceFormField

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

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.

Commits
-------

b505708 Fixed the handling of boolean attributes in ChoiceFormField
2014-05-17 13:53:12 +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
75ccdb0e37 minor #10923 [Security] removed an unused parameter in some private methods (issei-m)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Security] removed an unused parameter in some private methods

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

Commits
-------

f9f3852 [Security] removed an unused parameter in some private methods
2014-05-17 11:54:34 +02:00
Issei.M
f9f385252d [Security] removed an unused parameter in some private methods 2014-05-17 17:07:33 +09:00
Fabien Potencier
825867208e feature #10882 Fix issue #10867 (umpirsky)
This PR was merged into the 2.5-dev branch.

Discussion
----------

Fix issue #10867

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

Commits
-------

0cc9746 Fix issue #10867
2014-05-16 16:54:34 +02:00
Fabien Potencier
3c179454f6 minor #10900 Update MessageSelector.php to show which value was passed (t3chn0r)
This PR was merged into the 2.5-dev branch.

Discussion
----------

Update MessageSelector.php to show which value was passed

When the translator can't find a correct match using transChoice() a string is logged today with the following text:

<em>Unable to choose a translation for "[string]" with locale "[locale]". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").</em>

This change introduces the value that was passed to transChoice() so the developer will have more information as to what value did not match any of the translation options:

<em>Unable to choose a translation for "[string]" with locale "[locale]" for value "[value]". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").</em>

Commits
-------

af99997 Update MessageSelector.php to show which value was passed
2014-05-16 16:53:25 +02:00
Fabien Potencier
0eddb84a93 bug #10902 [Yaml] Fixed YAML Parser does not ignore duplicate keys, violating YAML spec. (sun)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Yaml] Fixed YAML Parser does not ignore duplicate keys, violating YAML spec.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | **mayhaps**
| Deprecations? | no
| Tests pass?   | yes
| Needs merge to | 2.4
| Fixed tickets | —
| License       | MIT
| Doc PR        | —

The current [YAML 1.2] specification clearly states:

> JSON's RFC4627 requires that mappings keys merely “SHOULD” be unique, while YAML insists they “MUST” be.

The outdated [YAML 1.1] spec contained a crystal clear note on how the error of duplicate keys is to be handled by parsers, which is (sadly) no longer contained in the latest 1.2 spec (only leaving the requirement):

> It is an error for two equal keys to appear in the same mapping node.  In such a case the YAML processor may continue, ignoring the second `key: value` pair and issuing an appropriate warning.  This strategy preserves a consistent information model for one-pass and random access applications.

[YAML 1.2]: http://yaml.org/spec/1.2/spec.html#id2759572
[YAML 1.1]: http://yaml.org/spec/1.1/#id932806

Commits
-------

951acca Fixed YAML Parser does not ignore duplicate keys, violating YAML spec.
2014-05-16 16:51:09 +02:00
Fabien Potencier
a61fddb202 minor #10916 [Validator] Updated outdated dependencies. (csarrazi)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Validator] Updated outdated dependencies.

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

Fixes tests for the ```Validator``` component when using it as a standalone library (when running ```phpunit``` from the ```src/Symfony/Component/Form``` directory.

Commits
-------

1984a36 [Validator] Updated outdated dependencies.
2014-05-16 16:48:43 +02:00
Fabien Potencier
5a4bf3e938 feature #10912 [Form] Added support for injecting HttpFoundation's Request in ServerParams for the Validator extension (csarrazi)
This PR was merged into the 2.4-dev branch.

Discussion
----------

[Form] Added support for injecting HttpFoundation's Request in ServerParams for the Validator extension

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

The Request object should be injected in the ```ServerParams``` object before using it in the extension, if one wishes to use Symfony2's ```Request``` to fetch the server parameters.

Commits
-------

86f9cb9 Added support for injecting HttpFoundation's RequestStack in ServerParams
2014-05-16 16:46:17 +02:00
Charles Sarrazin
86f9cb90eb Added support for injecting HttpFoundation's RequestStack in ServerParams 2014-05-16 16:44:46 +02:00
Charles Sarrazin
1984a364f8 [Validator] Updated outdated dependencies. 2014-05-16 16:25:29 +02:00
sun
951acca387 Fixed YAML Parser does not ignore duplicate keys, violating YAML spec.
The current [YAML 1.2] specification clearly states:

> JSON's RFC4627 requires that mappings keys merely “SHOULD” be unique, while YAML insists they “MUST” be.

The outdated [YAML 1.1] spec contained a crystal clear note on how the error of duplicate keys is to be handled by parsers, which is (sadly) no longer contained in the latest 1.2 spec (only leaving the requirement):

> It is an error for two equal keys to appear in the same mapping node.  In such a case the YAML processor may continue, ignoring the second `key: value` pair and issuing an appropriate warning.  This strategy preserves a consistent information model for one-pass and random access applications.

[YAML 1.2]: http://yaml.org/spec/1.2/spec.html#id2759572
[YAML 1.1]: http://yaml.org/spec/1.1/#id932806
2014-05-16 16:25:18 +02:00
Fabien Potencier
5be0125c82 minor #10911 [Form] Composer dependencies (csarrazi)
This PR was merged into the 2.4 branch.

Discussion
----------

[Form] Composer dependencies

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

Right now, launching tests from the Form component's directory doesn't work, due to missing dev dependencies. This should be merged back into master afterwards.

Also fixed a problem related to a bad method signature in ```Symfony\Component\Form\Tests\Extension\DataCollector\FormDataExtractorTest_SimpleValueExporter```

Commits
-------

7b5857c Fixed FormDataExtractorTest_SimpleValueExporter::exportValue not implementing the interface correctly
e4fa5d8 Updated form dev dependencies
2014-05-16 15:43:51 +02:00
Charles Sarrazin
7b5857ca61 Fixed FormDataExtractorTest_SimpleValueExporter::exportValue not implementing the interface correctly 2014-05-16 13:59:23 +02:00
Charles Sarrazin
e4fa5d8cc3 Updated form dev dependencies 2014-05-16 13:58:11 +02:00
Fabien Potencier
be1b917d21 Merge branch '2.4'
* 2.4:
  [Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed
  Fixed incorrect regular plural for -ves words
  [HttpKernel] Replace sha1 with sha256 in recently added tests.
2014-05-16 13:54:37 +02:00
Fabien Potencier
c94f69ddcb Merge branch '2.3' into 2.4
* 2.3:
  [Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed
  Fixed incorrect regular plural for -ves words
2014-05-16 13:54:29 +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
Fabien Potencier
912a72f555 bug #10909 [PropertyAccess] Fixed plurals for -ves words (csarrazi)
This PR was merged into the 2.3 branch.

Discussion
----------

[PropertyAccess] Fixed plurals for -ves words

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

Fixes singularization for words like caves (cave), staves (staff).

Commits
-------

c7a77c5 Fixed incorrect regular plural for -ves words
2014-05-16 12:09:36 +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
Fabien Potencier
68f83c9270 minor #10906 [Console] Update test fixtures to match the new way we handle colors. (jakzal)
This PR was merged into the 2.4-dev branch.

Discussion
----------

[Console] Update test fixtures to match the new way we handle colors.

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

The other failing tests were fixed by #10904. Builds should be passing again when 2.4 is merged to master.

Commits
-------

8e2d69e [Console] Update test fixtures to match the new way we handle colors.
2014-05-15 11:10:29 +02:00
Jakub Zalas
8e2d69e458 [Console] Update test fixtures to match the new way we handle colors. 2014-05-15 09:56:35 +01:00
Fabien Potencier
be3c0dcfc0 bug #10904 [HttpKernel] Replace sha1 with sha256 in recently added tests (jakzal)
This PR was merged into the 2.4 branch.

Discussion
----------

[HttpKernel] Replace sha1 with sha256 in recently added tests

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

Tests were introduced in #10896 and are broken starting with 2.4, since the hashing algorithm has changed (introduced in #8609).

Commits
-------

255544f [HttpKernel] Replace sha1 with sha256 in recently added tests.
2014-05-15 09:59:49 +02:00
Jakub Zalas
255544f194 [HttpKernel] Replace sha1 with sha256 in recently added tests. 2014-05-15 08:35:53 +01:00
Fabien Potencier
c0187c1465 Merge branch '2.4'
* 2.4:
  Explicitly define the encoding.
2014-05-14 23:48:41 +02:00
Fabien Potencier
35a0ee6f03 Merge branch '2.3' into 2.4
* 2.3:
  Explicitly define the encoding.
2014-05-14 23:48:29 +02:00
Fabien Potencier
6207389a6d bug #10899 Explicitly define the encoding. (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

Explicitly define the encoding.

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

Credits for discovering it go to @nicolas-grekas. Cheers!

Travis for PHP 5.6 cannot be enabled yet as there's one more test failing.

re #10714 #10714

Commits
-------

619ff58 Explicitly define the encoding.
2014-05-14 15:50:58 +02:00
Jakub Zalas
619ff5818f Explicitly define the encoding. 2014-05-14 14:35:53 +01:00