Commits
-------
3f9e8ff [ClassLoader] made ClassCollectionLoader::load() automatically include class dependencies
6f4d281 [ClassLoader] added missing support for PHP 5.4 traits
Discussion
----------
Classloader optimization
The first commit fixes support for PHP 5.4 trait.
The second one does several things:
* it optimizes the recent merge so that the reflection class instance is only loaded once;
* we use the fact that we now get all class dependencies to automatically add all class dependencies to the map.
---------------------------------------------------------------------------
by fabpot at 2012-07-03T17:26:46Z
I've updated to take into accounts traits.
---------------------------------------------------------------------------
by bamarni at 2012-07-04T11:58:57Z
great job 👍
I can't see it in the diff as this part hasn't changed, but somewhere in the autoReload block there is :
```
if ($meta[1] != $classes) {
$reload = true;
}
```
It should be array_unique($classes), otherwise the file would be perpetually regenerated in autoReload mode when the input contains duplicate, because they're implicitely removed when dumping the files.
---------------------------------------------------------------------------
by fabpot at 2012-07-04T13:20:04Z
@bamarni I've added an `array_unique` call at the top (this bug existed before by the way).
Commits
-------
51b610f [Profiler] fix typehint
Discussion
----------
[Profiler] fix typehint
---------------------------------------------------------------------------
by fabpot at 2012-07-03T10:23:25Z
The profiler only works with Twig anyway.
---------------------------------------------------------------------------
by Tobion at 2012-07-03T10:29:18Z
Right. But why does he have this error: f47b9a6625 (commitcomment-1532164)
And since the class only uses methods of the general interface, I thought this makes it more reliable.
---------------------------------------------------------------------------
by fabpot at 2012-07-03T10:37:26Z
It was unrelated and I fixed that problem already.
Commits
-------
c40a4e5 [HttpFoundation] fix query string normalization
f9ec2ea refactored test method
0880174 [HttpFoundation] added failing tests for query string normalization
Discussion
----------
[HttpFoundation] fix query string normalization
This fixes the query string normalization. There were several problems in it (see test cases that I added).
The main issue, that first catched my eye, was that the query string was urldecoded before it was exploded by `=`. See old code: `explode('=', rawurldecode($segment), 2);`. This means an encoded `=` (`%3D`) would falsely be considered a separator and thus lead to complete different parameters. The fixed test case is at `pa%3Dram=foo%26bar%3Dbaz&test=test`.
---------------------------------------------------------------------------
by Tobion at 2012-07-04T02:21:25Z
cc @simensen considering your PR 4711
Commits
-------
d37003e [HttpFoundation] small fixes in Request
Discussion
----------
[HttpFoundation] small fixes in Request
phpdoc fixes,
making http_build_query explicit
fixing query string of '0', that was ignored.
Unfortunately this '0' problematic is omnipresent because PHP makes it so easy to get wrong (as it is converted to boolean false). I don't know how often I fixed such issue already.
Commits
-------
45219ef [Process] Add default xampp path to the list of possible paths to check
28e1313 [Process] Clean-up/simplify code
56f473a [Process] Add extra dirs argument to the executable finder to allow searching more dirs
Discussion
----------
ExecutableFinder changes
It cleans up stuff a bit and adds a guess for xampp users that wouldn't have php in their path
Commits
-------
eda439f [EventDataCollector] Display a better message when no events have been recorded
6b87981 [TimeDataCollector] Do not throw an exception when no events are recorded
Discussion
----------
[Profiler] Better support for collector in a production env
relates to #3706.
With this PR it is possible to:
- enable only the profiler in a production environment - the wdt being disabled you have to switch to the development environment to inspect the collected data,
- enable both the profiler and the wdt in a production environment (the use case form #3706).
@jmikola would this solve your use case ?
Commits
-------
45d967e [Form] Fixed: Empty forms can be compound too
Discussion
----------
[Form] Fixed: Empty forms can be compound too
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4480
Todo: -
Commits
-------
26a1e0b [ClassLoader] ordered ClassCollectionLoader writing to avoid redeclaration at runtime
Discussion
----------
[HttpKernel] allowed classes to compile to be prepended
I had an issue when registering JMSDIExtraBundle before the frameworkBundle, because the bundle is adding a class to compile wich extends a class to compile added by the frameworkbundle (https://github.com/schmittjoh/JMSDiExtraBundle/blob/master/HttpKernel/ControllerResolver.php#L39).
In my kernel, the bundle was registered before the frameworkbundle, if it's the case, the class is writed before the symfony core class in the cache file, so it will trigger the autoloader to load the symfony core class, then we'll have a fatal error because we're declaring 2 times the same class.
I'm suggesting to add a way to prepend the classes to compile added by an extension, this way we could force classes from the core bundle to pe prepended, and avoid this kind of error with other bundles adding classes extending core classes or implementing core interface. I've also added it to the frameworkbundle.
---------------------------------------------------------------------------
by travisbot at 2012-07-01T12:32:28Z
This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1750090) (merged a989d35c into a1b73887).
---------------------------------------------------------------------------
by schmittjoh at 2012-07-01T12:45:46Z
This doesn't sound really failure proof, better would be to resolve the compiled classes in a way that handles the dependencies gracefully regardless of the order that they are registered in.
---------------------------------------------------------------------------
by bamarni at 2012-07-01T13:03:15Z
yes that would be much cleaner, even if it's not perfect, I don't have any other examples, but I think in most of situations this error happens because of the frameworkbundle late registration?
---------------------------------------------------------------------------
by bamarni at 2012-07-01T23:07:24Z
I've added an automatic reordering as suggested. Now I don't get the error whatever the order of FrameworkBundle and JMSDIExtraBundle is.
---------------------------------------------------------------------------
by vicb at 2012-07-02T10:02:33Z
Does the algo really works ?
Let's say I have the following hierarchy `A < B < C` and the classes added in the following order; `C, B, A`. I believe that the algo would return `B, A, C` instead of `A, B, C`.
An other question: should the dependency resolution be implemented in the `ClassCollectionLoader` rather than in the compiler pass ?
---------------------------------------------------------------------------
by vicb at 2012-07-02T10:23:11Z
@bamarni could you confirm the issue with the algo ? If it is confirmed, do you have time to work on a fix ?
---------------------------------------------------------------------------
by bamarni at 2012-07-02T11:05:53Z
the algo looks correct, there is a loop checking dependencies and appending the parent classes at the begining so it should also work with A > B > C, but I'll check and add a unit test.
You're right about the location it could belong there if we want a general fix, should I put it in the ClassLoader component?
---------------------------------------------------------------------------
by vicb at 2012-07-02T11:28:14Z
Yep please move the code to the ClassLoader.
You could also add some cache mechanism:
- ReflectionClass could be cached (they might be use mulitple times when some dependencies exist and are also used by the class loader)
- May be you could also cache the hierarchy of the classes
---------------------------------------------------------------------------
by bamarni at 2012-07-02T17:25:08Z
@vicb : indeed there were something wrong with the algo when it needed to handle more than 1 level of dependency, it's fixed, I've added a few test case and it passes.
Caching the dependencies found with reflection would be useful if people are dumping several files with some similar classes in the same process, but I don't see why we would need to cache the hierarchy?
---------------------------------------------------------------------------
by vicb at 2012-07-02T18:29:06Z
@bamarni I was referring to a local cache (ie local variable).
- On the first iteration, the code instantiate a reflection class,
- On other iteration you would instantiate again a reflection class for a subset of the classes
- ...
- In the end the former code instantiate again a reflection class for each class in order to get the file name, ...
I was also thinking of an other algo: count the number of parent classes for each classes to include and order classes according to this number. This would be a single loop only, what do you think ?
---------------------------------------------------------------------------
by bamarni at 2012-07-02T19:32:34Z
hum good idea counting the parents is cleaner, even though it looks enough, would it also make sense to treat interfaces and classes separately? I'm thinking about a file with all the interfaces at the begining (ordered by number of parents desc), then the classes would be appended (ordered by number of parents desc too).
---------------------------------------------------------------------------
by vicb at 2012-07-03T07:05:07Z
There is no real benefit in making the interfaces appear first but you can do it if it doesn't make the code more complex.
Please also add the `@throws` annotation to the methods.
---------------------------------------------------------------------------
by bamarni at 2012-07-03T09:37:28Z
@vicb : I've changed it to use the parents count, looks good to me.
---------------------------------------------------------------------------
by bamarni at 2012-07-03T12:23:46Z
changed
---------------------------------------------------------------------------
by bamarni at 2012-07-03T12:42:29Z
fixed
Commits
-------
5c6f848 [Routing] use faster approach for encoding rel segments
25d326b [Routing] fix encoding of path segments '.' and '..'
Discussion
----------
[Routing] fix encoding of path segments '.' and '..'
#4559 for master
Commits
-------
816539b [FrameworkBundle] Display an error message when 'session.auto_start' is used (deprecated)
Discussion
----------
[FrameworkBundle] Display an error message when 'session.auto_start' is ...
...used (deprecated)
Commits
-------
3466896 [Routing] fix encoding of static static, so UrlGenerator produces valid URLs
Discussion
----------
[Routing] fix encoding of static text
Fixes#4166
As requested by Fabien, I split #4205 into multiple PRs.
---------------------------------------------------------------------------
by stof at 2012-06-09T12:49:32Z
github tells me this PR cannot be merged automatically. Could you rebase it ?
---------------------------------------------------------------------------
by Tobion at 2012-06-09T13:12:55Z
Done
---------------------------------------------------------------------------
by travisbot at 2012-06-09T13:18:18Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1576266) (merged 3466896a into 15b5aa4f).
Commits
-------
d9439ab made the charset overridable (closes#2072)
Discussion
----------
made the charset overridable (closes#2072)
The charset was configurable in a configuration file but it never worked:
framework:
charset: ISO-8859-1
Now, like for the cache and log dirs, you can configure the charset by
overriding the getCharset() method in the app kernel:
public function getCharset()
{
return 'ISO-8859-1';
}
---------------------------------------------------------------------------
by fabpot at 2012-07-03T07:26:04Z
See #2072 for the previous attempts to fix this issue.
The charset was configurable in a configuration file but it never worked:
framework:
charset: ISO-8859-1
Now, like for the cache and log dirs, you can configure the charset by
overriding the getCharset() method in the app kernel:
public function getCharset()
{
return 'ISO-8859-1';
}
Commits
-------
6296a24 Standalone query string normalization
Discussion
----------
[HttpFoundation] Standalone query string normalization
I wanted to leverage query string normalization in a test. I considered copying this code to my own library but I noticed that the only instance data `getQueryString` needed to know from the `Request` was `QUERY_STRING` so I broke the rest out into a standalone static function.
---------------------------------------------------------------------------
by simensen at 2012-07-02T20:05:59Z
I made the requested changes.
---------------------------------------------------------------------------
by fabpot at 2012-07-02T20:10:27Z
Can you squash your commits? Thanks.
---------------------------------------------------------------------------
by simensen at 2012-07-02T20:16:52Z
Sure, no problem. Hopefully I did it correctly.