This change allows any service to depend on the Request (via a method
call) and always have the right Request instance without the need for
the service to be in the request scope (you still need to set the
Request reference as non-strict).
A service can now be marked as synchronized; when set, all method calls
involving this service will be called each time this service is set.
When in a scope, methods are also called to restore the previous version of the
service.
This PR was merged into the 2.1 branch.
Commits
-------
c928ddc [HttpFoudantion] fixed Request::getPreferredLanguage()
839c78a Revert "merged branch jfsimon/issue-6928 (PR #7378)"
Discussion
----------
[HttpFoundation] fixed Request::getPreferredLanguage()
Previous PR #7378 was wrong and adding BC break. Resolution for short languages codes is now done in `Request::getPreferredLanguage()` method.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7378
This PR was submitted for the 2.2 branch but it was merged into the master branch instead (closes#7377).
Commits
-------
a58a443 [WebProfiler] add missing typehint to RouterController
Discussion
----------
[WebProfiler] add missing typehint to RouterController
It must be a RouteCollection because TraceableUrlMatcher expects it anyway.
| Q | A
| ------------- | ---
| Bug fix? | [no]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| License | MIT
* 2.2: (70 commits)
change wrapped exception message to be more usefull
updated VERSION for 2.0.23
update CONTRIBUTORS for 2.0.23
updated CHANGELOG for 2.0.23
[Form] fixed failing test
[DomCrawler] added support for query string with slash
Fixed invalid file path for hiddeninput.exe on Windows.
fix xsd definition for strict-requirements
[WebProfilerBundle] Fixed the toolbar styles to apply them in IE8
[ClassLoader] fixed heredocs handling
fixed handling of heredocs
Add a public modifier to an interface method
removing xdebug extension
[HttpRequest] fixes Request::getLanguages() bug
[HttpCache] added a test (cached content should be kept after purging)
[DoctrineBridge] Fixed non-utf-8 recognition
[Security] fixed HttpUtils class tests
replaced new occurences of 'Request::create()' with '::create()'
changed sub-requests creation to '::create()'
fixed merge issue
...
Conflicts:
src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig
src/Symfony/Component/DomCrawler/Link.php
src/Symfony/Component/Translation/Translator.php
* 2.1:
updated VERSION for 2.0.23
update CONTRIBUTORS for 2.0.23
updated CHANGELOG for 2.0.23
[Form] fixed failing test
[DomCrawler] added support for query string with slash
This PR was merged into the master branch.
Commits
-------
3674c22 changed bytes conversion method
Discussion
----------
Changed bytes conversion method
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
**The old way:**
```php
switch (strtolower(substr($memory, -1))) {
case 'g':
$memory *= 1024;
case 'm':
$memory *= 1024;
case 'k':
$memory *= 1024;
}
```
**The new way:**
```php
if (preg_match('#^(\d+)([bkmgt])#i', $memory, $match)) {
$shift = array('b' => 0, 'k' => 10, 'm' => 20, 'g' => 30, 't' => 40);
$memory = ($match[1] * (1 << $shift[strtolower($match[2])]));
}
```
---------------------------------------------------------------------------
by bendavies at 2013-03-18T16:27:52Z
pretty unreadable, no?
---------------------------------------------------------------------------
by benja-M-1 at 2013-03-18T16:29:25Z
I agree, I would not like to have to debug it.
---------------------------------------------------------------------------
by pborreli at 2013-03-18T16:31:43Z
just for my culture, what does : `1 << $var` ?
---------------------------------------------------------------------------
by bendavies at 2013-03-18T16:33:23Z
@pborreli it's a left shift http://php.net/manual/en/language.operators.bitwise.php
---------------------------------------------------------------------------
by jfsimon at 2013-03-18T16:47:15Z
@bendavies @benja-M-1 it's concise and easily recognised (if you understood it the first time).
FYI I didn't find it myself... pretty clever isn't it?
---------------------------------------------------------------------------
by benja-M-1 at 2013-03-18T16:50:53Z
Clearly too much clever for me :)
And what about moving this code in its own class to avoid the copy/paste?
---------------------------------------------------------------------------
by jfsimon at 2013-03-18T16:52:51Z
@benja-M-1 It would add a dependency to the components using it :(
---------------------------------------------------------------------------
by bendavies at 2013-03-18T16:55:26Z
@jfsimon clever indeed, but not necessarily better!
---------------------------------------------------------------------------
by jfsimon at 2013-03-18T16:57:18Z
@bendavies that's true.
---------------------------------------------------------------------------
by Tobion at 2013-03-18T17:00:56Z
There are other places where it could be used too (e.g. FileValidator).
---------------------------------------------------------------------------
by bendavies at 2013-03-18T17:06:01Z
on the other side of the argument, i *hate* the sneaky fall through on the switch statement.
very confusing the first time you see it!
---------------------------------------------------------------------------
by bendavies at 2013-03-18T17:19:42Z
this method has already made it into symfony here: https://github.com/symfony/symfony/pull/7395
---------------------------------------------------------------------------
by jfsimon at 2013-03-19T08:16:19Z
@Tobion I have some questions about the `FileValidator`:
* Why is th `k` in lower case and the `M` in upper case?
* Why is the size divided by 1000 and not 1024?
---------------------------------------------------------------------------
by Tobion at 2013-03-19T08:30:23Z
I was wondering the same. I guess this config (which is also displayed to users) uses the official metric prefixes (k = kilo, M = mega). So it's not about the computer terms where 1 KB = 1024 byte.
---------------------------------------------------------------------------
by vicb at 2013-03-19T16:03:21Z
kB =1000, kiB=1024.
Imo regexps should be case insensitive and account for the "i".
I am not in favor of the changes in this pr (the current way is also documented on php.net fwiw)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#7433).
Commits
-------
9f84528 change wrapped exception message to be more usefull
Discussion
----------
change wrapped exception message to be more usefull
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
When you try to parse a yml file with the XMLLoader you get the following Exception
```
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)
[InvalidArgumentException]
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)
```
after the patch
```
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to parse file "/home/.../src/Application/FOS/UserBundle/DependencyInjection/../Resources/config/services.yml".
[InvalidArgumentException]
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)
```
This PR was merged into the 2.1 branch.
Commits
-------
e6b7515 [DomCrawler] added support for query string with slash
Discussion
----------
[DomCrawler] added support for query string with slash
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Link\getUri() failed to return correct uri when current query string contains slash
Test pass on branch 2.1 but fails on master
This PR was merged into the 2.2 branch.
Commits
-------
633c051 Fixed invalid file path for hiddeninput.exe on Windows.
Discussion
----------
[2.2] [Console] Fix "The system cannot find the path specified." on Windows for askHiddenResponse().
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none available
| License | MIT
| Doc PR | n/a
* 2.1:
Add a public modifier to an interface method
[HttpRequest] fixes Request::getLanguages() bug
[HttpCache] added a test (cached content should be kept after purging)
[DoctrineBridge] Fixed non-utf-8 recognition
[Security] fixed HttpUtils class tests
This PR was merged into the 2.2 branch.
Commits
-------
39445c5 [WebProfilerBundle] Fixed the toolbar styles to apply them in IE8
Discussion
----------
[WebProfilerBundle] Fixed the toolbar styles to apply them in IE8
| Q | A
| ------------- | ---
| Fixed tickets | #7422
| License | MIT
Currently, the toolbar breaks the design of the whole page in IE8 and lower as it does not have styles applied. Even though it is a debugging tool and devs are often using modern browsers, it is painful to be forced to disable it when testing the site in IE (I won't bother about supporting the profiler JS in IE8 though as this is a different page which can be displayed in a modern browser even when testing in IE).
The reason of the issue is that [IE8 removes style tags at the beginning when setting the innerHTML](http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread/33fd33f7-e857-4f6f-978e-fd486eba7174/). As the fix is as easy as moving the tag after the div, I don't see a reason to reject this change.
I sent the bugfix to 2.2 because these templates have been refactored a lot between 2.1 and 2.2 so the fix would have been different. However, it is also possible to fix it in 2.1 if you want.
This PR was merged into the 2.2 branch.
Commits
-------
601da45 [ClassLoader] fixed heredocs handling
Discussion
----------
[ClassLoader] fixed heredocs handling
The end of an hereodc must have a newline to avoid PHP syntax errors.
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#7416).
Commits
-------
6d29979 [ClassLoader] fixed handling of heredocs
Discussion
----------
[ClassLoader] fixed handling of heredocs
| 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
This PR was merged into the 2.1 branch.
Commits
-------
54609b9 [HttpCache] added a test (cached content should be kept after purging)
Discussion
----------
[HttpCache] added a test (cached content should be kept after purging)
closes#6830
This PR was merged into the master branch.
Commits
-------
a011842 [HttpKernel] fixed memory collector
def2ccb Add PHP memory_limit to WDT
Discussion
----------
[HttpKernel] fixed memory collector
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7037
---------------------------------------------------------------------------
by vicb at 2013-03-15T20:21:55Z
OT, that's great to see many contributions for you @jfsimon, thanks !
---------------------------------------------------------------------------
by jfsimon at 2013-03-18T09:35:54Z
Thanks @vicb, this is so lovely :)
This PR was submitted for the 2.0 branch but it was merged into the 2.1 branch instead (closes#7397).
Commits
-------
8ee05e5 Add a public modifier to an interface method
Discussion
----------
[2.0][Security] Add a public modifier to an interface method
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
This PR was merged into the master branch.
Commits
-------
caf288c [TwigBridge] render Deprecated option 'standalone' in favor of 'strategy'
Discussion
----------
[TwigBridge] render Deprecated option 'standalone' in favor of strategy
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| License | MIT
This PR was merged into the master branch.
Commits
-------
ed58e36 [HttpKernel] CLI - don't always display errors
Discussion
----------
[HttpKernel] CLI - don't always display errors
I had closed#6370 by mistake when cleaning up my branches.
---------------------------------------------------------------------------
by sstok at 2013-02-13T15:13:16Z
👍
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#7398).
Commits
-------
df99ecf [travis-ci] removing xdebug extension
Discussion
----------
[travis-ci] removing xdebug extension
we don't need it (no coverage), and removing it speeds travis build by 1 minute approx (composer + icu + phpunit)
This PR was merged into the 2.2 branch.
Commits
-------
0992032 [Translator] fix metadata
3b71000 [Translator] fix typecast in transChoice
88f98c9 [Translator] optimized adding of resources and saving a call to array_unique
e88bf7b [Translator] fix phpdoc of MessageCatalogueInterface::add and ::replace
c97ee8d [Translator] mention that the message id may also be an object that can be cast to string in TranslatorInterface and fix the IdentityTranslator that did not respect this
5a36b2d [Translator] fix MessageCatalogueInterface::getFallbackCatalogue that can return null
d1c34e8 [Translator] coding style
Discussion
----------
[Translator] several fixes and refactorings
Reasoning see individual commits.
BC break: no <del>yes because I added an array typehint to `MessageCatalogueInterface::add` and `::replace` since it's required. I could remove the typhint again so there would be no bc break, but IMO having it is much more explicit and consistent as there are already other array typhints as in the constructor.</del>
---------------------------------------------------------------------------
by Tobion at 2013-02-14T09:36:35Z
@fabpot removed typehint and code movement. Added 2 more commits.
---------------------------------------------------------------------------
by Tobion at 2013-03-04T16:14:37Z
@fabpot ping
This PR was merged into the master branch.
Commits
-------
b6a5457 [Validator] Fixed member (getter/property) metadata readers. [Validator] added overridden getter metadata test [Validator] class member reflection build requires object instance [Validator] fixed error [Validation] fixed member metadata reflection cache [Validation] added property metedata test [Validation] fixed class/member metadata mapping [Validation] removed var_dump
9b6cd80 Update src/Symfony/Component/Validator/Mapping/GetterMetadata.php
Discussion
----------
[Validator] Use concrete Class Methods to check validations
This PR just adds a test to #7069.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7069
---------------------------------------------------------------------------
by vicb at 2013-03-05T18:21:02Z
@jfsimon Do you have a response about my comment in the original PR ?
At least we now have a BC break (ie new is no more called).
---------------------------------------------------------------------------
by jfsimon at 2013-03-05T18:30:43Z
@vicb I didn't saw it. I update the description.
---------------------------------------------------------------------------
by vicb at 2013-03-05T18:34:01Z
np, do you have a reply ?
_BCB = yes should trigger a note in the changelog_
---------------------------------------------------------------------------
by jfsimon at 2013-03-05T18:51:15Z
@vicb a response about the `newReflectionMember` method update?
---------------------------------------------------------------------------
by vicb at 2013-03-05T19:08:54Z
Yep
"Jean-François Simon" <notifications@github.com> wrote:
>@vicb a response about the `newReflectionMember` method update?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/symfony/symfony/pull/7271#issuecomment-14457748
---------------------------------------------------------------------------
by Gladhon at 2013-03-06T08:04:38Z
@vicb
newReflectionMember is a Method that comes from the parent and has no argument "object". So it can only get the reflection Member of the configured class, while we need once (in this special case) need the method of the concrete class.
---------------------------------------------------------------------------
by jfsimon at 2013-03-06T08:29:11Z
@vicb @Gladhon correct me if I'm wrong.
This method is only used to check the member scope. In the case of a getter, this scope is always public (`method_exists` returns true only if method is visible, then is this case public, isn'it?), so the `isPublic`, `isProtected` and `isPrivate` methods can be safely overriden. Am I right?
---------------------------------------------------------------------------
by Gladhon at 2013-03-06T08:43:54Z
Yes i am in agreement with that.
But I just think about to change the getPropertyValue also in PropertyMetadata. Can that make sense in any case ?
---------------------------------------------------------------------------
by vicb at 2013-03-06T08:56:21Z
@jfsimon `method_exists` returns `true` when the method exists, whatever its visibility.
My question is whether it would make sense to change the signature of `newReflectionMember` to accept an objet ?
That would be a BC break but the implementation proposed here is also a BC break (`newReflectionMember` which was called from `getReflectionMember` is no more called with this PR - it could have been overriden by a dev)
Finally `PropertyMetadata` should probably be updated in the same way.
---------------------------------------------------------------------------
by vicb at 2013-03-06T08:57:33Z
_and fyi you can both work on the same PR, ie @Gladhon you can send some changes (a PR) to the repo of @jfsimon_
---------------------------------------------------------------------------
by Gladhon at 2013-03-06T10:22:07Z
Well, i like it how it is now. Cause if we change that, you also need to have a object if calling "isPublic". For me it makes more sence to have only the object parameter if its realy needed.
Where do you see a real benefit if we change the `newReflectionMember` instead ?
---------------------------------------------------------------------------
by jfsimon at 2013-03-07T13:43:43Z
@vicb I think passing object instance to `getReflectionMember` is **required** for consistency.
I just pushed it.
This PR was squashed before being merged into the 2.1 branch (closes#7378).
Commits
-------
17dc2ff [HttpRequest] fixes Request::getLanguages() bug
Discussion
----------
[HttpRequest] fixes Request::getLanguages() bug
This PR adds to suported languages the first segment of all compouds languages codes.
When receiving `Accept-Language: en-us` header, accepted languages will now be `en, en_US`.
This should not be a BC break as most browsers already send the long **and** short versions of language codes... but some dont.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #6928