Commit Graph

5499 Commits

Author SHA1 Message Date
Christophe Coevoet
11369eb7e4 Fixed phpdoc 2011-07-11 14:08:49 +02:00
Christophe Coevoet
dbe1854e1f Added a AccessDeniedHttpException to wrap the AccessDeniedException.
See #1631
2011-07-11 13:12:24 +02:00
jdreesen
f0765618de [FrameworkBundle] Synced German validator translation 2011-07-11 12:41:21 +02:00
Arnout Boks
bf7ca509a2 [FrameworkBundle] Synced Dutch validator translation 2011-07-11 12:06:18 +02:00
Fabien Potencier
8a653f2335 merged branch stloyd/patch-1 (PR #1629)
Commits
-------

e54ad66 [Validator] Polish translation sync.

Discussion
----------

[Validator] Polish translation sync.
2011-07-11 11:57:54 +02:00
Fabien Potencier
6a7359389d removed usage of \Exception as PHPUnit won't allow to catch them anymore in the next major version 2011-07-11 11:54:00 +02:00
Joseph Bielawski
e54ad66e7d [Validator] Polish translation sync. 2011-07-11 02:48:27 -07:00
Fabien Potencier
41210b07c7 [FrameworkBundle] fixed form PHP templates for previous merge 2011-07-11 11:38:46 +02:00
Fabien Potencier
4e605aa761 merged branch Seldaek/form_tpl (PR #1519)
Commits
-------

52fdd53 [Bridge/Twig] Add required class to labels that match required fields

Discussion
----------

[Bridge/Twig] Add required class to labels that match required fields

I have used this to simply style labels that are required with a red star behind them using this CSS:

``` css
label.required::after {
	content: " *";
	color: #c00;
}
```

The problem is that you can't use `input[required] + label::after` as a selector since the label is typically rendered before the input. There is no way to check for an element that is *followed by* another, only elements *following*.

Of course this CSS in particular won't work except in the latest browsers, but you could still use the `label.required` selector to add a background image and so on. I think this is a very common use case and therefore I think it'd benefit the core framework.

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

by fabpot at 2011/07/05 01:27:49 -0700

Can you also update the PHP templates?

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

by schmittjoh at 2011/07/05 01:43:33 -0700

How about namespacing these css classes, like for example "sf-form-required"?

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

by stloyd at 2011/07/05 01:50:58 -0700

I would prefer an @schmittjoh naming, or even adding ability to setup it thought options.

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

by fabpot at 2011/07/05 01:54:36 -0700

Please, do not add more options. Prefix with `sf` is actually a good idea but people will argue that this is not a good idea because it gives too much information about the technology used to create the website (that's one of the things that came up pretty often in symfony1).

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

by schmittjoh at 2011/07/05 02:00:11 -0700

An option is not such a good idea imo since you likely want to have a uniform naming strategy across your entire site. How about adding a new service CssNamingStrategy?

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

by stloyd at 2011/07/05 02:01:19 -0700

Then this can be some simpler one not giving such informations i.e.: `form-label-required`, `label-required`, `framework-form-required`, `form-required` or whatever else ;-)

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

by fabpot at 2011/07/05 02:16:41 -0700

It cannot be configurable as it would potentially break bundles that come with stylesheets.

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

by stloyd at 2011/07/05 02:21:10 -0700

IMO if we decide to add this one, we could add same to `inputs/selects/etc` with `required` option.

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

by schmittjoh at 2011/07/05 02:21:59 -0700

I think it can, consider an interface like this:

```php
interface CssNamingStrategyInterface
{
    function getCssName($class);
}
```

This will give people a lot of flexibility, and it also does allow them to exclude classes which for example are provided by third-party bundles.

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

by Seldaek at 2011/07/05 02:47:54 -0700

Wow guys, if this turns into a full blown class generator solution, I'm happy to close the PR.

"required" is not a name that's commonly used for main page elements, it's typically associated with forms, and therefore I don't see the need to make it unnecessary longer/namespaced. Similarly I don't see the need to add it to the input/select/.., because they already have an attribute, which you can very easily select as: `input[required]` in CSS. That works everywhere except IE6, but we can't build for the future on very old browsers. If you really want support for IE6, you can override the templates imo. But core should be looking forward, as it already is with HTML5, form markup, etc.

As for calling it form-label-required or label-required, again, I don't see the benefit, you can use `label.required` if you want to avoid conflicts with non-label elements having a required class, or a safer `form .required`. There are plenty of options in CSS itself, let's not make this overly complex.

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

by schmittjoh at 2011/07/05 02:52:17 -0700

see
http://code.google.com/intl/de-DE/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors

On Tue, Jul 5, 2011 at 11:47 AM, Seldaek <
reply@reply.github.com>wrote:

> Wow guys, if this turns into a full blown class generator solution, I'm
> happy to close the PR.
>
> "required" is not a name that's commonly used for main page elements, it's
> typically associated with forms, and therefore I don't see the need to make
> it unnecessary longer/namespaced. Similarly I don't see the need to add it
> to the input/select/.., because they already have an attribute, which you
> can very easily select as: `input[required]` in CSS. That works everywhere
> except IE6, but we can't build for the future on very old browsers. If you
> really want support for IE6, you can override the templates imo. But core
> should be looking forward, as it already is with HTML5, form markup, etc.
>
> As for calling it form-label-required or label-required, again, I don't see
> the benefit, you can use `label.required` if you want to avoid conflicts
> with non-label elements having a required class, or a safer `form
> .required`. There are plenty of options in CSS itself, let's not make this
> overly complex.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1519#issuecomment-1502560
>

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

by Seldaek at 2011/07/05 03:11:50 -0700

Really? Come on, we're talking about forms, it's not like you have billions of form/input tags per page that have to be parsed by the browser when you select that. Also you don't have to select the elements, if you want true performance just use no stylesheet, your users will thank you.

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

by schmittjoh at 2011/07/05 03:30:40 -0700

Your CSS selectors not only affect the performance of form elements, but of all elements that have a "required" class. Likewise, the same applies if we decide to add more classes.

Why close the door for people who care about performance? We can easily avoid this by making the css class more specific as suggested earlier. The idea with the renaming strategy is one step further and allows people to "obfuscate" which tool was used to generate the form, or do additional optimizations like shortening the css name.

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

by lenar at 2011/07/05 03:34:34 -0700

@Seldaek: Just for remark I've seen matrix forms spanning multiple screenfuls horizontally and vertically
containing tens of thousands inputs. Not pretty, but they do exist. Basically "poor" man's/company's excel
emulation or something.

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

by Seldaek at 2011/07/05 04:19:13 -0700

@schmittjoh, @lenar: We're catering to the most common use case, for which this will be more than fast enough. Small/medium scale websites don't have to optimize on CSS rules parsing, they usually have much bigger issues to deal with. If you really care about it, overriding the block to remove the class is just as easy as it was to for me to add it, but IMO this is the edge case.

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

by schmittjoh at 2011/07/05 05:37:19 -0700

IMO Symfony should follow best practices by encouraging to use class selectors, and not tag selectors for the reasons explained on the page I linked.

Anyway, I think everybody made his points. Time for @fabpot to make a decision :)
2011-07-11 11:32:26 +02:00
Fabien Potencier
fa78e78f5f [HttpFoundation] added some information in a phpdoc 2011-07-11 11:30:24 +02:00
Fabien Potencier
7f960a10f2 merged branch gbirke/form_error_docs (PR #1599)
Commits
-------

22a49f1 Better docstring for FormError constructor

Discussion
----------

Better docstring for FormError constructor

Better docs for placeholder format of FormError.
2011-07-11 11:28:00 +02:00
Fabien Potencier
c188ca85b9 merged branch vicb/form/translate (PR #1627)
Commits
-------

24e0d71 [FrameworkBundle] Fix a translatable string from the Form default validator
30d348d [Form] Make the default invalid message translatable

Discussion
----------

[Form] Translation

The first commit adds the ability to customize the default message when the form is invalid:

  * Make it an option in the form builder,
  * Allow placeholders in the message,
  * The default value `This value is not valid` exists in the translation files.

The second commit updates a source string in the XLIFF files to make it translatable. All translations should be updated accordingly. The source string is from the [default validator](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Validator/DefaultValidator.php#L27).

This PR should fix The issue #997.

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

by fabpot at 2011/07/11 01:53:05 -0700

The first commit is not about making the message translatable, but to make it customizable (as the message is used for very different purposes depending on the Type).

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

by fabpot at 2011/07/11 01:55:11 -0700

The "This value is not valid" string should be added to the translation files too.

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

by vicb at 2011/07/11 02:02:51 -0700

@fabpot it was not translatable as the name was hardcoded in the message (instead of using a placeholder). So yes it becomes translatable now (and "customize"able as explained in the PR message).

I have also removed the form name from the default message as I don't think it brings any added value.

`This value is not valid` already exists in the translation files (see id=24).
2011-07-11 11:25:45 +02:00
Fabien Potencier
0e4d057984 moved some RFC-tweaking logic in Response to a public method to make it reusable 2011-07-11 11:22:12 +02:00
Fabien Potencier
1a576552f8 [HttpFoundation] fixed unit test for previous merge 2011-07-11 11:02:30 +02:00
Fabien Potencier
de2ab0b506 merged branch lenar/patch-3 (PR #1551)
Commits
-------

f7d0f65 RFC2616 changes
b9a218a [HttpFoundation] set Content-Length header to the length of content

Discussion
----------

[HttpFoundation] set Content-Length header to the length of content

I can't think of why this could be bad but if somebody knows please chime in.

The good thing is that with this change keepalive will work out of the box.

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

by Seldaek at 2011/07/06 05:34:51 -0700

That sounds like a great change. I think it might explain/fix the issues I've encountered with AppCache on my production box. Never had time to look into it, but IIRC I noticed the missing Content-Length, and it seemed to load forever.

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

by fabpot at 2011/07/06 06:46:50 -0700

The `Content-Length` is automatically added by servers like Apache. Moreover, sometimes, you should not add it: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4

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

by lenar at 2011/07/06 07:54:45 -0700

It is not added automatically by default. Yes, in case of Apache it is actually added if deflate module is enabled and if that module decides to compress the content (decision based on content-type).

About RFC2616: I will read it and add changes to this PR if applicable.

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

by fabpot at 2011/07/06 08:38:14 -0700

e943fde2ef

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

by Seldaek at 2011/07/06 08:45:22 -0700

@lenar all you have to do is skip setting the Content-Length for `1xx`, `204`, and `304` responses I believe.

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

by Seldaek at 2011/07/06 08:46:54 -0700

But this should maybe be done in sendHeaders() à la `fixContentType`, because you can't be sure about the statusCode before that.

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

by lenar at 2011/07/06 13:55:33 -0700

I propose this based on what I read and understood from RFC2616.

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

by mheleniak at 2011/07/10 03:57:26 -0700

+1
2011-07-11 10:58:31 +02:00
DerStoffel
377ef7974f Error Message id 1 & 2 changed in "true" & "false", since direct german translation (wahr, falsch) are properly missleading. Corrected typos. 2011-07-11 01:18:45 -07:00
Victor Berchet
24e0d71d92 [FrameworkBundle] Fix a translatable string from the Form default validator 2011-07-11 08:41:58 +02:00
Victor Berchet
30d348d18d [Form] Make the default invalid message translatable 2011-07-11 08:36:37 +02:00
Fabien Potencier
21c80df3a1 merged branch arnaud-lb/issues/1598 (PR #1603)
Commits
-------

e6a2d76 delay resolving values of extensions config until all files are loaded

Discussion
----------

[DependencyInjection] Delay resolving values of extensions' config until all files are loaded

This addresses #1598.

This delays resolving of extensions' configuration until all files are loaded. Without this, overriding parameters do not work for extensions.
2011-07-11 08:15:47 +02:00
Fabien Potencier
ea7a0eb19c [Security] fixed redirection URLs when using {_locale} in the pattern 2011-07-11 08:09:36 +02:00
Fabien Potencier
9301ad00fd merged branch tero/master (PR #1624)
Commits
-------

0149ba9 Added finnish translation for validator messages

Discussion
----------

Created finnish translation file for validator messages
2011-07-10 21:55:14 +02:00
Fabien Potencier
ff92ba79f0 merged branch davideborsatto/translation-it (PR #1623)
Commits
-------

f359e3d Updated italian translations

Discussion
----------

Updated and corrected italian translations

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

by davideborsatto at 2011/07/10 12:41:29 -0700

Previously they were not translated that good, plus there were a few typos here and there.
2011-07-10 21:53:42 +02:00
Tero Alén
0149ba99d6 Added finnish translation for validator messages 2011-07-10 22:44:49 +03:00
Davide Borsatto
f359e3db18 Updated italian translations 2011-07-10 12:37:17 -07:00
Guilherme Blanco
89c8962574 Fixed minor portuguese brazilian messages. File is pretty much up to date, just small glitches. 2011-07-10 12:19:10 -07:00
Fabien Potencier
1a5b14d49d merged branch xmontana/master (PR #1618)
Commits
-------

b8b8869 updated translation to catalan

Discussion
----------

Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.ca.xliff
2011-07-10 19:53:41 +02:00
Fabien Potencier
99f5eac71a merged branch wtfzdotnet/patch-2 (PR #1619)
Commits
-------

0be00c1 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.nl.xliff via GitHub

Discussion
----------

Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validato

Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.nl.xliff via GitHub
2011-07-10 19:53:25 +02:00
Fabien Potencier
f88a7a78b0 merged branch 77web/add_ja_translation_11_july (PR #1620)
Commits
-------

d53f312 changed "should" to "must" in message 6 and 7. also moved message 32 as replacement of message 5, according to note by yethee
e151c80 updated japanese translations

Discussion
----------

updated japanese translations

Please update japanese translations.
I  picked up some messages from the latest sources of validation classes on your master branch, because translations for many other languages seems not to contain messages for recent validator classes, such as Image,Ip,Locale,Language.
Thanks in advance!

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

by yethee at 2011/07/10 09:23:01 -0700

> "One or more..." is on message#33 in my commit, should I locate #33 just after #5?

Not necessarily, the order of messages is not important, AFAIK.
2011-07-10 19:53:09 +02:00
77web
d53f312e2b changed "should" to "must" in message 6 and 7. also moved message 32 as replacement of message 5, according to note by yethee 2011-07-11 00:50:09 +09:00
Michael Roterman
0be00c13dd Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.nl.xliff via GitHub 2011-07-10 08:24:56 -07:00
Xmontana
b8b8869f05 updated translation to catalan 2011-07-10 17:07:42 +02:00
77web
e151c805a0 updated japanese translations 2011-07-10 23:53:04 +09:00
Fabien Potencier
29460becde merged branch drm/master (PR #1615)
Commits
-------

9714cfc Fixes fatal error when intl module is not installed.

Discussion
----------

Session instantiation breaks with Fatal error if intl module is not installed.

A check for class_exists in setPhpDefaultLocale() fixes this, though I got the feeling it should be resolved with a proxy or subscriber object; setPhpDefaultLocale feels like a hack now.

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

by stealth35 at 2011/07/10 06:32:43 -0700

Locale::setDefault don't throw any exception
Maybe just :

```php
if (class_exists('Locale', false)) {
    return \Locale::setDefault($this->locale);
} else {
    return false;
}
```
2011-07-10 15:34:36 +02:00
Vladislav
cd7eb02816 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.ru.xliff via GitHub 2011-07-10 06:28:16 -07:00
drm
9714cfc4f9 Fixes fatal error when intl module is not installed. 2011-07-10 15:15:04 +02:00
Javier Eguíluz
bb6eefed55 [FrameworkBundle] Updated Spanish validator translations 2011-07-10 13:39:21 +02:00
Fabien Potencier
86356661f7 merged branch beberlei/Issue1376 (PR #1612)
Commits
-------

08b4219 [DoctrineBridge] Issue #1376 - Unique Validator does not work with null values

Discussion
----------

Issue1376

[DoctrineBridge] Issue #1376 - Unique Validator does not work with null values
2011-07-10 11:14:23 +02:00
Benjamin Eberlei
08b4219347 [DoctrineBridge] Issue #1376 - Unique Validator does not work with null values 2011-07-10 11:06:21 +02:00
Deni
c3f89992b5 [FrameworkBundle] Fixes Russian translations for the validators. 2011-07-10 12:47:22 +04:00
Fabien Potencier
21cf0b15ab merged branch yethee/ru_translations (PR #1601)
Commits
-------

c1cab27 [FrameworkBundle] Updated Russian translations for validators.

Discussion
----------

[FrameworkBundle] Updated Russian translations for validators.

Sync translations with the actual validator constraints.

Removed some translations (they are not found among the constraints):

  - `This value should be instance of class {{ class }}`
  - `This field group should not contain extra fields`
  - `The uploaded file was too large. Please try to upload a smaller file`
2011-07-10 09:58:31 +02:00
Fabien Potencier
bbf2f05566 merged branch excelwebzone/hebrew_translations (PR #1605)
Commits
-------

801e578  Add hebrew translations

Discussion
----------

Add hebrew translations
2011-07-10 09:56:53 +02:00
excelwebzone
801e578112 Add hebrew translations 2011-07-09 10:37:38 -07:00
Arnaud Le Blanc
e6a2d76366 delay resolving values of extensions config until all files are loaded 2011-07-09 18:03:05 +02:00
Christophe Coevoet
7517fa4448 [DoctrineBundle] Fixed the transient test 2011-07-09 16:52:49 +02:00
Deni
c1cab277be [FrameworkBundle] Updated Russian translations for validators. 2011-07-09 18:49:22 +04:00
Christophe Coevoet
f21dc42358 [DoctrineBundle] Fixed the Registry::getEntityManagerForObject method 2011-07-09 16:31:24 +02:00
Gabriel Birke
22a49f14df Better docstring for FormError constructor 2011-07-09 16:14:57 +02:00
Joseph Bielawski
c1866e3710 Profiler search typo 2011-07-09 00:42:37 -07:00
Fabien Potencier
4a7b7597d8 merged branch marcw/validator-choice (PR #1577)
Commits
-------

df57e0f [Validator] Added strict option to ChoiceConstraint.

Discussion
----------

[Validator] Added strict option to ChoiceConstraint.

By default, ChoiceValidator was ensuring strict type when checking if value is present in choices. This behavior is a problem when you want to validate against integer values. As all data you will receive from a request will be typed as a string, you won't be able to validate these numeric values.
This patch solves this.

In order for being nice to developers, I've set "strict" to false by default.
2011-07-09 09:19:08 +02:00
Fabien Potencier
2a5bf56a3a merged branch ornicar/redirectResponseIndentation (PR #1589)
Commits
-------

6c736c9 Fix RedirectResponse HTML indentation and constructor phpDoc

Discussion
----------

Fix RedirectResponse HTML indentation and constructor phpDoc

Removes extra indents from the redirection response content.
2011-07-09 09:15:20 +02:00
Alif Rachmawadi
937af2f7d2 add indonesian translations 2011-07-09 09:52:20 +07:00
ornicar
6c736c936f Fix RedirectResponse HTML indentation and constructor phpDoc 2011-07-08 18:14:45 -07:00
Fabien Potencier
aed87c50f0 merged branch aboks/dutch_translations (PR #1586)
Commits
-------

45c2da7 [FrameworkBundle] Updated Dutch validator translations

Discussion
----------

[FrameworkBundle] Updated Dutch validator translations

Synchronized Dutch validator translations for some recent changes.
2011-07-08 10:45:31 +02:00
Fabien Potencier
103e9d1c6e merged branch sortex/sk_translations (PR #1584)
Commits
-------

d0258dd [FrameworkBundle]Slovak translations

Discussion
----------

Slovak translations

Slovak translations for framework bundle
2011-07-08 10:45:14 +02:00
Arnout Boks
45c2da75cf [FrameworkBundle] Updated Dutch validator translations 2011-07-08 10:39:56 +02:00
Sortex
d0258dd483 [FrameworkBundle]Slovak translations 2011-07-08 09:23:39 +02:00
Fabien Potencier
8cba4903d8 [Process] removed workaround as it seems to not work anymore after the recent changes 2011-07-08 09:14:48 +02:00
Fabien Potencier
c85fd081c8 [FrameworkBundle] fixed _internal route when the path contains dots 2011-07-07 17:25:53 +02:00
marc.weistroff
df57e0fe9a [Validator] Added strict option to ChoiceConstraint. 2011-07-07 15:11:36 +02:00
Fabien Potencier
0753f86dc1 [Translation] fixed CS 2011-07-07 12:27:49 +02:00
Fabien Potencier
d184b33bff merged branch stealth35/patch-8 (PR #1576)
Commits
-------

bb1b480 [Translation][Loader] CSV controls for CsvFileLoader

Discussion
----------

[Translation][Loader] CSV controls for CsvFileLoader
2011-07-07 12:26:16 +02:00
Fabien Potencier
0b0356f348 [HttpKernel] fixed exception handler when an exception is thrown during handling 2011-07-07 12:24:58 +02:00
stealth35
bb1b48046d [Translation][Loader] CSV controls for CsvFileLoader 2011-07-07 02:46:07 -07:00
Fabien Potencier
4f9060c929 [Routing] added back a comment that were deleted previously 2011-07-07 11:11:30 +02:00
Fabien Potencier
c061b4576b merged branch Seldaek/urlgen (PR #1573)
Commits
-------

ac1448f [Routing] Revert to rawurlencode + whitelisting of '/'

Discussion
----------

[Routing] Revert to rawurlencode + whitelisting of '/'

After more discussion on 761724ae57 - sorry you merged too fast for once ;)
2011-07-07 11:08:08 +02:00
Fabien Potencier
cce2bc59a8 fixed CS 2011-07-07 11:07:02 +02:00
Fabien Potencier
9b3c2ca3d3 merged branch vicb/uploaded-file/max-size (PR #1574)
Commits
-------

6786e81 [HttpFoundation] code factorization in UploadedFile

Discussion
----------

[HttpFoundation] code factorization in UploadedFile

As both #1542 and #1544 have been merged.
2011-07-07 11:06:29 +02:00
Fabien Potencier
76a5816d60 [HttpKernel] fixed recursion when flattenning an exception stack trace 2011-07-07 10:59:18 +02:00
Victor Berchet
6786e81f61 [HttpFoundation] code factorization in UploadedFile 2011-07-07 10:47:10 +02:00
Jordi Boggiano
ac1448f573 [Routing] Revert to rawurlencode + whitelisting of '/' 2011-07-07 10:44:17 +02:00
Fabien Potencier
2ec4b04547 merged branch Seldaek/urlgen (PR #1569)
Commits
-------

6039569 [Routing] Add # and ? to escaped chars

Discussion
----------

[Routing] Add # and ? to escaped chars

See comments on 761724ae57
2011-07-07 09:44:11 +02:00
Fabien Potencier
59870bfe02 fixed typo 2011-07-07 09:42:47 +02:00
Fabien Potencier
3a5d508766 [Console] replaced fgets by stream_get_line in DialogHelper
Problem with fgets is that false means two things: an error or the end of the stream.
That's ok for STDIN, but it becomes a problem when using another stream (in a unit test for instance).
2011-07-07 09:41:45 +02:00
Jordi Boggiano
603956979c [Routing] Add # and ? to escaped chars 2011-07-07 09:38:15 +02:00
Fabien Potencier
7eec2ca7b3 [Form] added a form type name validator 2011-07-07 09:16:13 +02:00
Fabien Potencier
db415db0af [HttpFoundation] tweaked previous merge 2011-07-07 07:41:40 +02:00
Fabien Potencier
c41da9d447 merged branch ktomk/patch-1 (PR #1558)
Commits
-------

db37bbb HTTP 1.1 / RFC 2616 - Make Redirect response HTTP body having a HTML body.

Discussion
----------

[HttpFoundation] Redirect response is missing a HTML body

HTTP 1.1 / RFC 2616 - Make Redirect response HTTP body having a HTML body as "...the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s)." (unless HEAD request, see response codes 301, 302, 303 and 307).

See [10.3 Redirection 3xx *in* Hypertext Transfer Protocol -- HTTP/1.1 (RFC 2616 Fielding, et al.)](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3) and [9.3 Redirection 3xx *in* Hypertext Transfer Protocol -- HTTP/1.0](http://tools.ietf.org/html/rfc1945#section-9.3).

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

by stloyd at 2011/07/06 10:50:50 -0700

As we allow changing protocol version, and by [default](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Response.php#L88) use 1.0 this should have an use also `$this->getProtocolVersion()`.

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

by ktomk at 2011/07/06 10:57:48 -0700

(Updated the original comment and linked the HTTP 1.0 specs in there)

Just have reviewed the RFCs and the processing inside `[HttpFoundation]`.  The response class [identifies the following status codes as redirects](db37bbb189/src/Symfony/Component/HttpFoundation/Response.php (L741)): `201`, `301`, `302`, `303` and `307`. That's quite the same list I compiled above where I did only check for 3xx codes. In HTTP/1.0 (symfony default) the 201 response can contain the new location in it's entity (body) of the response (in contrast, [RFC 1945 is *not* talking about the location header explicitly](http://tools.ietf.org/html/rfc1945#section-9.2); see as well [10.11  Location](http://tools.ietf.org/html/rfc1945#section-10.11), that's [in HTTP/1.1 done](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2), compare [14.30 Location](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30)).

So I would say HTTP 1.0 is properly reflected with the changes as well and the concrete Response object [is already taking care for protocol validity](db37bbb189/src/Symfony/Component/HttpFoundation/RedirectResponse.php (L41)).
2011-07-07 07:37:39 +02:00
Fabien Potencier
bb5075d820 [HttpFoundation] prevented Response headers to be sent twice
This change allows for more flexibility if the developer wants to flush
the Response content early (the drawback being that Response listeners
won't be able to tweak the HTTP headers anymore).

There is another benefit: avoid the infamous
"Fatal error: Exception thrown without a stack frame in Unknown on line 0".

Here is a small scenario when this can happen (thanks dtee for identifying this issue):

* Call flush() in controller to output html early, then throw exception
* ExceptionHandler triggers handle() function and return new Response object to output...
* Because the header is sent (flush() call in Controller), php's E_WARNING error get raised, which gets handled by ErrorHandler->handle() and it throws new ErrorException()
* PHP fatals to prevent Exception loop: "Fatal error: Exception thrown without a stack frame in Unknown on line 0"
2011-07-07 07:34:35 +02:00
Fabien Potencier
6645cb44c7 merged branch dlsniper/romanian-validation (PR #1568)
Commits
-------

8a6ac0c Added Romanian translations for validators

Discussion
----------

[Validator] Added Romanian translations

Added all strings up to commit SHA: d58ba34246
2011-07-07 07:10:20 +02:00
Fabien Potencier
430b5cdfa9 merged branch lenar/validator-et (PR #1567)
Commits
-------

b4cdecd Additional et translations

Discussion
----------

[Validator] Additional Estonian translations
2011-07-07 07:09:45 +02:00
Florin Patan
8a6ac0ce4e Added Romanian translations for validators 2011-07-06 18:59:43 -04:00
lenar
b4cdecd423 Additional et translations 2011-07-07 00:24:48 +03:00
jdreesen
39d3a90b6c Sync German translation with commit: d58ba34246 2011-07-06 22:55:00 +02:00
lenar
f7d0f651a3 RFC2616 changes 2011-07-06 23:50:37 +03:00
Lenar Lõhmus
b9a218a5c1 [HttpFoundation] set Content-Length header to the length of content 2011-07-06 23:47:40 +03:00
Michel Weimerskirch
c76d2b5807 Fix error message 2011-07-06 12:54:57 -07:00
Michel Weimerskirch
a5822314eb Complete Luxembourgish translation 2011-07-06 12:41:51 -07:00
Joseph Bielawski
23ec11949e Revert copy&paste 2011-07-06 10:25:12 -07:00
Joseph Bielawski
7a95330804 Sync polish translation with commit: d58ba34246 2011-07-06 10:22:51 -07:00
Tom Klingenberg
db37bbb189 HTTP 1.1 / RFC 2616 - Make Redirect response HTTP body having a HTML body. 2011-07-06 09:29:18 -07:00
Fabien Potencier
c12676b0a1 [Doctrine] added a better error message when an Entity has no __toString method defined 2011-07-06 18:10:55 +02:00
Fabien Potencier
498f72ce9c merged branch stof/monolog (PR #1556)
Commits
-------

f8b5f35 [MonologBundle] Refactored the way to configure the email prototype for swiftmailer
874fb95 [MonologBundle] Refactored the configuration of processors

Discussion
----------

Monolog

This refactors the way processors and email prototype are configured in MonologBundle for consistency with the other bundles. The hack using ``@id`` to use a service in the semantic configuration is not used anywhere else in Symfony2.
This removes the ability to use a static callback as processor (or a PHP function) but adds the support of adding a processor only for a given logging channel (for processors attached to the logger) which was not possible previously.

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

by stof at 2011/07/06 07:33:52 -0700

the PR for the doc and the standard edition are coming.
2011-07-06 17:49:40 +02:00
Fabien Potencier
722ad12a2d renamed proxy setting to trust_proxy_headers 2011-07-06 17:42:58 +02:00
Fabien Potencier
e943fde2ef [HttpKernel] fixed HEAD requests Content-Length header 2011-07-06 17:37:42 +02:00
Christophe Coevoet
f8b5f350dc [MonologBundle] Refactored the way to configure the email prototype for swiftmailer 2011-07-06 16:25:32 +02:00
Fabien Potencier
5f6c5f02d3 removed obsolete code 2011-07-06 16:11:01 +02:00
Christophe Coevoet
874fb9540a [MonologBundle] Refactored the configuration of processors 2011-07-06 15:52:04 +02:00
Fabien Potencier
14c8cc2962 [DoctrineBundle] ensured that the ORM\ prefix is always set for CLI commands 2011-07-06 15:49:36 +02:00
Fabien Potencier
befb234e5c merged branch stof/form_type (PR #1552)
Commits
-------

ef022c0 Removed the magical guessing of the type name to avoid WTF issues

Discussion
----------

Removed the magical guessing of the type name to avoid WTF issues

As discussed on IRC, this removes the magical method to avoid breaking the user-land code by reusing the same name than another type which overrides it. This makes the user aware that a type should have a name as they now have to implement the method themselves.

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

by jalliot at 2011/07/06 05:35:30 -0700

Doc and generator should be modified as well if it's merged.
2011-07-06 15:36:48 +02:00
Fabien Potencier
001af2ae4a [DependencyInjection] enhanced error message 2011-07-06 15:26:21 +02:00