Commit Graph

8716 Commits

Author SHA1 Message Date
Drak 910b5c7f83 [HttpFoudation] CS, more tests and some optimization. 2012-03-15 12:15:54 +05:45
Drak b0466e8bb4 [HttpFoundation] Refactored BC Session class methods.
If code has not be refactored for the new API's then
you would still be using the API with one message per $name.
2012-03-15 12:14:11 +05:45
Drak 84c2e3caf7 [HttpFoundation] Allow flash messages to have multiple messages per type. 2012-03-15 11:55:52 +05:45
Fabien Potencier 85d40686ab merged branch drak/sessionhandler (PR #3493)
Commits
-------

eb9bf05 [HttpFoundation] Remove hard coded assumptions and replace with API calls.
9a5fc65 [HttpFoundation] Add more tests.
68074a2 Changelog and upgrading changes.
7f33b33 Refactor SessionStorage to NativeSessionStorage.
b12ece0 [HttpFoundation][FrameworkBundle] Separate out mock session storage and stop polluting global namespace.
d687801 [HttpKernel] Mock must invoke constructor.
7b36d0c [DoctrineBridge][HttpFoundation] Refactored tests.
39526df [HttpFoundation] Refactor away options property.
21221f7 [FrameworkBundle] Make use of session API.
cb873b2 [HttpFoundation] Add tests and some CS/docblocks.
a6a9280 [DoctrineBridge] Refactor session storage to handler.
a1c678e [FrameworkBundle] Add session.handler service and handler_id configuration property.
1308312 [HttpFoundation] Add and relocate tests.
88b1170 [HttpFoundation] Refactor tests.
2257a3d [HttpFoundation] Move session handler classes.
0a064d8 [HttpFoundation] Refactor session handlers.
2326707 [HttpFoundation] Split session handler callbacks to separate object.
bb30a44 [HttpFoundation] Prepare to split out session handler callback from session storage.

Discussion
----------

[2.1] Support PHP 5.4 \SessionHandler

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

This patch allows us to add services, like an encryption layer into any session handler without having to alter or inherit any code across any session handler, internal or custom.

The `\SessionHandler` class exposes internal PHP's native internal session save handlers like files, memcache, and sqlite by wrapping the internal callbacks through the class giving user-space the chance to intercept, override and filter them by inheriting from `\SessionHandler`.  I've written a pretty nice use-case at http://docs.php.net/sessionhandler which really shows the power of it. I never considered how to make proper use of the `\SessionHandler` in Symfony2 until I wrote the code example you see in that documentation and also because of the `AbstractSessionStorage` base class got in the way.

It's really trivial to enable support for this in Symfony2 but requires to separate out the actual handlers because inheritance is not suitable.

Obviously, the feature will only work with internal PHP-extension provided handlers under PHP 5.4 and will already work in PHP 5.3 with any custom handler (since they all implement `\SessionHandlerInterface`). Symfony2 will also be the first framework to support these amazing features :-D

The necessary changes are really small but beautiful:

The basic idea is this: 1d55d1ff14  removed inheritance and separates out the actual session handler callbacks - the part PHP processes internally.

This is supported by an internal proxy mechanism: 10a36c901e

In terms of BC, not much changes net from 2.0:

  - We can restore the deprecated service ID: `session.storage.native`
  - We add a new service ID `session.handler` (and configuration alias `handler_id`) for the actual session handlers.  This defaults to the renamed `session.handler.native_file` session handler (same behaviour just new name and as it's a default there is no BC break).

---------------------------------------------------------------------------

by fabpot at 2012-03-03T12:15:10Z

Looks good to me. Can you update the CHANGELOG and UPGRADE file accordingly and start to update the documentation at symfony/symfony-docs? Thanks for your work, the session handling in Symfony2 is starting to become amazing!

---------------------------------------------------------------------------

by drak at 2012-03-04T11:09:31Z

@fabpot I will start working on documentation this week and get the CHANGELOG/UPGRADING committed shortly.  I'll ping when done.

---------------------------------------------------------------------------

by drak at 2012-03-14T16:48:37Z

@fabpot - This PR is ready now.
2012-03-15 06:59:41 +01:00
Fabien Potencier 26441afb7b merged branch stloyd/optimal-images (PR #3573)
Commits
-------

6ad201f [FrameworkBundle + WebProfilerBundle] Optimized images and icons with PunnyPNG

Discussion
----------

[FrameworkBundle + WebProfilerBundle] Optimized images and icons with PunnyPNG

It's addition to #3571, in this one I optimized also some gifs, and replaced some of gifs with png, i.e. `spinner.gif` is almost 1kb smaller.

---------------------------------------------------------------------------

by vicb at 2012-03-12T10:27:59Z

-1 for .gif -> .png (the original images might be used by some 3rd party bundles)

---------------------------------------------------------------------------

by stloyd at 2012-03-12T10:36:51Z

@vicb Do you know any ? Because I'm not =)

Mainly because of change you mentioned this PR is on `master`, so if @fabpot would like it, I can also add note to `UPGRADE-2.1` (`CHANGELOG-2.1` ?) file about this change.

---------------------------------------------------------------------------

by stof at 2012-03-12T11:49:03Z

@stloyd you should update the toolbar templates which contain the base64 encoded version of the icons too so that they use the same version

---------------------------------------------------------------------------

by Tobion at 2012-03-12T12:09:29Z

+1 for png

---------------------------------------------------------------------------

by stloyd at 2012-03-12T12:13:18Z

@stof Added. Thanks for reminding =)

If this PR will be merged, I will send PRs into related bundles (Doctrine, Monolog, SwitfMailer).

---------------------------------------------------------------------------

by fabpot at 2012-03-13T11:04:42Z

I agree with @vicb. No need to convert gifs to pngs; the benefits are not worth the change.

---------------------------------------------------------------------------

by Tobion at 2012-03-13T11:35:56Z

I disagree strongly. A sophisticated framework such as symfony should promote web best practices. PNGs are simply better for icons and image compression is an important topic because of web traffic consumption. Google does not research in JPG replacement (webp) for no reason.

---------------------------------------------------------------------------

by fabpot at 2012-03-14T11:51:31Z

It's not about promoting best practices and I agree that using png would have been better. The point is to not break BC when it is not strictly needed.

---------------------------------------------------------------------------

by Tobion at 2012-03-14T12:14:33Z

How about not replacing gif but instead putting png next to them and using png by default for profiler etc.
So anybody who used these gif images (still don't know who that should be outside the framework, and these are not part of the API) could still use them.

---------------------------------------------------------------------------

by fabpot at 2012-03-14T13:48:44Z

looks like a good compromise to me.

---------------------------------------------------------------------------

by flyboarder at 2012-03-14T16:07:58Z

+1 for side-by-side , gif's can always be removed later.

---------------------------------------------------------------------------

by stloyd at 2012-03-14T22:32:50Z

@fabpot Rebased and restored `.gif` files.
2012-03-15 06:53:31 +01:00
Drak eb9bf05637 [HttpFoundation] Remove hard coded assumptions and replace with API calls. 2012-03-15 09:51:39 +05:45
Joseph Bielawski 6ad201f5ba [FrameworkBundle + WebProfilerBundle] Optimized images and icons with PunnyPNG 2012-03-14 23:31:48 +01:00
Drak 9a5fc659d7 [HttpFoundation] Add more tests. 2012-03-14 21:28:16 +05:45
Drak 68074a2be0 Changelog and upgrading changes. 2012-03-14 21:00:04 +05:45
Drak 7f33b33aa6 Refactor SessionStorage to NativeSessionStorage.
Native here refers to the fact the session storage interacts with real PHP sessions.
2012-03-14 20:59:57 +05:45
Drak b12ece0ff7 [HttpFoundation][FrameworkBundle] Separate out mock session storage and stop polluting global namespace.
This makes mock sessions truly mock and not to interfere with global namespace.
Add getters and setters for session name and ID.
2012-03-14 20:32:06 +05:45
Drak d687801142 [HttpKernel] Mock must invoke constructor. 2012-03-14 20:31:59 +05:45
Drak 7b36d0cc2b [DoctrineBridge][HttpFoundation] Refactored tests. 2012-03-14 20:30:06 +05:45
Drak 39526df67c [HttpFoundation] Refactor away options property.
It does not make sense to try and store session ini directives since they can be changes outside
of the class as they are part of the global state.

Coding stan
2012-03-14 20:30:05 +05:45
Drak 21221f7cf6 [FrameworkBundle] Make use of session API. 2012-03-14 20:30:05 +05:45
Drak cb873b250b [HttpFoundation] Add tests and some CS/docblocks. 2012-03-14 20:29:58 +05:45
Drak a6a9280a3b [DoctrineBridge] Refactor session storage to handler. 2012-03-14 20:27:23 +05:45
Drak a1c678ecd7 [FrameworkBundle] Add session.handler service and handler_id configuration property.
Revert service back to session.storage.native
Rename session.storage.native_file to session.handler.native_file (which is the default so no BC break from 2.0)
2012-03-14 20:21:40 +05:45
Drak 130831248d [HttpFoundation] Add and relocate tests. 2012-03-14 20:16:03 +05:45
Drak 88b1170356 [HttpFoundation] Refactor tests. 2012-03-14 20:15:59 +05:45
Drak 2257a3d4d6 [HttpFoundation] Move session handler classes. 2012-03-14 20:15:55 +05:45
Drak 0a064d8aa1 [HttpFoundation] Refactor session handlers. 2012-03-14 20:15:51 +05:45
Drak 23267077ff [HttpFoundation] Split session handler callbacks to separate object. 2012-03-14 20:15:48 +05:45
Drak bb30a447c5 [HttpFoundation] Prepare to split out session handler callback from session storage. 2012-03-14 20:15:44 +05:45
Fabien Potencier e01106f2b3 merged branch havvg/master (PR #3588)
Commits
-------

235be43 fix PropelLogger stopwatch events

Discussion
----------

fix PropelLogger "Event Propel Query X is not started."

---------------------------------------------------------------------------

by willdurand at 2012-03-13T16:00:39Z

👍
2012-03-14 12:53:48 +01:00
Toni Uebernickel 235be43cd3 fix PropelLogger stopwatch events 2012-03-13 14:42:19 +01:00
Fabien Potencier 632077aa81 merged branch raulfraile/master (PR #3571)
Commits
-------

14a18ae [WebProfilerBundle] Optimized toolbar and profiler icons with optiPNG

Discussion
----------

[WebProfilerBundle] Optimized toolbar and profiler icons with optiPNG

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

Optimized web toolbar and profiler icons (pngs) to slightly reduce PNG sizes. Lossless compression.
2012-03-12 09:51:51 +01:00
Raul Fraile 14a18aec8c [WebProfilerBundle] Optimized toolbar and profiler icons with optiPNG 2012-03-12 09:36:39 +01:00
Fabien Potencier 23977b118f merged branch vicb/acl-lazy (PR #3568)
Commits
-------

c68c8b8 [SecurityBundle] Lazily load the post schema listener

Discussion
----------

[SecurityBundle] Lazily load the post schema listener

As suggested by @stof in #3560
2012-03-12 09:34:20 +01:00
Victor Berchet c68c8b87c3 [SecurityBundle] Lazily load the post schema listener 2012-03-11 23:31:17 +01:00
Fabien Potencier 673bbb8a8e fixed CS 2012-03-11 18:00:25 +01:00
Fabien Potencier 595e6d6ca2 merged 2.0 2012-03-11 18:00:10 +01:00
Fabien Potencier 0d89f13560 fixed CS 2012-03-11 17:59:42 +01:00
Fabien Potencier fb7b88b226 merged branch vicb/acl (PR #3560)
Commits
-------

6d27aec [SecurityBundle] Improve the init:acl command
e809458 [Security]replaced acl:init command with postGenerateSchema listener

Discussion
----------

[WIP][Security]replaced acl:init command with postGenerateSchema listener

Attempt to fix #2091.

The code is from @schmittjoh (see #1313) but was never merged.

The difference is that the `init:acl` command has not been dropped in order to overcome [the limitations](https://github.com/symfony/symfony/pull/1313#issuecomment-1387091) described by @stof. @stof do you think this is ok ?

Left to fix:

* Using the code from this PR, the generated migration does not drop the tables but still alter them,

@stof you know this part of the code far better than me. I would appreacite your feedback on this PR and any hint on solving the remaining item. Thanks.
2012-03-11 17:58:59 +01:00
Victor Berchet 6d27aecb02 [SecurityBundle] Improve the init:acl command 2012-03-11 15:50:58 +01:00
Johannes M. Schmitt e8094589f0 [Security]replaced acl:init command with postGenerateSchema listener 2012-03-11 14:52:28 +01:00
Fabien Potencier a82737528c [CssSelector] fixed CssSelector::toXPath() when the CSS selector is an empty string 2012-03-11 10:18:25 +01:00
Fabien Potencier d2d7aecb64 merged branch hason/classloader (PR #3529)
Commits
-------

1ec075d [ClassLoader] Fixed version compare
8fb529c [ClassLoader] Fixed ClassMapGenerator and added suport for traits

Discussion
----------

[ClassLoader] Fixed ClassMapGenerator and added suport for traits

---------------------------------------------------------------------------

by hason at 2012-03-08T10:49:53Z

@fabpot, @Seldaek ``PHP_VERSION_ID`` or ``version_compare``?

---------------------------------------------------------------------------

by Seldaek at 2012-03-08T11:42:20Z

Ultimately @fabpot can call it, but I'm pro version_compare because it's just typically used for those checks, which may not make it more readable but makes it less WTF since it's a common pattern.

---------------------------------------------------------------------------

by drak at 2012-03-08T13:43:18Z

I prefer `version_compare()` with `phpversion()` as it's way more readable and obvious what it is.

---------------------------------------------------------------------------

by fabpot at 2012-03-08T17:06:25Z

+1 for `version_compare()`

---------------------------------------------------------------------------

by hason at 2012-03-09T07:19:10Z

@fabpot done
2012-03-11 09:29:38 +01:00
Fabien Potencier 2d65e17d2b merged branch johnnypeck/patch-2 (PR #3536)
Commits
-------

99079ba Very small semantic changes improving understanding and readability.

Discussion
----------

Very small semantic changes improving understanding and readability.

The "may or may not" change may seem pedantic but it quantifies the use of the field; obviously a boolean is true or not but "may not be empty" made me wonder about it's intent so clarification seemed appropriate.

Change "return" to "returns" as the rest of the code in the class uses this syntax.

Change "contains" to "contain" in an exception message.
2012-03-11 09:29:22 +01:00
Fabien Potencier 1a7ba03dbc merged branch Engerim/patch-1 (PR #3538)
Commits
-------

3fd9003 Update src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php

Discussion
----------

Changed return Tags from PermissionBuilder to MaskBuilder
2012-03-11 09:19:24 +01:00
Fabien Potencier 94eeed59f4 merged branch stof/acl_schemas (PR #3554)
Commits
-------

919eee4 [Security] Regenerated the ACL SQL schema with the latest Doctrine version

Discussion
----------

[Security] Regenerated the ACL SQL schema with the latest Doctrine version

This regenerates the SQL schemas for all platforms supported by Doctrine as some changes were made in the DBAL code since the previous run of the script and a new platform has been added.
2012-03-11 09:18:53 +01:00
Fabien Potencier 1b9b42893f merged branch stof/composer_deps (PR #3553)
Commits
-------

f26c1ce Fixed constraint requirements for Doctrine Common
011791d [Form] Moved the Validator component to the suggest section

Discussion
----------

Composer deps

There is no hard dependency to the Validator component in the Form, as said on Twitter when @harikt tried to use it. I kept the Locale component as a requirement as it is used by the LanguageTyep, CountryType and LocaleType which will be registered when using the CoreExtension.

The constraints for Doctrine deps are fixed too: adding an upper bound everywhere as we don't know the future to guarantee the compatibility (and for instance, 2.0.9 and lower were not compatible with ORM 2.2 as we had to fix the bundle), and the bridge is compatible with Common 2.2 too, not only with 2.1.

I found 2 other places where the dependencies should be discussed:

- the Validator component marks a hard dependency to Doctrine Common for its annotation reader. There is a dependency only when using annotation so it should not be a hard requirement IMO but a suggestion. the issue is that the [ValidatorFactory](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/ValidatorFactory.php) (not used by the framework itself) will add an annotation loader when relying on the default value of the arguments, which means that people that don't take care will need Common. Would it make sense to change the default so that Common is needed only when the user explicitly asks to use annotations ? Moving Common from require to suggest would make it easier for people using the Validator component standalone if they don't use annotations
- the Security component suggests the Finder and ClassLoader components. But these ones are only used by the [dev script](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Acl/Resources/bin/generateSql.php) used to generate the SQL schema shipped in the component. Does it really make sense to list them as people cloning the component should probably never use this script (which alters the files in the component) ?

---------------------------------------------------------------------------

by fabpot at 2012-03-11T08:14:46Z

+1 for removing Doctrine Common as a required dependency for the Validator component.

+1 for removing ClassLoader and Finder from the Security suggestions.
2012-03-11 09:15:23 +01:00
Fabien Potencier 71bf0f2f6a merged branch drak/patch-2 (PR #3556)
Commits
-------

0761b8a [HttpFoundation] Restore compliance with RFC2324

Discussion
----------

[HttpFoundation] Restore compliance with RFC2324

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-03-11 09:11:44 +01:00
Fabien Potencier 7ac13e3dfc merged branch xanido/master (PR #3558)
Commits
-------

afd708e Add missing backtick to CHANGELOG-2.1

Discussion
----------

Fix a typo in CHANGELOG-2.1

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: -
Fixes the following tickets: -
Todo: -
2012-03-11 09:11:20 +01:00
xanido afd708e442 Add missing backtick to CHANGELOG-2.1 2012-03-11 17:52:02 +11:00
Drak 0761b8a107 [HttpFoundation] Restore compliance with RFC2324 2012-03-11 11:04:36 +05:45
Christophe Coevoet 919eee4c4b [Security] Regenerated the ACL SQL schema with the latest Doctrine version 2012-03-11 03:29:45 +01:00
Christophe Coevoet f26c1ce98d Fixed constraint requirements for Doctrine Common 2012-03-11 02:47:07 +01:00
Christophe Coevoet 011791dbef [Form] Moved the Validator component to the suggest section
There is no hard dependency to the Validator component.
2012-03-11 02:32:06 +01:00
Fabien Potencier 85000fc288 merged branch stealth35/patch-18 (PR #3542)
Commits
-------

7aad478 [Locale] Prevent empty bundle

Discussion
----------

[Locale] Prevent empty bundle

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/stealth35/symfony.png?branch=patch-18)](http://travis-ci.org/stealth35/symfony)
Fixes the following tickets: #3486
Todo: -
2012-03-10 16:38:15 +01:00