Commits
-------
b6ac1aa [FORM] Give PropertyPath ability to read hassers
Discussion
----------
[Form] Give PropertyPath ability to read hassers
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
Using a `hasser` instead of `isser` for Boolean values is pretty common. I've found myself using `issers` a handful of times just to make an interface play nice with the form component, but the code reads funny now. I don't think we should be accounting for every possible `getter` variation, but I think this one is common enough that it warrants a discussion.
---------------------------------------------------------------------------
by fabpot at 2012-03-11T08:25:31Z
I tend to agree with with. What do you think @bschussek?
---------------------------------------------------------------------------
by kriswallsmith at 2012-03-16T22:42:28Z
I'm not so sure. There are lots of reasons to write a *hasser* that accepts an argument (i.e. `User::hasRole($role)`). Doesn't seem as clean as *issers* and *getters*.
---------------------------------------------------------------------------
by vicb at 2012-03-16T22:49:14Z
> There are lots of reasons to write a hasser that accepts an argument
May be can check for 0 args as we are already using reflexion ?
---------------------------------------------------------------------------
by kriswallsmith at 2012-03-16T22:55:43Z
In that case we should check that there are either 0 arguments or only optional arguments and also consider adding the same logic to the other varieties.
---------------------------------------------------------------------------
by jjbohn at 2012-03-16T23:37:47Z
Passing arguments seems like a pretty big departure for PropertyPath. How would you annotate that? I'm not sure I see a common use case for needing arguments when mapping data to and from forms.
---------------------------------------------------------------------------
by stof at 2012-03-16T23:50:22Z
@jjbohn it is not about passing arguments but about using the hasser only if it does not have required arguments
---------------------------------------------------------------------------
by jjbohn at 2012-03-17T01:54:18Z
Ah. I see. I have a tendency to read @kriswallsmith comments wrong :D. I could see that but iirc, there's not any current check like this on the other accessors. Happy to add it though if there's a consensus.
---------------------------------------------------------------------------
by fabpot at 2012-03-17T11:24:34Z
What's the point is checking the hasser/getter/isser arguments. It's up to the developer to check if he can use them or not. Let's not complexify the code for this.
---------------------------------------------------------------------------
by kriswallsmith at 2012-03-17T15:37:39Z
My concern is that someone writes a hasser method on their model that is not intended for use with the form component but it's called anyway, leading to WTFs.
---------------------------------------------------------------------------
by stof at 2012-04-03T22:28:21Z
@fabpot what's your decision about this ?
@jjbohn you need to rebase your PR. It conflicts with master as tests have been moved
---------------------------------------------------------------------------
by bschussek at 2012-04-05T14:53:55Z
@kriswallsmith is right. The check for 1 === $method->getNumberOfRequiredParameters() can (and should) easily be added to all of the if-clauses here.
Apart from that, I'm okay with adding this.
Commits
-------
8689e9c [WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1
Discussion
----------
[WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1.1
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no
Todo: fix DateFormatter
The ICU CLDR 2.0 data has been updated on ICU 4.8 and the same data set is used on version 4.8.1.1. The problem is related to [this commit](http://bugs.icu-project.org/trac/changeset?reponame=&new=31307%40icu%2Ftrunk%2Fsource%2Fdata%2Fcurr%2Fen.txt&old=31074%40icu%2Ftrunk%2Fsource%2Fdata%2Fcurr%2Fen.txt) which has since been updated with new data and subsequently shipped with version 49.
The `DateFormatter` tests are still failing - see this [gist](https://gist.github.com/2004d40e5167286028ea). Suggestions are welcomed on how to handle this part.
Test results with PHP 5.4.0 with ICU 4.8.1.1 on OSX:
````
FAILURES!
Tests: 5917, Assertions: 12749, Failures: 26, Incomplete: 11, Skipped: 47.
```
with this WIP patch:
```
FAILURES!
Tests: 5917, Assertions: 12749, Failures: 13, Incomplete: 11, Skipped: 47.
```
Commits
-------
595cc11 [Console] Wrap exception messages to the terminal width to avoid ugly output
97f7b29 [Console] Avoid outputing \r's in exception messages
Discussion
----------
[Console] Exception rendering fixes
This fixes two things:
- `\r`'s in exception messages were output (in case of `\r\n` newlines), creating really weird results on windows.
- long exception messages were wrapping and then the "red" block was completely messed up, with half black/half red lines, now it's wrapped before output if the terminal width can be detected.
If you don't care about merging this for 2.0, you can also merge the `console_ex` branch which applies on master. Due to moving tests and renaming of some normalize stuff in the tests, the two test patches are kind of different.
RFC: I am really not sure where to put those getTerminalWidth/Height methods. I guess this is not the best place.
Commits
-------
8ceb569 Fix typo
8702ea5 [Validator] Allow empty keys in the validation config
Discussion
----------
[Validator] Allow empty keys in the validation config
This allows you to just list fields that don't have validation rules (yet), for future reference it's kinda helpful. Right now if they're not commented out a fatal is thrown because null isn't an array.
---------------------------------------------------------------------------
by bschussek at 2012-04-05T15:34:09Z
Could you add a test please?
---------------------------------------------------------------------------
by Seldaek at 2012-04-05T15:34:48Z
The dummy key I added in the test makes it fail without the fix.
---------------------------------------------------------------------------
by bschussek at 2012-04-05T15:46:54Z
Ah, that's perfect, I overlooked that. Thanks!
New checkHost attribute in email constraint will
make the validator check for only one of MX, A or AAAA
DNS resource records to verify it as a valid
email address.
Commits
-------
d04638a [EventDispatcher] More logical positions for classes.
Discussion
----------
[EventDispatcher] More logical positions for classes.
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
---------------------------------------------------------------------------
by stof at 2012-04-04T18:59:02Z
ah sorry, I looked at the patch too fast. Only the interface is moved
Commits
-------
a2f65f7 [FrameworkBundle] Added the translation file for the en locale
Discussion
----------
[FrameworkBundle] Added the translation file for the en locale
This fixes the translation when the fallback is set to another language.
This new file can be used as reference by translators to find missing keys
in their translations as every contributor will be able to update it when
adding new keys.
See the discussion on #3773
This fixes the translation when the fallback is set to another language.
This new file can be used as reference by translators to find missing keys
in their translations as every contributor will be able to update it when
adding new keys.
Commits
-------
3c32569 [Routing] Added the possibility to define options for imported resources
Discussion
----------
[Routing] Added the possibility to define options for imported resources
Closes#2772
Commits
-------
2a90871 [Console] Removed previously introduced BC break.
90a2a6e [Console] Undecorated formatter must update style stack too.
bd7e01a [Console] Fixed output formatter test broken by new implementation.
a1add4b [Console] Updated output formatter to use style stack.
4f298dd [Console] Added formatter style stack.
93ffe54 [Console] Added getters to output formatter style (and its interface).
48e6b49 [Console] Updated formatter test to match styles bug fix.
ad334b6 [Console] Fixed empty style appliance.
31d5fe5 [Console] Fixed output formatter docblock.
Discussion
----------
[Console] Fixes formatter nested style appliance.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
When outputing styled text in the console, you sometimes face to a confusing behavior: style tags cannot be nested. If tou try something like `<fg=blue>Hello <fg=red>world</fg=red>!</fg=blue>`, the trailing `!` will not be styled.
This PR introduce a new FormatterOutputStyleStack to keep open/closed styles informations up-to-date. It slightly changes OutputFormatter implementation which no longer uses `OutputFormatterStyle::apply()` method, but the new `OutputFormatterStyle::getTerminalSequence()`.
**Question:** I don't une `OutputFormatterStyleInterface` but `OutputFormatterStyle` to type `OutputFormatterStyleStack` methods arguments (to avoid BC break on the interface). Do you think it's right?
**Notice:** I also needed to fix some tests broken by new implementation.
---------------------------------------------------------------------------
by stof at 2012-03-16T10:27:56Z
Adding new methods in an interface is a BC break for people implementing it
---------------------------------------------------------------------------
by jfsimon at 2012-03-16T10:33:21Z
@stof indeed... this is a problem, should I remove them? If I do so, I should use `OutputFormatterStyle` instead of the interface to type arguments in `OutputFormatterStyleStack` right?
Commits
-------
8a0e6d2 [HttpFoundation] Update changelog.
4fc04fa [HttpFoundation] Renamed MetaBag to MetadataBag
2f03b31 [HttpFoundation] Added the ability to change the session cookie lifetime on migrate().
39141e8 [HttpFoundation] Add ability to force the lifetime (allows update of session cookie expiry-time)
ec3f88f [HttpFoundation] Add methods to interface
402254c [HttpFoundation] Changed meta-data responsibility to SessionStorageInterface
d9fd14f [HttpFoundation] Refactored for moved tests location.
29bd787 [HttpFoundation] Added some basic meta-data to Session
Discussion
----------
[2.1][HttpFoundation] Added some basic meta-data to Session
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
References the following tickets: #2171
Todo: -
Session data is stored as an encoded string against a single id. If we want to store meta-data about the session, that data has to be stored as part of the session data to ensure the meta-data can persist using any session save handler.
This patch makes it much easier to determine the logic of session expiration. In general a session expiry can be dealt with by the gc handlers, however, in some applications more specific expiry rules might be required.
Session expiry may also be more complex than a simple, session was idle for x seconds. For example, in Zikula there are three security settings, Low, Medium and High. The rules for session expiry are more complex as under the Medium setting, a session will expire after x minutes idle time, unless the rememberme option was ticked on login. If so, the session will not idle. This gives the user some control over their experience. Under the high security setting, then there is no option, sessions will expire after the idle time is reached and login the UI has the rememberme checkbox removed.
The other advantage is that under this methodology, there can be a UI experience on expiry, like "Sorry, your session expired due to being idle for 10 minutes".
Keeping in the spirit of Symfony2 Components, I am seeking to make session handling flexible enough to accommodate these general requirements without specifically covering expiration rules. It would mean that it would be up to the implementing application to specifcally check and expire session after starting it.
Expiration might look something like this:
$session->start();
if (time() - $session->getMetadataBag()->getLastUpdate() > $maxIdleTime) {
$session->invalidate();
throw new SessionExpired();
}
This commit also brings the ability to change the `cookie_lifetime` when migrating a session. This means one could move from a default of browser only session cookie to long-lived cookie when changing from a anonymous to a logged in user for example.
$session->migrate($destroy, $lifetime);
---------------------------------------------------------------------------
by drak at 2012-03-30T18:18:43Z
@fabpot I have removed [WIP] status.
---------------------------------------------------------------------------
by drak at 2012-03-31T13:34:57Z
NB: This PR has been rebased and the tests relocated as per recent master changes.
---------------------------------------------------------------------------
by drak at 2012-04-03T02:16:43Z
@fabpot - ping
Commits
-------
56c1e31 performance improvement in PhpMatcherDumper
Discussion
----------
performance improvement in PhpMatcherDumper
Tests pass: yes
The code generation uses a string internally instead of an array. The array wasn't used for random access anyway.
I also removed 4 unneeded iterations this way (when imploding, when merging and twice when applying the extra indention). A `preg_replace` could also be saved under certain circumstances by moving it.
And there was a small code errror in line 139.