Commit Graph

8994 Commits

Author SHA1 Message Date
Drak
5ae76f1e55 [HttpFoundation] Update documentation. 2012-03-15 12:16:26 +05:45
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
Tiago Ribeiro
ed218bb1b2 Fixed an "Array to string conversion" warning when using PHP 5.4. Also affects Symfony2 master. 2012-03-14 18:05:51 +00: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
07d2d2e94a merged branch alan0101c/datatransformer-tz-fix (PR #3589)
Commits
-------

17c3482 fixed timezone bug in DateTimeToTimestampTransformer

Discussion
----------

[FIX]fixed timezone bug in DateTimeToTimestampTransformer

After several trials, I found out that the original code

```php
$dateTime = new \DateTime(sprintf("@%s %s", $value, $this->outputTimezone));
```
would create a DateTime object with timezone being '0000', even though $this->outputTimezone is set to my local timezone.

so I expanded the code a bit and it's working now.

PHP Test code,

```PHP
$d = new DateTime("@1234567890 Asia/Tokyo");
echo date_format($d, 'Y/m/d H:i:s')."\n";
echo $d->getTimezone()->getName()."\n";

$d = new DateTime("now Asia/Hong_Kong");
echo date_format($d, 'Y/m/d H:i:s')."\n";
echo $d->getTimezone()->getName()."\n";
```

The output is as followed:
2009/02/13 23:31:30
+00:00
2012/03/13 03:35:55
Asia/Hong_Kong

This could be a bug of PHP,

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

by stealth35 at 2012-03-13T15:54:31Z

👍
2012-03-14 13:07:13 +01:00
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
Fabien Potencier
d4057aed08 merged branch Spea/2.0 (PR #3590)
Commits
-------

50cb486 Fixed proxy generation in the DoctrineBundle when using Doctrine >= 2.2.0

Discussion
----------

[DoctrineBundle] Fixed proxy generation with Doctrine >= 2.2.0

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

The issue here was, that the name of the generated Proxy files have changed in Doctrine 2.2.0, thus the autoloader in the DoctrineBundle stoped working.

This PR fixes this issue by applying different string manipulations to the given class name depending on the currently used Doctrine version.

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

by fabpot at 2012-03-14T07:13:23Z

Can you squash your commits before I merge? Thanks.

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

by Spea at 2012-03-14T09:33:10Z

Should I open a new PR when squashed the commits? Because I don't know what happens when I force the remote repository to push my squashed commits.

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

by stloyd at 2012-03-14T09:48:05Z

First you should rebase (normally), then squash and push with `--force`, then GH will automaticaly update this PR (if you push into same branch on which bases this PR).

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

by Spea at 2012-03-14T10:04:30Z

Yeah I knew about the ```--force``` option. I just wasn't sure what happens when I do it. Thank you!

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

by Spea at 2012-03-14T10:14:23Z

Squashed commits.
2012-03-14 12:53:37 +01:00
Martin Parsiegla
50cb486b67 Fixed proxy generation in the DoctrineBundle when using Doctrine >= 2.2.0 2012-03-14 11:40:15 +01:00
Michał Pipa
df11e6287a [FrameworkBundle] Used $output->write() instead of echo 2012-03-13 18:54:56 +01:00
Victor Berchet
0c83c5d594 [Form] Alternate syntax for form_theme 2012-03-13 14:48:30 +01:00
Toni Uebernickel
235be43cd3 fix PropelLogger stopwatch events 2012-03-13 14:42:19 +01:00
Fabien Potencier
92c5785fe4 merged branch vicb/validator/race_2.0 (PR #3587)
Commits
-------

93cc9ef [Validator] Remove a race condition in the ClassMetaDataFactory (fix #3217)

Discussion
----------

[Validator] Remove a race condition (fix #3217)

#3581 for 2.0
2012-03-13 11:33:55 +01:00
Victor Berchet
93cc9efb8a [Validator] Remove a race condition in the ClassMetaDataFactory (fix #3217) 2012-03-13 10:54:33 +01:00
Fabien Potencier
e335fa208c merged branch stof/doctrine_autoload (PR #3584)
Commits
-------

878c239 Fixed autoloader leakage in tests

Discussion
----------

Doctrine autoload

The autoloader for proxies is now unregistered on shutdown to avoid
having several instances registered at the same time in tests.
2012-03-13 10:26:39 +01:00
Christophe Coevoet
878c2399f1 Fixed autoloader leakage in tests
The autoloader for proxies is now unregistered on shutdown to avoid
having several instances registered at the same time in tests.
2012-03-13 10:01:34 +01:00
Michał Pipa
c3bf479b14 [FrameworkBundle] Used Process component 2012-03-13 08:53:22 +01:00
Michał Pipa
cfa2dff5ce [FrameworkBundle] Changed server:run command description 2012-03-13 08:47:19 +01:00
Michał Pipa
e7d38c1381 [FrameworkBundle] Changed PHP version detection (see: #3529) 2012-03-13 08:38:03 +01:00
Alan Chen
17c3482309 fixed timezone bug in DateTimeToTimestampTransformer 2012-03-12 22:51:14 +08: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
b062cc78d4 merged branch iambrosi/issue2653 (PR #3564)
Commits
-------

aa53b88 Sets _format attribute only if it wasn't set previously by the user

Discussion
----------

Sets _format attribute only if it wasn't set previously by the user.

Fixes #2653
2012-03-12 09:34:46 +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
Fabien Potencier
d338c762c2 merged branch meandmymonkey/xml-output-fix (PR #3569)
Commits
-------

705e460 provided unmerged definition for correct help generation
45bbb5b added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation

Discussion
----------

[Console] Xml output fix

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2667
Todo: add specific test

As per my comment [here](https://github.com/symfony/symfony/issues/2667#issuecomment-4431944), added the ability to provide an InputDefinition that will not be changed by merging with the Application InputDefinition..
2012-03-12 09:18:38 +01:00
Andreas Hucks
705e46018e provided unmerged definition for correct help generation 2012-03-12 01:11:44 +01:00
Andreas Hucks
45bbb5be01 added getNativeDefinition() to allow specifying an alternate InputDefinition for help generation 2012-03-12 01:10:54 +01:00
Victor Berchet
c68c8b87c3 [SecurityBundle] Lazily load the post schema listener 2012-03-11 23:31:17 +01:00
Ismael Ambrosi
aa53b887d1 Sets _format attribute only if it wasn't set previously by the user 2012-03-11 16:56:20 -03:00