This PR was squashed before being merged into the 2.5-dev branch (closes#9818).
Discussion
----------
[TwigBundle] Add command to list twig functions, filters, globals and tests
Sample output:
```
$ app/console twig:doc date
Functions
date(date = null, timezone = null)
Filters
date(format = null, timezone = null)
date_modify(modifier)
```
JSON output also available, could be helpful for IDEs.
Possible improvement would be to read the first line of the docblock of each method/function to show a bit more info.
Feedback welcome on the command's name. Not really convinced but too late to think of something better.
Credits to @gagarine for the great idea
Commits
-------
7d61154 Add command to list twig functions, filters, globals and tests
This PR was merged into the 2.3 branch.
Discussion
----------
[HttpKernel] made parsing controllers more robust
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10465
| License | MIT
| Doc PR | n/a
Under some circumstances (like passing an object without an __invoke method), the Controller resolver would lead to a PHP fatal. This PR fixes that, improved error messages, and refactored the unit tests.
Commits
-------
6dba229 made parsing controllers more robust
This PR was merged into the 2.5-dev branch.
Discussion
----------
[Validator] Improved ISBN validator
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #10386, #10387, #10542
| License | MIT
| Doc PR | symfony/symfony-docs/pull/3724
This is a new PR of #10542, now on master branch.
Todos:
- [x] Discuss and determine deprecation versions
- [x] Update docs
After following some discussion in the tickets mentioned above I have improved the ISBN validator, which has had some inconsistencies:
* Use a `type` which can be set to `isbn10` or `isbn13` or `null` (checks if value matches any type) instead of the current boolean `isbn10` and `isbn13` options which cause confusion (e.q. if both are true, does this mean the value must match any or both? You could think it's the latter, but that's actually impossible.).
* In the IBAN validator we recently agreed to be strict about upper- and lowercase handling (#10489). Therefore this should be also the case with the ISBN validator. Some ISBN10 numbers may end with an uppercase `X` (representing the check-digit 10), while a lowercase `x` is considered wrong (see [here](http://www.goodreads.com/topic/show/1253500-a-question-about-isbn-10-s---ending-in-x) and [here](http://en.wikipedia.org/wiki/Category:Pages_with_ISBN_errors)). I did not have access to the actual specifications as I have only found documentation which costs about $100 (e.q. [here](http://www.iso.org/iso/catalogue_detail?csnumber=36563)).
To avoid bc breaks I suggest to introduce deprecations for current constraint options. [In the documentation](http://symfony.com/doc/current/contributing/code/conventions.html#deprecations) I haven't found any information about which versions may introduce deprecations, so you might have to help me out here with hints on how to handle it correctly. I'll be happy to provide the code with the deprecated parts removed after that.
Commits
-------
ec42844 Improved ISBN validator
This PR was squashed before being merged into the 2.5-dev branch (closes#10457).
Discussion
----------
[Serializer] Unify usage of normalizer cache
| Q | A
| ------------- | ---
| Bug fix? | no (unless performance problems are considered bugs)
| New feature? | no
| BC breaks? | no (unless the exception structure should be simplified)
| Deprecations? | no
| Tests pass? | yes ( I had some test fails locally when running the whole suite, but not related to Serializer)
| Fixed tickets |
| License | MIT
| Doc PR |
Some clean-up of the Serialization class, which has methods to get the Normalizer/Denormalizer but then repeats that logic in normalizeObject()/denormalizeObject().
Took great care to keep the exception behavior exactly like it is now as the tests depend on it, but it's strange (the methods use different exception classes if no normalizer is found and the "no normalizer" LogicException only exists in normalizeObject/denomalizeObject. That could easily be simplified further, to the point where those functions could easily be merged into the calling methods, as it would just be a single line of code. There is also a duplicate call to $this->normalizeObject() in normalize() that just exists to throw the LogicException for Symfony\Component\Serializer\Tests\SerializerTest::testSerializeNoNormalizer. Other tests do not except that to be thrown there, though.
Also noticed that getNormalizer()/getDenormalizer() are documented as @inheritdocs, which is a lie as they are private. Added some basic docs there.
This is performance relevant, as not having the cache in the getter methods means all normalizers are checked again to verify if a normalizer supports the data.
Commits
-------
e7389aa Move normalizer cache to getNormalier()/getDenormalizer(), use those in normalizeObject()/denormalizeObject()
This PR was merged into the 2.3 branch.
Discussion
----------
[DependencyInjection] Fixed YamlFileLoader imports path
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10516
| License | MIT
| Doc PR | http://symfony.com/doc/current/book/service_container.html#importing-configuration-with-imports
YamlFileLoader used the resource name as the current directory during import, which can cause a failed import when using a relative path. Using the $path variable output from the locator is consistent with other loaders and fixes the bug.
Commits
-------
fd1d48b Fixed YamlFileLoader imports path
YamlFileLoader used the resource name as the current directory during import, which can cause a failed import when using a relative path. Using the $path variable output from the locator is consistent with other loaders and fixes the bug.
This PR was squashed before being merged into the 2.5-dev branch (closes#9140).
Discussion
----------
[Validator][Email] - Strict validation and soft dependency
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #1581, #4930
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/3469
TODO
---------
- [x] submit changes to the documentation
- [x] document the BC breaks
- [x] finish the code
- [x] gather feedback for my changes
In #1581 @bschussek suggested to pass the strict_email config to `Validator\EmailValidator::__construct($strict)`, I did not put it there yet since the constraint can receive that configuration each time the constraint is used despite the fact of the global configuration. This could lead to some logic in the constructor and I wanted first to integrate the strict validator.
BC Break
--------------
I'm not sure of this, but as a soft dependency is added and now some emails that where valid before no longer are I thought it is.
Commits
-------
3368630#1581 - Strict in Email constraint and use of Egulias\EmailValidator
* 2.4:
Check headers sent before sending PHP response
Fix issue symfony/symfony#10345 '[FrameworkBundle][Console] container:debug --parameter="" not working anymore'
Fixed ACE domain checks on UrlValidator (#10031)
handle array root element
This PR was merged into the 2.3 branch.
Discussion
----------
[Debug] Check headers sent before sending PHP response
If the response contents has been sent before an error occurs, PHP triggers the warning "Cannot modify header information - headers already sent".
This change ensure that the useful error message is echoed, while it's impossible to change the HTTP status code and headers.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
97591c1 Check headers sent before sending PHP response
If the response contents has been sent before an error occurs, PHP
triggers the warning "Cannot modify header information - headers already sent"
This change ensure that the error message is echoed, while it's impossible
to change the HTTP status code and headers.
This PR was merged into the 2.5-dev branch.
Discussion
----------
[HttpKernel] [Exception] Add UnprocessableEntityHttpException to HttpKernel Exceptions
Add UnprocessableEntityHttpException, as this would have been useful as few times now.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
304cbe9 Add UnprocessableEntityHttpException to HttpKernel Exceptions
This PR was merged into the 2.4 branch.
Discussion
----------
[FrameworkBundle][Console] Fix issue #10345 container:debug --parameter="" not working anymore
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes*
| Fixed tickets | #10345
| License | MIT
| Doc PR | N/A
## TODO
- [x] Fix issue #10345
- [ ] Create unit test for `describeContainerParameter`
Commits
-------
b278aa4 Fix issue symfony/symfony#10345 '[FrameworkBundle][Console] container:debug --parameter="" not working anymore'
This PR was submitted for the 2.3 branch but it was merged into the 2.5-dev branch instead (closes#10291).
Discussion
----------
[Validator] New validator for UUIDs
This PR adds a new validator for [RFC 4122](http://tools.ietf.org/html/rfc4122)-compliant [universally unique identifiers (UUIDs)](https://en.wikipedia.org/wiki/Universally_unique_identifier). This implementation validates both the format and (optionally) the UUID version.
The RFC is very specific on how UUIDs should be formatted. However, some systems/platforms like PostgreSQL produce or allow similar but non-compliant UUIDs which some developers may need to allow. (Their dashes are in different spots, or they might be wrapped in curly braces, but still contain the same number of hexadecimal characters). To accommodate both parties, I've added a `strict` option to the constraint. When enabled (default), the validator only allows UUIDs conforming to the exact RFC specs.
Comments and feedback would be greatly appreciated :)
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | symfony/symfony-docs#3619
**TODOs:**
- [x] Gather feedback; make changes
- [x] Ensure all tests pass
- [ ] Get approval; have this added to the 2.5 milestone
- [x] Submit PR for the documentation
Commits
-------
19931c9 Added new validator for UUIDs
This PR was merged into the 2.3 branch.
Discussion
----------
[Validator] Fixed ACE domain checks on UrlValidator (#10031)
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10031
| License | MIT
| Doc PR |
I added some checks to allow internationalised domain names as per reported on #10031 and some extra testcases to cover ACE domain names.
Commits
-------
7a2f154 Fixed ACE domain checks on UrlValidator (#10031)
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes#10123).
Discussion
----------
handle array root element
An array to string conversion notice was thrown when the root element of the thing being validated is an array.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
Commits
-------
17ed8bf handle array root element
This PR was merged into the 2.5-dev branch.
Discussion
----------
[SwiftMailer] [MonologBundle] send error log mails from CLI
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Given I have symfony2 application with Monolog configured to send mail on error logs.
When I have exception thrown from CLI task
Then I should receive error mail
However this is not true because `Monolog/SwiftMailerHandler` is doing force flush only on `kernel.terminate`, but not on `console.terminate`
This PR fixes issue together with https://github.com/symfony/MonologBundle/pull/73
Commits
-------
9bb602f added explicit swiftmailer flush after ConsoleEvents::TERMINATE
This PR was merged into the 2.5-dev branch.
Discussion
----------
[Bridge][Propel1][Form] Model choice accept custom unique column
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR permit to do :
```` php
<?php
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('my_field', 'model', array(
'class' => 'MyClassWithSlug',
'index_property' => 'slug'
));
}
````
With this option you can hide internal ids to expose an unique column eg slug and render
```` html
<select name="my_field">
<option value="{THE_SLUG}">{THE_VALUE}</option>
</select>
````
Commits
-------
81e94d0 Model choice accept custom unique column
This PR was merged into the 2.5-dev branch.
Discussion
----------
[Form] Fixed tests after merging pattern deprecation
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Tests were not run on #10001.
Here are some fixes.
Commits
-------
e2d8944 Fixed tests after merging pattern deprecation
* 2.4: (52 commits)
Fix#8205 : Deprecate file mode update when calling dumpFile
Fix#10437: Catch exceptions when reloading a no-cache request
Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
removed ini check to make uploadedfile work on gae
Update OptionsResolver.php
fixed comment in forms.xml file
Clean KernelInterface docblocks
Cast the group name as a string
Fixed doc of InitAclCommand
[Form] Fix "Array was modified outside object" in ResizeFormListener.
Fix IBAN validator
[Process] Remove unreachable code + avoid skipping tests in sigchild environment
Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute
Added travis_retry to .travis.yml
[Process] fix some typos and refactor some code
[Process] Fix unit tests in sigchild disabled environment
[Process] Trow exceptions in case a Process method is supposed to be called after termination
fixed typo
[Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
[Process] Fix escaping on Windows
...
Conflicts:
src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php
src/Symfony/Component/Process/Process.php
src/Symfony/Component/Process/ProcessPipes.php
src/Symfony/Component/Process/Tests/AbstractProcessTest.php
* 2.3: (34 commits)
Fix#8205 : Deprecate file mode update when calling dumpFile
Fix#10437: Catch exceptions when reloading a no-cache request
Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
removed ini check to make uploadedfile work on gae
Update OptionsResolver.php
fixed comment in forms.xml file
Clean KernelInterface docblocks
Cast the group name as a string
Fixed doc of InitAclCommand
[Form] Fix "Array was modified outside object" in ResizeFormListener.
Fix IBAN validator
[Process] Remove unreachable code + avoid skipping tests in sigchild environment
Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute
Added travis_retry to .travis.yml
[Process] fix some typos and refactor some code
[Process] Fix unit tests in sigchild disabled environment
[Process] Trow exceptions in case a Process method is supposed to be called after termination
fixed typo
[Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
[Process] Fix escaping on Windows
...
Conflicts:
src/Symfony/Component/DomCrawler/Crawler.php
src/Symfony/Component/Filesystem/Filesystem.php
src/Symfony/Component/Process/Process.php
This PR was squashed before being merged into the 2.5-dev branch (closes#9178).
Discussion
----------
made HttpFoundationRequestHandler a service
defines HttpFoundationRequestHandler as a service
Commits
-------
43451e9 made HttpFoundationRequestHandler a service
This PR was squashed before being merged into the 2.5-dev branch (closes#10001).
Discussion
----------
[Form] Deprecated max_length and pattern options
Split of issue #9759
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | `max_length` and `pattern` in form options
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/3461
Commits
-------
52c07c7 Deprecated max_length and pattern options
This PR was merged into the 2.3 branch.
Discussion
----------
Fixed regression when using Symfony on filesystems without chmod support
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8205
| License | MIT
| Doc PR | n/a
Commits
-------
cefb67aFix#8205 : Deprecate file mode update when calling dumpFile
This PR was merged into the 2.3 branch.
Discussion
----------
[HttpKernel] Fix#10437: Catch exceptions when reloading a no-cache request
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10437
| License | MIT
Commits
-------
8e3a395Fix#10437: Catch exceptions when reloading a no-cache request
This PR was merged into the 2.3 branch.
Discussion
----------
[2.3] Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9731, #9483
| License | MIT
This should fix#9731 and #9483 that seems to be triggered when `libxml_disable_entity_loader` has been called with `true` (see https://bugs.php.net/bug.php?id=62577)
As `libxml_disable_entity_loader` is non thread safe (see https://bugs.php.net/bug.php?id=64938) and as we have some calls that might leave the setting to `true`, I think the bug should be fixed.
I've checked the use of both `libxml_use_internal_errors` and `libxml_disable_entity_loader` among symfony code.
You can see I prefered to skip DomDocument::loadXML warnings using the `@` instead of using `LIBXML_NOERROR | LIBXML_NO_WARNING` because we can log these errors whereas libxml errors would be furtives.
- [x] Check calls to DOMDocument::load
- [x] Check calls to DOMDocument::loadXML
- [x] Check calls to DOMDocument::loadHTML
- [x] Check calls to DOMDocument::loadHTMLFile
- [x] Add more tests
Commits
-------
489b8ae Fix libxml_use_internal_errors and libxml_disable_entity_loader usage
This PR was merged into the 2.5-dev branch.
Discussion
----------
[Process] Do not show output in FailedException if it was disabled
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
With the recent addition of the ability to disable the output, it was not taken into account within the `ProcessFailedException`.
So, if the output was indeed disabled, and the process returns an error and triggers a `ProcessFailedException` exception (i.e via a mustRun), we could have another LogicException which is not expected.
Commits
-------
849703a When a process fails, check if the output is enabled