Commit Graph

8914 Commits

Author SHA1 Message Date
Eriksen Costa
013f998bb8 updated license blocks 2012-03-31 18:00:32 -03:00
Eriksen Costa
bec231f6ca fixed CS 2012-03-31 17:31:37 -03:00
Fabien Potencier
0c7b2911bc [Routing] removed code that was not ready to be pushed 2012-03-30 20:36:59 +02:00
Fabien Potencier
5178e76d4e merged branch drak/sessionarray (PR #3735)
Commits
-------

8dd2c27 [HttpFoundation] Further micro-optimization.
54c5d5e [HttpFoundation] Micro-optimisation.

Discussion
----------

[HttpFoundation] Micro-optimisation.

Ref #3729

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

by robocoder at 2012-03-30T11:45:02Z

If you pre-flip your $validOptions arrays, you can use isset() instead of in_array() in the loop.

This changes the performance from O(m * n) to O(m).

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

by drak at 2012-03-30T11:53:24Z

@robocoder What is the expense of the array_flip though?

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

by robocoder at 2012-03-30T11:56:21Z

Why would you use array_flip if the array doesn't change?  Change $validOptions = array('x', 'y', ...) to $validOptions = array('x' => 0, 'y' => 0, ...), then change the in_array() to use isset().

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

by stof at 2012-03-30T11:57:08Z

@drak a loop. But it will be done only once before the other loop so it will be O(n + m) instead of O(m * n)

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

by drak at 2012-03-30T12:00:47Z

Ok :)
2012-03-30 14:05:19 +02:00
Fabien Potencier
b03d107fe6 merged branch vicb/component_tests (PR #3736)
Commits
-------

234ce4d [PhpUnit] Fix the path to the boostrap files in the components

Discussion
----------

[PhpUnit] Fix the path to the boostrap files in the components
2012-03-30 14:00:14 +02:00
Drak
8dd2c273d3 [HttpFoundation] Further micro-optimization. 2012-03-30 17:41:58 +05:45
Victor Berchet
234ce4df9e [PhpUnit] Fix the path to the boostrap files in the components 2012-03-30 13:49:28 +02:00
Drak
54c5d5ed32 [HttpFoundation] Micro-optimisation. 2012-03-30 17:22:48 +05:45
Fabien Potencier
e18fcd852a merged branch kbond/extensible-httpcache (PR #3716)
Commits
-------

8f11f2dd shortened if/else syntax
2b8c2bc [FrameworkBundle] made http_cache dir extensible

Discussion
----------

[FrameworkBundle] make http_cache dir extensible

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

I have a use case where I don't want the httpcache cleared on `cache:clear`.  Currently, it is awkward to change this directory.

[![Build Status](https://secure.travis-ci.org/kbond/symfony.png?branch=extensible-httpcache)](http://travis-ci.org/kbond/symfony)
2012-03-30 08:10:12 +02:00
Fabien Potencier
950865db07 merged branch ocubom/fix-empty-string-argument (PR #3728)
Commits
-------

aac6ad8 [Console] avoid warning parsing empty string argument

Discussion
----------

[Console] avoid warning parsing empty string argument

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

When passing an empty string argument (`app/console add:list "item1" "" "item3"`) the argument parser generates an invalid offset warning and ignores the argument. The parsing usually fails with some kind of invalid number of arguments error.

This fix the error cheching the empty string case and storing it as an argument
2012-03-30 08:08:59 +02:00
Oscar Cubo Medina
aac6ad8018 [Console] avoid warning parsing empty string argument 2012-03-29 21:02:51 +02:00
Fabien Potencier
a7a696fc5a merged branch liuggio/webtestcase_kernel_shutdown_before_client (PR #3704)
Commits
-------

3303155 added kernel shutdown before create client, fixed and stashed

Discussion
----------

[FrameworkBundle] WebTestCase createClient doesn't check if static:kernel was already allocated

with this little fix CreateClient shuts down the kernel before booting again.

If you add an echo after the "if" on the line number 38
and run the test you would see that sometime the kernel is not properly umounted.

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

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

by fabpot at 2012-03-29T09:19:07Z

Can you squash your commits before I merge? Thanks.

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

by liuggio at 2012-03-29T10:17:59Z

Done.
2012-03-29 15:32:24 +02:00
Fabien Potencier
494e28b4bc merged branch olegstepura/patch-1 (PR #3726)
Commits
-------

c466df3 Markdown parser cut the underscores

Discussion
----------

Fix: Markdown parser cut the underscores
2012-03-29 15:31:20 +02:00
Oleg Stepura
c466df3fac Markdown parser cut the underscores 2012-03-29 16:06:33 +03:00
Fabien Potencier
036fc36919 merged branch lyrixx/patch-1 (PR #3721)
Commits
-------

c73748f [HttpFoundation] Added RFC reference to 308
468ad40 [HttpFoundation] Added support for 308 / Permanent Redirect

Discussion
----------

[HttpFoundation] Added support for 308 / Permanent Redirect

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes (i guess) [![Build Status](https://secure.travis-ci.org/lyrixx/symfony.png?branch=patch-1)](http://travis-ci.org/lyrixx/symfony)
Fixes the following tickets: -
Todo: -

I know this is still a draft, but it is already implemented in Firefox.

See :

- http://tools.ietf.org/html/draft-reschke-http-status-308-07
- https://developer.mozilla.org/en/HTTP/HTTP_response_codes#308

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

by stloyd at 2012-03-29T09:25:20Z

It will be in Firefox... 14!

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

by fabpot at 2012-03-29T09:33:01Z

Like the non RFC 2616 status code, you need to add the RFC number as a comment (or the reference to the draft).

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

by lsmith77 at 2012-03-29T11:58:14Z

can you open a PR for https://github.com/FriendsOfSymfony/FOSRest/blob/master/Util/Codes.php ?

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

by lyrixx at 2012-03-29T12:08:31Z

@lsmith77 : Done. See : https://github.com/FriendsOfSymfony/FOSRest/pull/7 :)
2012-03-29 14:54:38 +02:00
Fabien Potencier
565c89cff2 merged branch hason/upload_translations (PR #3724)
Commits
-------

44a7ca1 [FrameworkBundle] added new czech validators translations for the File constraint.

Discussion
----------

[FrameworkBundle] added new czech validators translations for the File c...

...onstraint.
2012-03-29 14:53:58 +02:00
Martin Hasoň
44a7ca1733 [FrameworkBundle] added new czech validators translations for the File constraint. 2012-03-29 14:37:47 +02:00
Fabien Potencier
44637cc887 merged branch conf/fix-tests-master (PR #3722)
Commits
-------

0bde12c Added some skipifs to prevent fatal errors on missing extensions.

Discussion
----------

Added some skipifs to prevent fatal errors on missing extensions.

2.0 branch is ok, this should fix errors on master.
2012-03-29 13:56:33 +02:00
Shein Alexey
0bde12c6c0 Added some skipifs to prevent fatal errors on missing extensions. 2012-03-29 15:19:53 +05:00
Grégoire Pineau
c73748fd22 [HttpFoundation] Added RFC reference to 308 2012-03-29 12:05:33 +02:00
Giulio De Donato
3303155023 added kernel shutdown before create client, fixed and stashed 2012-03-29 11:34:12 +02:00
Grégoire Pineau
468ad40405 [HttpFoundation] Added support for 308 / Permanent Redirect 2012-03-29 12:18:49 +03:00
Fabien Potencier
b1bb27e8da merged branch havvg/master (PR #3700)
Commits
-------

dd4d46a add limit to logger explosion

Discussion
----------

add limit to logger explosion

This limit is required to display complete query with e.g. "array" type in it.

ping @willdurand
2012-03-29 08:57:31 +02:00
Fabien Potencier
13a27ed73a merged branch robocoder/patch-1 (PR #3701)
Commits
-------

33382cd Add exception-controller attribute to xsd

Discussion
----------

Add exception-controller attribute to xsd
2012-03-29 08:56:32 +02:00
Fabien Potencier
7c59d8d490 merged branch ajessu/phpserver (PR #3717)
Commits
-------

d243097 Run built-in server on dev environment

Discussion
----------

Run built-in server on dev environment

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

Change the router of the built-in server command to run on dev environment.

The symfony standard edition doesn't have any `/` route by default (it's only available to dev), so by default, when ran, it gives a `404`, unless you explicitely add the `app_dev.php` front controller to the route.

Also, this server is meant to be run on dev only, so no need to run it with the prod front controller by default.
2012-03-29 08:48:13 +02:00
Fabien Potencier
d471a16657 merged branch drak/flashinterface (PR #3719)
Commits
-------

cde1c52 [HttpFoundation] Add missing method in flash interface.

Discussion
----------

[HttpFoundation] Add missing method in flash interface.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3711
Todo: -
2012-03-29 08:46:07 +02:00
Fabien Potencier
aed954cb63 fixed typo in the previous commit 2012-03-29 08:41:52 +02:00
Fabien Potencier
fea6b79acd moved component and bridge unit tests to the src/ directory
This is the first step to make each Symfony Component and Bridge self-contained.
2012-03-29 08:37:22 +02:00
Drak
cde1c52914 [HttpFoundation] Add missing method in flash interface. 2012-03-29 05:21:43 +05:45
Albert Jessurum
d24309789c Run built-in server on dev environment 2012-03-29 00:43:09 +02:00
Fabien Potencier
3e95126437 [DomCrawler] removed the hard dependency on CssSelector 2012-03-28 18:08:10 +02:00
Kevin Bond
8f11f2dd30 shortened if/else syntax 2012-03-28 11:52:41 -04:00
Kevin Bond
2b8c2bc9c3 [FrameworkBundle] made http_cache dir extensible 2012-03-28 11:41:21 -04:00
Fabien Potencier
1bb6e0de4d merged branch drak/session_gc (PR #3659)
Commits
-------

cdba4cf [FrameworkBundle] Change XSD to allow string replacements on session args.
52f7955 [FrameworkBundle] Remove default from gc_* session configuration keys.
749593d [FrameworkBundle] Allow configuration of session garbage collection for session 'keep-alive'.

Discussion
----------

[2.1][FrameworkBundle] Allow configuration of session garbage collection

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

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

by drak at 2012-03-21T21:56:20Z

@fabpot - this PR is ready for merge.  It basically allows configuration of some session ini values that are necessary in controlling the session behaviour.

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

by dlsniper at 2012-03-21T22:57:18Z

@drak shouldn't all the options here: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php#L266 be available for configuration, or am I just reading the source wrong and they already are?

In this case should I make a separate PR to cover the rest or could you do it in this one?

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

by fabpot at 2012-03-23T14:56:22Z

@drak: the discussion is the ticket is very interesting and I think it should be part of a cookbook in the documentation. Can you take care of that before I merge this PR? Thanks.

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

by drak at 2012-03-25T15:32:59Z

@fabpot - yes - it's on the todo list.  Will update this PR when done.

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

by drak at 2012-03-26T19:45:13Z

@fabpot - this is ready for merging, the documentation is done (the PR is in but I'll tweak it, but no need to wait to merge this PR).  I will also add something extra to cookbook (I wrote docs for the component).
2012-03-26 22:08:10 +02:00
Anthon Pang
33382cd4f4 Add exception-controller attribute to xsd 2012-03-26 13:17:28 -03:00
Toni Uebernickel
dd4d46a4c7 add limit to logger explosion
This limit is required to display complete query with e.g. "array" type in it.
2012-03-26 17:07:55 +02:00
Fabien Potencier
cd56d09012 merged branch cedriclombardot/feat-propel-explain (PR #3616)
Commits
-------

9ef5e95 Add connection name in the propel data collector

Discussion
----------

Add connection name in the propel data collector

Bug fix: no
Feature addition: yes, This will allow to explain a propel query on a specific connection
Backwards compatibility break: no
Symfony2 tests pass: yes

- Require PR propelorm/Propel#315
- Related to PR propelorm/PropelBundle#129

cc @willdurand

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

by willdurand at 2012-03-16T18:17:26Z

@fabpot please, let me merge Propel related PRs before that one, thanks!

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

by willdurand at 2012-03-26T08:38:36Z

@fabpot good to go from my point of view
2012-03-26 10:39:42 +02:00
Fabien Potencier
74b7bb3605 merged branch gatsu/patch-1 (PR #3689)
Commits
-------

b718960 HttpFoundation\HeaderBag Little improvement.

Discussion
----------

[HttpFoundation\HeaderBag] Removed unnecessary anonymous function

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

by vicb at 2012-03-24T16:07:00Z

Related issue: #3294
2012-03-26 09:47:20 +02:00
Fabien Potencier
1aaf5c9423 merged branch marcw/patch-security-refresh-user (PR #3402)
Commits
-------

10947cb [DoctrineBridge][Security] Fixes bug that prevents repository's refreshUser from being called

Discussion
----------

[Security][DoctrineBridge] Fixes bug that prevents repository's refreshUser from being called

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

by marcw at 2012-02-21T08:46:09Z

Updated. What do you guys think about this patch ?

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

by henrikbjorn at 2012-02-21T08:57:47Z

Isnt this a bit dangerous, the custom repository implementing refreshUser should always be called first right? You wouldnt specify the $property property if your class has custom implementations would you?

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

by marcw at 2012-02-21T09:05:08Z

@henrikbjorn At this time, the refreshUser method is never called from the custom repository, even if you don't specify the "property" property. This patch fixes this.

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

by marcw at 2012-02-21T09:44:06Z

Updated & Squashed.

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

by stof at 2012-02-21T10:03:33Z

@marcw please move the retrieval of the id in the ``else`` block, like in my comment as it is useless to do this logic for the case where the userProviderInterface is implemented (and it will answer to @vicb by making it impossible to write it with elseif)

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

by marcw at 2012-02-21T10:19:06Z

I'm not sure about this, but Isn't the check of the id essential here to ensure that the entity is a persisted one ?

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

by stof at 2012-02-21T10:21:55Z

@marcw if the interface is used, it means that the user wants to do the work himself. So you should really let him do the way he wants. If he does not use the id to refresh the user, he could choose not to include it in the serialized data.
Retrieving the id is needed for the ``find()`` call because we pass the id as argument and so we fail when the serialized data don't contain it

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

by marcw at 2012-02-21T10:33:30Z

@stof Roger that. I'll do the fix.

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

by marcw at 2012-02-21T10:41:58Z

Updated & Squashed, again.

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

by stof at 2012-02-21T11:00:44Z

btw, to answer to your previous question, the exception when retrieving the id does not check if the object is persisted (you need to reach teh DB for this, which is what find() does) but that the id is part of the serialized data to give a better error reporting.

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

by fabpot at 2012-03-07T19:39:33Z

ready to be merged now?

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

by henrikbjorn at 2012-03-08T07:21:37Z

would say so.

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

by dlsniper at 2012-03-25T11:58:34Z

Hi, can this be merged now or not?
2012-03-26 09:36:13 +02:00
Fabien Potencier
8e71361d50 merged branch lsmith77/patch-1 (PR #3695)
Commits
-------

72bf93f typo fix in upgrading guide

Discussion
----------

typo fix in upgrading guide

cc @drak
2012-03-26 09:30:14 +02:00
Lukas Kahwe Smith
72bf93f1d9 typo fix in upgrading guide 2012-03-25 18:27:20 -03:00
Artyom Protaskin
b718960857 HttpFoundation\HeaderBag Little improvement. 2012-03-24 11:17:54 +04:00
Fabien Potencier
a00ae273a6 fixed previous commit 2012-03-24 00:31:38 +01:00
Fabien Potencier
c4dfe931f1 [HttpFoundation] made the host lowercase as per RFC 952/2181 2012-03-23 20:09:44 +01:00
Fabien Potencier
d5090ee044 merged branch schmittjoh/processFailedException (PR #3633)
Commits
-------

57de69f added an exception for failed processes

Discussion
----------

added an exception for failed processes

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

by Seldaek at 2012-03-19T07:27:56Z

So this is just there to use if you want to throw an exception when a process call failed in your application? It doesn't seem enabled by default, which I think is good anyway.

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

by stof at 2012-03-19T07:44:43Z

@Seldaek yeah, I guess this is a way to make it easier to reuse what he implemented for Assetic first.

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

by fabpot at 2012-03-23T15:08:26Z

How and when do you use such an exception?

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

by schmittjoh at 2012-03-23T17:22:16Z

It's intended for your own code to give you a nice and meaningful error message without having to repeat the same code whereever you are dealing with a Process:

```php
if (0 !== $proc->run()) {
    throw new ProcessFailedException($proc);
}
2012-03-23 19:56:05 +01:00
Fabien Potencier
5041f85878 tweaked UPGRADE file 2012-03-23 18:01:12 +01:00
Fabien Potencier
afdecaf542 [HttpFoundation] fixed a test 2012-03-23 18:01:05 +01:00
Fabien Potencier
09ab6430c0 merged branch drak/session_flashmessages (PR #3267)
Commits
-------

5ae76f1 [HttpFoundation] Update documentation.
910b5c7 [HttpFoudation] CS, more tests and some optimization.
b0466e8 [HttpFoundation] Refactored BC Session class methods.
84c2e3c [HttpFoundation] Allow flash messages to have multiple messages per type.

Discussion
----------

[2.1][HttpFoundation] Multiple session flash messages

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes, but this already happened in #2583.  BC `Session` methods remain unbroken.
Symfony2 tests pass: yes
Fixes the following tickets: #1863
References the following tickets: #2714, #2753, #2510, #2543, #2853
Todo: -

This PR alters flash messages so that it is possible to store more than one message per flash type using the `add()` method or by passing an array of messages to `set()`.

__NOTES ABOUT BC__

This PR maintains BC behaviour with the `Session` class in that the old Symfony 2.0 methods will continue to work as before.

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

by drak at 2012-02-13T06:28:33Z

I think this is ready for review @fabpot @lsmith77

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

by lsmith77 at 2012-02-14T19:30:39Z

the FlashBag vs. AutoExpireFlashBag behavior and setup difference should probably also be explained in the upgrading log

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

by drak at 2012-02-15T04:43:14Z

@lsmith77 Those differences are explained already in the changelog

 * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`.
   This makes the implementation ESI compatible.
 * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire behaviour of messages auto expiring
   after one page page load.  Messages must be retrived by `get()` or `all()`.

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

by Crell at 2012-02-19T17:35:34Z

Drak asked me to weigh in here with use cases.  Drupal currently has a similar session-stored-messaging system in place that I'd like to be able to replace with Flash messages.  We frequently have multiple messages within a single request, however, so this change is critical to our being able to do so.

For instance, when saving an article in Drupal there is, by default, a "yay, you saved an article!" type message that gets displayed.  If you also have the site configured to send email when a post is updated, you may see a "email notifications sent" message (depending on your access level).  If you have a Solr server setup for search, and you're in debug mode, there will also be a "record ID X added to Solr, it should update in 2 minutes" message.  And if there's a bug somewhere, you'll also get, as an error message rather than notice message, a "Oops, E_NOTICE on line 54" message.

Form validation is another case.  If you have multiple errors in a single form, we prefer to list all of them.  So if you screw up 4 times on a form, you may get 4 different error messages showing what you screwed up so you can fix it in one go instead of several.

Now sure, one could emulate that by building a multi-message layer on top of single-layer messages, but, really, why?  "One is a special case of many", and there are many many cases where you'll want to post multiple messages.  Like, most of Drupal. :-)

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

by lsmith77 at 2012-03-06T20:55:51Z

@fabpot is there any information you still need before merging this? do you want more discussion in which case you might want to take this to the mailing list ..

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

by drak at 2012-03-08T18:54:13Z

Another plus for this PR is that it requires no extra lines of code in templates etc to display the flashes, see https://github.com/symfony/symfony/pull/3267/files#diff-1

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

by drak at 2012-03-15T06:38:21Z

Rebased against current `master`, should be mergeable again..

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

by evillemez at 2012-03-17T03:08:41Z

+1 to this, I have an extended version of HttpFoundation just for this... would love to get rid of it.
2012-03-23 17:58:09 +01:00
Fabien Potencier
a597453fb3 merged branch schmittjoh/configurableExtension (PR #3632)
Commits
-------

3f2b917 added a configurable extension base class

Discussion
----------

added a configurable extension base class

This is mostly a convenience class which provides first-class integration with the Config/Definition component.
2012-03-23 16:03:48 +01:00
Fabien Potencier
6868e5177b merged branch nervo/patch-1 (PR #3684)
Commits
-------

09054f7 [Validator] Fix switch breaking in max/min length for constraint guesser, when a "Symfony\Component\Validator\Constraints\Type" constraint type is not in numeric types array

Discussion
----------

[Validator] Fix form type guesser

[Validator] Fix switch breaking in max/min length for constraint guesser, when a "Symfony\Component\Validator\Constraints\Type" constraint type is not in numeric types array

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

by vicb at 2012-03-23T14:19:27Z

You're right, thanks for the fix (I did break it !)
2012-03-23 15:43:59 +01:00