This PR was merged into the 2.6-dev branch.
Discussion
----------
minor [Serializer] Fix CS. Uniformize PHPDoc.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Commits
-------
5be84c4 [Serializer] Fix CS. Uniformize PHPDoc.
This PR was merged into the 2.6-dev branch.
Discussion
----------
[DependencyInjection] Tweaked factories
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12008
| License | MIT
| Doc PR | n/a
There are some issues with new service factories:
* `ContainerBuilder` cannot instantiate service from factory (i.e. currently it works for dumped code only)
* Dumped code sometimes is invalid (anonymous services as factories, factories without arguments)
Commits
-------
ee82392 [DependencyInjection] Tweaked factories
This PR was merged into the 2.6-dev branch.
Discussion
----------
[HttpFoundation] enhance PdoSessionHandler
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5483, #2067, #2382, #9029
| License | MIT
0. [x] Continuation of locking implementation (#10908): Implement different locking strategies
- `PdoSessionHandler::LOCK_TRANSACTIONAL` (default): Issues a real row lock but requires a transaction
- `PdoSessionHandler::LOCK_ADVISORY`: app-level lock, safe as long as only the PdoSessionHandler accesses sessions, advantage is it does not require a transaction (not implemented for oracle or sqlsrv yet)
- `PdoSessionHandler::LOCK_NONE`: basically what is was before, prone to race conditions, means the last session write wins
1. [x] Save session data as binary: Encoding session data was definitely the wrong solution. Session data is binary text (esp. when using other session.serialize_handler) that must stay as-is and thus must also be safed in a binary column. Base64 encoding session data just decreses performance and increases storage costs and is semantically wrong because it does not have a character encoding.
That saving null bytes in Posgres won't work on a character column is also documented
> First, binary strings specifically allow storing octets of value zero and other "non-printable" octets (usually, octets outside the range 32 to 126). Character strings disallow zero octets, and also disallow any other octet values and sequences of octet values that are invalid according to the database's selected character set encoding.
http://www.postgresql.org/docs/9.1/static/datatype-binary.html#DATATYPE-BINARY-TABLE
2. [x] Implement lazy connections that are only opened when session is used by either passing a dsn string explicitly or falling back to session.save_path ini setting. Fixes#9029
3. [x] add a create table method that creates the correct table depending on database vendor. This makes the class self-documenting and standalone useable.
5. [x] add lifetime column to session table which allows to have different lifetimes for each session
6. [x] add isSessionExpired() method to be able to distinguish between a new session and one that expired due to inactivity, e.g. to display flash message to user
7. [x] added upgrade and changelog notes
Commits
-------
1bc6680 [HttpFoundation] implement different locking strategies for sessions
6f5748e adjust sqlite table definition
5978fcf added upgrade and changelog notes for PdoSessionHandler
182a5d3 [HttpFoundation] add create table method to pdo session handler
e79229d [HttpFoundation] allow different lifetime per session
af1bb1f add test for null byte in session data
251238d [HttpFoundation] implement lazy connect for pdo session handler
7dad54c [HttpFoundation] remove base64 encoding of session data
This PR was merged into the 2.6-dev branch.
Discussion
----------
[FrameworkBundle] container:debug : list services if no service match exacly the name argument
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11303
| License | MIT
| Doc PR |
If we launch the command "container:debug log" and there is no
service nammed log, it will print something like this :
```
[0] logger
[1] monolog.handler.console
[2] monolog.handler.debug
```
After the service has been chosen, usual container:debug informations
are displayed.
Commits
-------
16201b6 [FrameworkBundle] container:debug : list services if no service match exacly the name argument
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Debug] expose object_handle
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This is a small enhancement to the symfony debug C extension that allows fetching an object's handle.
This is the `#number` as displayed by var_dump():
`class stdClass**#1** (0) {}`
This is required for VarDumper to be able to expose objects' handles and thus have more precise dumps.
It will allow inspecting "same" relationships between two *different* dumps.
Commits
-------
5f6b676 [Debug] expose object_handle
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11303
| License | MIT
| Doc PR |
If we launch the command "container:debug log" and there is no
service nammed log, it will print something like this :
```
[0] logger
[1] monolog.handler.console
[2] monolog.handler.debug
```
After the service has been chosen, usual container:debug informations
are displayed.
This PR was merged into the 2.5 branch.
Discussion
----------
[EventDispatcher] fix RegisterListenersPass test
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
With #12088 being merged, the test needs to be adapted to reflect the 2.5 specific changes.
Commits
-------
9d2120b fix RegisterListenersPass test
* 2.5:
[Doc] Use Markdown syntax highlighting
[Finder] tweaked docs
[Finder] Add info about possibilities offered by SplFileInfo
fixed CS
[Security][Http][Authentication] Make a test pass on HHVM
fix components tests
[Intl] FIxed failing test
[Intl] Generated the data for ICU version 54-rc
[EventDispatcher] fix doc bloc on EventDispatcherInterface
[Validator] Update validators.zh_CN.xlf, fix translation error
bumped Symfony version to 2.5.6
updated VERSION for 2.5.5
updated CHANGELOG for 2.5.5
bumped Symfony version to 2.3.21
updated VERSION for 2.3.20
update CONTRIBUTORS for 2.3.20
updated CHANGELOG for 2.3.20
[Intl] Integrated ICU data into Intl component
Conflicts:
src/Symfony/Component/Debug/README.md
src/Symfony/Component/DependencyInjection/README.md
src/Symfony/Component/HttpKernel/Kernel.php
src/Symfony/Component/OptionsResolver/README.md
* 2.3:
[Doc] Use Markdown syntax highlighting
[Finder] tweaked docs
[Finder] Add info about possibilities offered by SplFileInfo
fix components tests
[Intl] FIxed failing test
[Intl] Generated the data for ICU version 54-rc
[EventDispatcher] fix doc bloc on EventDispatcherInterface
[Validator] Update validators.zh_CN.xlf, fix translation error
bumped Symfony version to 2.3.21
updated VERSION for 2.3.20
update CONTRIBUTORS for 2.3.20
updated CHANGELOG for 2.3.20
[Intl] Integrated ICU data into Intl component
Conflicts:
src/Symfony/Component/HttpKernel/Kernel.php
src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#12059).
Discussion
----------
[Finder] Add info about possibilities offered by SplFileInfo
Minor documentation improvement
Commits
-------
b2219cf [Finder] Add info about possibilities offered by SplFileInfo
This PR was merged into the 2.3 branch.
Discussion
----------
fix components tests
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Since #12006, the `ContainerBuilder` contains the `addExpressionLanguageProvider()` method which references a class from the ExpressionLanguage component. By default, the PHPUnit mock API tries to mock all methods of the class being doubled. Since the ExpressionLanguage component is not required to run the tests, creating the mock objects fails when the mock API fails to mock the `addExpressionLanguageProvider()` method.
Commits
-------
2f2a732 fix components tests
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes#12086).
Discussion
----------
[Security][Http][Authentication] Make a test pass on HHVM
The test mocks AuthenticationException mocking all its (and its ancestors') methods. In HHVM's implementation of \Exception, a static method is called upon instantiation. Mock object generator, however, mocks static methods with 'throw' statements. All of these cause the SimpleAuthenticationHandlerTest to fail on HHVM when attempting to instantiate the mock.
The solution is to disable method mocking for AuthenticationException. An instance of this class is merely passed around between the authentication handler and the failure handler, and no methods are invoked on it. Hence, disabling method mocking should not weaken the unit test.
| Q | A
| ------------- | ---
| Bug fix? | [no]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| Fixed tickets | [none]
| License | MIT
| Doc PR | [none]
Commits
-------
7ff903e [Security][Http][Authentication] Make a test pass on HHVM
Since #12006, the `ContainerBuilder` contains the
`addExpressionLanguageProvider()` method which references a class from
the ExpressionLanguage component. By default, the PHPUnit mock API
tries to mock all methods of the class being doubled. Since the
ExpressionLanguage component is not required to run the tests,
creating the mock objects fails when the mock API fails to mock
the `addExpressionLanguageProvider()` method.
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11998).
Discussion
----------
[Intl] Integrated ICU data into Intl component #2
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow-up PR to #11920. This PR contains generated data files only.
Commits
-------
65a8b9f [Intl] Generated the data for ICU version 54-rc
This PR was merged into the 2.3 branch.
Discussion
----------
[Intl] Integrated ICU data into Intl component #1
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11447, #10807
| License | MIT
| Doc PR | -
This PR is an alternative implementation to #11884. It depends on ~~#11906~~ and ~~#11907~~ being merged first (~~these are included in the diff until after a merge+rebase~~ merged+rebased now).
With this PR, the ICU component becomes obsolete. The ICU data is bundled with Intl in two different formats: JSON and the binary ICU resource bundle format (version 2) readable by PHP's `\ResourceBundle` class. For a performance comparison between the two, see my [benchmark](/webmozart/json-res-benchmark).
~~The data is contained in two zip files: json.zip (2.6MB) and rb-v2.zip (3.8MB). The handler~~
```php
\Symfony\Component\Intl\Composer\ScriptHandler::decompressData()
```
~~needs to be added as Composer hook and decompresses the data after install/update.~~
The data is included as text/binary now. Git takes care of the compression.
Before this PR can be merged, I would like to find out what the performance difference between the two formats is in real applications. For that, I need benchmarks from some real-life applications which use ICU data - e.g. in forms (language drop-downs, country selectors etc.) - for both the JSON and the binary data. You can force either format to be used by hard-coding the return value of `Intl::detectDataFormat()` to `Intl::JSON` and `Intl::RB_V2` respectively. I'll also try to create some more realistic benchmarks.
If JSON is not significantly slower/takes up significantly more memory than the binary format, we can drop the binary format altogether.
Commits
-------
be819c1 [Intl] Integrated ICU data into Intl component
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Form] Added "label_format" option
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11456
| License | MIT
| Doc PR | TODO
This PR replaces #11456. It adds a "label_format" option which allows to configure a format for generating labels. Two placeholders are available: `%name%` and `%id%`.
**Feedback wanted**: Should we change the placeholders to `{{ name }}` and `{{ id }}`?
The option is inherited from the parent form if not set explicitly on a field:
```php
$form = $this->createForm('myform', $data, array('label_format' => 'form.label.%id%'));
```
Follow-up PR: Make the default label format and translation domain configurable in config.yml.
Commits
-------
aad442d [Form] Added "label_format" option
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Validator] Added error codes to all constraints with multiple error causes
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7276
| License | MIT
| Doc PR | TODO
This PR depends on #12015 and #12016 being merged first. However, a few changes in 52cb7df first must be backported to #12016.
This PR introduces error codes for all constraints with multiple error paths. This lets you determine what exactly the reason was that a constraint failed:
```php
$validator = Validation::createValidator();
$violations = $validator->validate('0-4X19-92619812', new Isbn());
foreach ($violations as $violation) {
var_dump($violation->getCode());
// => int(3)
var_dump(Isbn::getErrorName($violation->getCode()));
// => string(24) "ERROR_INVALID_CHARACTERS"
var_dump($violation->getConstraint()->getErrorName($violation->getCode()));
// => string(24) "ERROR_INVALID_CHARACTERS"
}
```
The `getErrorName()` method is especially helpful for REST APIs, where you can return both an error code and a description of that error now.
**Todos**
- [x] Backport a few structural changes to #12016
- [x] Update constraints outside of the Validator component
- [x] Rebase on master (after merging #12015 and #12016)
Commits
-------
3b50bf2 [Validator] Added error codes to all constraints with multiple error causes
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Form] The trace of form errors is now displayed in the profiler
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5607
| License | MIT
| Doc PR | -
This is a follow-up PR for #12052. With this change, the full trace of form errors is now displayed in the web debugger:
![error](https://cloud.githubusercontent.com/assets/176399/4419637/85facd14-456d-11e4-8c70-0e8802a586ec.png)
If a violation was caused by a TransformationFailedException, the exception is now accessible through the `getCause()` method of the violation. Additionally, you can access `Form::getTransformationFailure()` to retrieve the exception.
Commits
-------
8dbe258 [Form] The trace of form errors is now displayed in the profiler
This PR was merged into the 2.6-dev branch.
Discussion
----------
[Validator] Made it possible to store the cause of a constraint violation
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | TODO
This change makes it possible to store the cause of a violation (e.g. an exception). This way it is possible to follow the trace of violations caused by exceptions up to their root.
```php
try {
// ...
} catch (Exception $e) {
$this->context->buildViolation('Error!')
->setCause($e)
->addViolation();
}
```
This is one step to solve #5607. See #12054.
Commits
-------
499eeb4 [Validator] Made it possible to store the cause of a constraint violation
This PR was merged into the 2.3 branch.
Discussion
----------
[EventDispatcher] fix doc bloc on EventDispatcherInterface
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The doc block says that an array of event names is accepted as input, but no implementation is compliant with that description.
Commits
-------
e3dacbd [EventDispatcher] fix doc bloc on EventDispatcherInterface
This PR was merged into the 2.6-dev branch.
Discussion
----------
[MonologBridge] Ignore empty context/extra by default in the ConsoleFormatter
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This adds support for https://github.com/Seldaek/monolog/pull/388 and turns it on by default since the console output is arguably meant for humans and not for machine readable stuff it makes sense I believe. /cc @Tobion
**Note:** This depends on an unreleased version of monolog and should not be merged until 1.11 is out.
Commits
-------
9b69f56 [MonologBridge] Ignore empty context/extra by default in the ConsoleFormatter
This PR was merged into the 2.6-dev branch.
Discussion
----------
[HttpKernel] Initialize DataCollector data as array
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Without this I'm getting an exception when I open the debug panel without collected data.
```
ContextErrorException: Warning: Invalid argument supplied for foreach() -
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php at line 165
Commits
-------
986df54 [HttpKernel] Initialize DataCollector data as array
This fixes a DumpDataCollector error when the debug panel is opened
without collected data:
ContextErrorException: Warning: Invalid argument supplied for foreach() -
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php at line 165
This PR was merged into the 2.6-dev branch.
Discussion
----------
[FrameworkBundle] remove invalid tests
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
With #12046, the `getLocale()` method isn't overriden anymore by the `Translator` from the FrameworkBundle, but the locale is set by the new `TranslatorListener`. Therefore, the tests ensuring the old behavior are removed.
Commits
-------
80d52c7 remove invalid tests
This PR was merged into the 2.6-dev branch.
Discussion
----------
[DebugBundle] fix dev dependencies
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
3454e59 [DebugBundle] fix dev dependencies