Commit Graph

1717 Commits

Author SHA1 Message Date
Fabien Potencier
74bc699b27 moved management of the locale from the Session class to the Request class
The locale management does not require sessions anymore.

In the Symfony2 spirit, the locale should be part of your URLs. If this is the case
(via the special _locale request attribute), Symfony will store it in the request
(getLocale()).

This feature is now also configurable/replaceable at will as everything is now managed
by the new LocaleListener event listener.

How to upgrade:

The default locale configuration has been moved from session to the main configuration:

Before:

framework:
    session:
        default_locale: en

After:

framework:
    default_locale: en

Whenever you want to get the current locale, call getLocale() on the request (was on the
session before).
2011-10-08 18:34:49 +02:00
Miha Vrhovnik
395f580fd7 Rebuild resource files with genrb from ICU 4.2. as ICU 4.4 by default builds them in newer format.
Also added all files necessary to build resources.dat with pkgdat because syntax for command is so cryptic
2011-10-08 16:41:17 +02:00
Miha Vrhovnik
438581deda Skip test if running as superuser as it will fail 2011-10-08 14:10:49 +02:00
Jordi Boggiano
deb6dea76d [Translation] Add failing tests to verify that UTF-8 lang files can't be used with another charset 2011-10-07 11:20:16 +02:00
Fabien Potencier
0e852fe232 Merge branch '2.0'
* 2.0:
  [DoctrineBundle] fixed a unit test (detected thanks to PHP 3.6.0)
  [Form] Fixed lacking attributes in DateTimeType
2011-10-06 21:40:44 +02:00
Katsuhiro OGAWA
828b18f467 [Form] Fixed lacking attributes in DateTimeType 2011-10-05 17:57:43 +09:00
Fabien Potencier
55e7e1a198 [Translation] changed some unit tests for PHPUnit 3.6.0 compatibility 2011-10-04 09:36:09 +02:00
Fabien Potencier
fbe9aa526e merged 2.0 2011-10-04 09:32:13 +02:00
Fabien Potencier
92d19063a8 [Translation] changed some unit tests for PHPUnit 3.6.0 compatibility 2011-10-04 08:43:04 +02:00
Fabien Potencier
5c8a2fb48d [Routing] fixed route overriden mechanism when using embedded collections (closes #2139) 2011-09-30 12:01:46 +02:00
Danny Berger
e70c884f49 [Bridge/Monolog] Fix WebProcessor to accept a Request object. 2011-09-30 01:58:45 -04:00
Fabien Potencier
41a55ba8d7 Merge branch '2.0'
* 2.0:
  [Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed
  removed separator of choice widget when the separator is null
2011-09-29 16:17:23 +02:00
Fabien Potencier
d6c4bfb001 added a Size validator 2011-09-29 15:56:37 +02:00
Fabien Potencier
b9ba117208 [Validator] added a SizeLength validator 2011-09-29 15:45:52 +02:00
Fabien Potencier
d429594afb removed separator of choice widget when the separator is null 2011-09-29 10:14:34 +02:00
Fabien Potencier
029223d760 merged branch jalliot/subscriber-improv (PR #2148)
Commits
-------

5146a1f [EventDispatcher] Added possibility for subscribers to subscribe several times for same event

Discussion
----------

[EventDispatcher] Added possibility for subscribers to subscribe several times for same event

[EventDispatcher] Added possibility for subscribers to subscribe several times for same event

closes #2146

And it is of course fully BC :)

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

by jalliot at 2011/09/09 17:34:07 -0700

If merged, #2021 will have to reflect the change too
2011-09-28 18:24:57 +02:00
Fabien Potencier
885bb33791 merged 2.0 2011-09-28 16:08:31 +02:00
Fabien Potencier
6eeca8e36d merged branch stealth35/fix_2142 (PR #2290)
Commits
-------

b12ce94 [HttpFoundation] fix #2142 PathInfo parsing/checking

Discussion
----------

[HttpFoundation] fix #2142 PathInfo parsing/checking

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 15:02:56 +02:00
stealth35
b12ce94c38 [HttpFoundation] fix #2142 PathInfo parsing/checking
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 13:18:44 +02:00
Fabien Potencier
b4028350d2 [HttpFoundation] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:50 +02:00
Fabien Potencier
128468193f [BrowserKit] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:26 +02:00
Fabien Potencier
a57a4aff55 [DomCrawler] added a way to get parsing errors for Crawler::addHtmlContent() and Crawler::addXmlContent() via libxml functions 2011-09-28 10:00:18 +02:00
Fabien Potencier
7b204ed23a merged branch drak/paramaterbag_filter (PR #2261)
Commits
-------

c4a0f79 Updates according to suggestions.
6aec789 Added tests.
54454ba Added generic filtering to ParameterBag.

Discussion
----------

Added generic filtering to ParameterBag.

Adds filtering convenience using PHP's filter_var() e.g.

    $request->get->filter($key, '', false, FITLER_SANITIZE_STRING);

See http://php.net/manual/en/filter.filters.php for capabilities.

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

by GromNaN at 2011/09/25 15:41:50 -0700

What is the use case ?

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

by drak at 2011/09/25 15:52:19 -0700

Input variable validation/sanitization.  ParameterBag has a few built in like `getAlnum()` for example.  This method offer's PHP's full filtering and sanitization suite.

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

by fabpot at 2011/09/27 00:56:41 -0700

Can you add some unit tests for this new feature?

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

by drak at 2011/09/27 00:58:56 -0700

Sure thing.

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

by drak at 2011/09/27 01:07:03 -0700

Before I make the commit, is the method name ok for you or would you prefer it is called `getFiltered()`?

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

by fabpot at 2011/09/27 01:13:46 -0700

`filter` sounds good to me.

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

by drak at 2011/09/27 02:37:01 -0700

I've added some tests.

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

by stloyd at 2011/09/27 02:42:42 -0700

@drak IMO you must check that user don't use unknown filter and/or flags for filter.

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

by drak at 2011/09/27 02:48:38 -0700

@stloyd - I'm not sure that's practical at all, this is a wrapper for a built-in PHP function and I don't understand why we would need validate arguments for a PHP function - it's the coder's job to use the API correctly - none of the inputs to this function are coming from a web request.  It would also mean that the API would need to keep track of any upstream changes to constants in the PHP engine (which are just integers after all).  It's really just not practical.

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

by stealth35 at 2011/09/27 05:16:50 -0700

@drak it's could be cool to use `filter_id` ✌️

    if (is_string) {
        $filter = filter_id($filter);
    }

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

by drak at 2011/09/27 07:05:42 -0700

@stealth35 regarding this

    if (is_string) {
        $filter = filter_id($filter);
    }

I believe strongly in the use of IDEs when coding and autocomplete nicely provides when you type `FILTER_`.  Additionally, `filter_id()` only works on filters, but not for the flags, so I'm not entirely sure how useful it would be overall compared to using a good IDE (which you need when working with complex frameworks anyhow, imo :)

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

by drak at 2011/09/27 07:30:10 -0700

Ok check it now.
2011-09-27 17:21:30 +02:00
Drak
c4a0f799af Updates according to suggestions.
- Simplified logic of tests.
- Added more comments/docblocks.
- Added more convenience.
2011-09-27 20:14:32 +05:45
Drak
6aec7898e3 Added tests. 2011-09-27 15:20:51 +05:45
Fabien Potencier
9b37637184 [Form] added tests for previous merge 2011-09-27 10:12:54 +02:00
Josef Cech
85ed5c67dc [ClassLoader] Fixed state when trait_exists doesn't exists 2011-09-25 19:25:50 +02:00
Fabien Potencier
1103ca8185 merged 2.0 2011-09-25 11:52:31 +02:00
Fabien Potencier
49c585ebd2 Revert "merged branch stealth35/ini_bool (PR #2235)"
This reverts commit 363057b181, reversing
changes made to 545cd4cd63.
2011-09-25 11:33:22 +02:00
Fabien Potencier
fa13469bba Revert "[DependencyInjection] fixed array support for the ini loader"
This reverts commit e0ace8eaee.
2011-09-25 11:33:07 +02:00
Fabien Potencier
27fc06785b Revert "[DepedencyInjection] fixed unit tests"
This reverts commit b8e5a155e4.
2011-09-25 11:33:00 +02:00
Fabien Potencier
ea401564ba [Form] reverted partially previous commit 2011-09-24 16:42:12 +02:00
Fabien Potencier
78ebe11a0c [Form] added some missing tests for previous merge 2011-09-24 15:28:16 +02:00
Fabien Potencier
c832b71600 merged branch stloyd/repeatedtype (PR #1453)
Commits
-------

67c33a8 Rebased with master, and fixed wrong behavior with proper tests coverage
f8a6a4b Be sure that both fields have same value for required option in RepeatedType
0679220 Additional test coverage for changes in RepeatedType
b23d47d moved options test form from class->method scope
5fe5556 fixed accidental permission change
a969434 [Form] fixed CS, merged options, added tests
8819db3 [Form] Allow setting different options to repeating fields

Discussion
----------

[2.1] [Form] Allow setting different options at RepeatedType fields

This an test covered version of #1348 (rebased with master).

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

by stloyd at 2011/06/27 04:18:19 -0700

@fabpot What do you think about this ? I'm just not sure that we should allow setting `required` per field, IMO better would be forcing this option from default `$options['options']` and ignore that field in `$options['first_options']` and/or `$options['second_options']`.

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

by stloyd at 2011/07/02 00:00:04 -0700

@fabpot ping.

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

by fabpot at 2011/07/06 05:45:56 -0700

Let's discuss this new feature for 2.1.

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

by stloyd at 2011/08/24 01:12:59 -0700

Rebased with master.

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

by stof at 2011/09/04 05:02:42 -0700

@fabpot What do you think about this feature ? It is now time to discuss it :)

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

by fabpot at 2011/09/22 00:18:29 -0700

Tests do not pass.

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

by stloyd at 2011/09/24 01:54:42 -0700

@fabpot Should be ok now.
2011-09-24 15:22:26 +02:00
stloyd
67c33a8e02 Rebased with master, and fixed wrong behavior with proper tests coverage 2011-09-24 10:44:47 +02:00
stloyd
f8a6a4b1e5 Be sure that both fields have same value for required option in RepeatedType 2011-09-24 10:25:07 +02:00
stloyd
0679220b45 Additional test coverage for changes in RepeatedType 2011-09-24 10:25:06 +02:00
Helmer Aaviksoo
b23d47d274 moved options test form from class->method scope 2011-09-24 10:25:06 +02:00
Helmer Aaviksoo
5fe5556bea fixed accidental permission change 2011-09-24 10:25:06 +02:00
Helmer Aaviksoo
a96943482b [Form] fixed CS, merged options, added tests 2011-09-24 10:25:05 +02:00
Fabien Potencier
85ba3d0274 merged 2.0 2011-09-23 21:10:42 +02:00
Fabien Potencier
d830253876 [Routing] fixed unit tests broken by previous merge 2011-09-23 20:56:18 +02:00
Alberto Pirovano
ae3aded83f Added PCRE_DOTALL modifier to RouteCompiler to allow urlencoded linefeed in route parameters. 2011-09-23 16:53:06 +02:00
Fabien Potencier
b8e5a155e4 [DepedencyInjection] fixed unit tests 2011-09-23 11:59:37 +02:00
Fabien Potencier
e0ace8eaee [DependencyInjection] fixed array support for the ini loader 2011-09-23 11:45:30 +02:00
Fabien Potencier
ee12b67e4e [TwigBridge] rewrote the Twig translation extractor
* The extractor is now reusable as this is a proper Twig node visitor
* The new extractor covers more cases
2011-09-23 09:38:20 +02:00
Fabien Potencier
b6c8f639f0 [TwigBridge] fixed message keys extraction when no domain is defined in the template 2011-09-23 08:39:02 +02:00
Fabien Potencier
645bd8215e [DomCrawler] added unit tests for previous merge 2011-09-23 08:10:01 +02:00
Fabien Potencier
98abc8ed05 [DependencyInjection] changed the default YAML indentation to 4 spaces instead of 2 2011-09-23 08:05:09 +02:00
Fabien Potencier
e5294fee12 fixed unit tests broken by previous merge 2011-09-23 07:59:44 +02:00