Commit Graph

674 Commits

Author SHA1 Message Date
Pascal Borreli
b1c68815f5 Fixed PHPDoc 2013-01-11 17:38:19 +00:00
Dmitrii Chekaliuk
0a060cabeb Fix Russian and Ukrainian translations for Security component 2013-01-11 19:28:56 +02:00
jorgemartind
9d310647e9 Update src/Symfony/Component/Security/Resources/translations/security.es_CA.xlf
[Security] update catalonian translation
2013-01-11 18:10:54 +01:00
Fabien Potencier
aec3c8aa1d merged branch Burgov/patch-3 (PR #6702)
This PR was merged into the master branch.

Commits
-------

6b669fb Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf

Discussion
----------

Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf

see #6668

Some more minor tweaks
2013-01-11 14:34:34 +01:00
Fabien Potencier
d96b96e942 merged branch cristobal/master (PR #6707)
This PR was merged into the master branch.

Commits
-------

83d0469 Create security.no.xlf

Discussion
----------

Norwegian Translation for Security

Norwegian Translation
2013-01-11 14:15:10 +01:00
Joan Cruz
5ee65aa8be Contribution to translation to Catalan of the security messages 2013-01-11 14:12:53 +01:00
Cristobal Dabed
83d04699d2 Create security.no.xlf
Norwegian Translation
2013-01-11 05:12:25 -08:00
Bart van den Burg
6b669fbddf Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf
see #6668

Some more minor tweaks
2013-01-11 10:49:55 +01:00
Sinan Eldem
2617cf64c3 Added Turkish translation for security component 2013-01-11 10:47:35 +02:00
Fabien Potencier
0acefc9a81 merged branch sstok/patch-3 (PR #6691)
This PR was merged into the master branch.

Commits
-------

08f9c76 Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf

Discussion
----------

Minor tone of voice correction in security.nl.xlf

For the Dutch people under us. http://www.kiezelcommunicatie.nl/kiezelblog/woorden-die-niet-meer-mogen-aflevering-1/

Yes I'm picky ;)
2013-01-10 23:25:39 +01:00
Tiago Brito
0d6be2e81a Added Portuguese (Portugal) translation to Security
Added Portuguese from Portugal translation for Security component
2013-01-10 22:01:22 +00:00
Sebastiaan Stok
08f9c7633e Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf
For the Dutch people under us. http://www.kiezelcommunicatie.nl/kiezelblog/woorden-die-niet-meer-mogen-aflevering-1/

Yes I'm picky ;)
2013-01-10 19:55:35 +01:00
Fabien Potencier
357d747311 merged branch theUniC/master (PR #6684)
This PR was merged into the master branch.

Commits
-------

1edf302 Fixed some translation typos

Discussion
----------

Fixed translation typos on the Security componente

Hi,

In my last PR I've introduced some translation typos on the Security component messages for the Spanish translation.

So sorry.

Christian.
2013-01-10 19:21:27 +01:00
Fabien Potencier
e4aa64b84e merged branch pborreli/patch-5 (PR #6687)
This PR was merged into the master branch.

Commits
-------

d4bbb6b [Security] Missing trailing dot.

Discussion
----------

[Security] Missing trailing dot.
2013-01-10 19:20:57 +01:00
Fabien Potencier
711fadcd18 merged branch pborreli/patch-4 (PR #6683)
This PR was merged into the master branch.

Commits
-------

53c5d9b [Security] Missing trailing dot.

Discussion
----------

[Security] Missing trailing dot.
2013-01-10 19:20:53 +01:00
Fabien Potencier
c084d3ff5e merged branch tkinast/patch-1 (PR #6688)
This PR was merged into the master branch.

Commits
-------

77545a2 Update src/Symfony/Component/Security/Resources/translations/security.es.xlf

Discussion
----------

Update src/Symfony/Component/Security/Resources/translations/security.es...

....xlf

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

by mweimerskirch at 2013-01-10T17:43:38Z

Duplicate of #6684?
2013-01-10 19:19:59 +01:00
Fabien Potencier
5864858539 merged branch mweimerskirch/patch-10 (PR #6685)
This PR was merged into the master branch.

Commits
-------

a1ef9d8 Fixed 2 typos in French translation

Discussion
----------

Fixed 2 typos in French translation
2013-01-10 19:18:42 +01:00
Fabien Potencier
8f497de806 merged branch tobiassjosten/patch-1 (PR #6690)
This PR was merged into the master branch.

Commits
-------

65bb3d2 Added Swedish translation

Discussion
----------

Added Swedish translation
2013-01-10 19:18:28 +01:00
Tobias Sjösten
65bb3d20ae Added Swedish translation 2013-01-10 10:04:48 -08:00
tkinast
77545a2ee5 Update src/Symfony/Component/Security/Resources/translations/security.es.xlf 2013-01-10 15:37:47 -02:00
Pascal Borreli
d4bbb6b737 [Security] Missing trailing dot. 2013-01-10 17:33:44 +00:00
Michel Weimerskirch
a1ef9d86f0 Fixed 2 typos in French translation 2013-01-10 18:19:20 +01:00
Fabien Potencier
1c0e3538ef merged branch mweimerskirch/patch-9 (PR #6682)
This PR was merged into the master branch.

Commits
-------

b92973c Fixed German translations for security component

Discussion
----------

Fixed German translations for security component

authentication != authorisation
plus a few other minor things
2013-01-10 18:16:15 +01:00
Pascal Borreli
53c5d9bf66 [Security] Missing trailing dot. 2013-01-10 17:14:38 +00:00
Christian
1edf3026d7 Fixed some translation typos 2013-01-10 18:12:39 +01:00
Fabien Potencier
5c653d4d02 merged branch mweimerskirch/security_lb (PR #6681)
This PR was merged into the master branch.

Commits
-------

9471a1c Added Luxembourgish translation for security component

Discussion
----------

Added Luxembourgish translation for security component
2013-01-10 18:11:37 +01:00
Michel Weimerskirch
b92973ca35 Fixed German translations for security component
authentication != authorisation
+ a few other minor things
2013-01-10 18:09:49 +01:00
Michel Weimerskirch
9471a1ce5a Added Luxembourgish translation for security component 2013-01-10 18:06:17 +01:00
Fabien Potencier
f0a66db79a merged branch Seldaek/psr3 (PR #6628)
This PR was merged into the master branch.

Commits
-------

67d7423 Remove use of deprecated HttpKernel LoggerInterface
dca4528 [HttpKernel] Extend psr/log's NullLogger class
1e5a890 [Monolog] Mark old non-PSR3 methods as deprecated
91a86f8 [HttpKernel][Monolog] Add PSR-3 support to the LoggerInterface

Discussion
----------

[HttpKernel][MonologBridge] PSR-3 support

This enables PSR-3 support and monolog 1.3+. The first commit is the main part. The rest deals with deprecation of short-hand methods (warn/err/crit/emerg) that are fully expanded in PSR-3 (warning/error/critical/emergency).

The downside of deprecating them is that for bundles it's a bit harder to support older and newer versions. If that is too much of a hassle you can drop that for now and cherry pick the first commit.

The upside is that it forces people to move towards PSR-3 compatible stuff, which means eventually we could completely drop the LoggerInterface from the framework. In any case I think the documentation should only mention the `Psr\Log\LoggerInterface` and people should start hinting against that. The change should be done in core as well I suppose.

Anyway I wanted to throw this out there as it is to get feedback.

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

by stof at 2013-01-09T09:15:15Z

@Seldaek I also think you should change the typehint to use the PSR LoggerInterface in all classes using the logger

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

by Seldaek at 2013-01-09T09:54:55Z

OK updated according to all the feedback. I tested it in an app and it still seems to work so there shouldn't be any major issues.

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

by Seldaek at 2013-01-09T09:59:55Z

@fabpot if you merge please merge also the bundle PR, otherwise it won't be possible to update without conflict.

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

by frosas at 2013-01-10T14:59:20Z

I'm trying to understand why a `composer update` of a Symfony 2.1.* resulted in a fatal error. Shouldn't a stable version don't break like this?

As @olaurendeau points, why Symfony depends 1.* instead of 1.2.*? Or why Monolog 1.3 breaks its public interface (EDIT: I'm not sure about it)? Or why isn't this PR being merged (into branch 2.1) at the same time Monolog 1.3 is released?

Please, understand I'm not looking for who to blame, it's just I want to know if this situation is unexpected or if otherwise a `composer update` on a stable branch is not as innocent as it seems.

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

by stof at 2013-01-10T15:06:51Z

@frosas it cannot be merged into 2.1 as it is a BC break. The 2.1 branch has been updated to forbid Monolog 1.3 already

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

by Seldaek at 2013-01-10T15:11:58Z

@frosas you can blame me for releasing as 1.3.0 and not 2.0, but technically for monolog this isn't really a BC break, I just added an interface. The problem is due to the way it's used in symfony, it ended up as a fatal error. In any case the situation is now sorted out I think.

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

by frosas at 2013-01-10T15:26:43Z

@stof now I see this `>=1.0,<1.3-dev` change in the 2.1 branch. Now, shouldn't a new (2.1.7) version be released for all of us not in the dev minimum-stability?

@Seldaek then do you see feasible to rely only in X.Y.* versions to avoid this kind of errors?

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

by Seldaek at 2013-01-10T15:45:22Z

@frosas relying on X.Y.* is painful because you always need to wait until someone updates the constraint to get the new version. Of course using ~1.3 like in this PR means if I fuck up and break BC people will update to it, but that's a less likely occurrence than the alternative I think, so I would rather not use X.Y.*

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

by frosas at 2013-01-10T15:50:50Z

@Seldaek you are right about this, but I was thinking more in changing it only for the stable versions. EDIT: I mean, how often do you need a new feature in a branch you only apply fixes to?

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

by stof at 2013-01-10T15:57:32Z

@frosas Monolog and Symfony have separate release cycles. Foorcing Symfony users to use an old version of Monolog until they update to a new version of Symfony whereas the newer Monolog is compatible is a bad idea. Thus, as Monolog keeps BC, it does not maintain bugfix releases for all older versions (just like Twig does too). So it would also forbid you to get the fixes done in newer Monolog versions.

The incompatibility between Symfony 2.1 LoggerInterface and PSR-3 (whereas they expect exactly the same behavior and signature for methods with the same name) is unfortunate and is the reason why we get some issues here.

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

by frosas at 2013-01-10T16:21:06Z

@stof I appreciate you prefer to allow newer versions at the price of having to be constantly monitoring its changes to avoid breaks.

Another similar but safer strategy would be to stick to X.Y.* versions and upgrade to X.Y+1.* once the new version integration is tested, but I understand this is discutible in projects as close to Symfony as Monolog.

Returning to the issue, what do you say to release this 2.1.7 version? Or is it only me who is having issues here?

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

by stof at 2013-01-10T16:26:20Z

@frosas a minor release should not break BC when following smeantic versionning (Symfony warned about the fact it is not strictly followed for the first releases of 2.x). But as far as monolog is concerned, 1.3 is BC with 1.2.

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

by Seldaek at 2013-01-10T16:49:55Z

@frosas sorry I didn't get you still had the problem. I tagged a 2.1.7 of monologbundle which hopefully fixes your issue.
2013-01-10 17:57:14 +01:00
Fabien Potencier
8a7a120ed5 merged branch spolischook/master (PR #6679)
This PR was merged into the master branch.

Commits
-------

b74c00f [security][translation] added ukrainian message translations

Discussion
----------

Added ukrainian message translations
2013-01-10 17:47:27 +01:00
SPolischook
b74c00f9a8 [security][translation] added ukrainian message translations 2013-01-10 18:37:41 +02:00
Jakub Kucharovic
c6eb81938b Created security.cs.xlf 2013-01-10 08:19:03 -08:00
Fabien Potencier
7ab8e48373 merged branch thunderer/security-polish-translation (PR #6674)
This PR was merged into the master branch.

Commits
-------

0b75f67 Security component Polish message translations

Discussion
----------

[Security] Polish message translations

Security component messages translated from English to Polish.
2013-01-10 17:12:04 +01:00
Fabien Potencier
b6d5be3901 merged branch theUniC/master (PR #6669)
This PR was merged into the master branch.

Commits
-------

c06e627 Fixed some typos

Discussion
----------

FIxed some typos in the Spainsh translation of the Security component messages

Hi,

In order to show the most clear and less _"robotic"_ messages in Spanish, I've fixed some typos and some incorrect translations in the Spanish translation file of the Security component.

Christian.
2013-01-10 17:11:41 +01:00
Fabien Potencier
f9ccd27af5 merged branch skoop/NL-translation-fixes (PR #6672)
This PR was merged into the master branch.

Commits
-------

e84a8d0 fixed some small issues with grammar and used terminology

Discussion
----------

fixed some small issues with grammar and used terminology
2013-01-10 17:10:56 +01:00
Fabien Potencier
955400106b merged branch peterkokot/translations (PR #6673)
This PR was merged into the master branch.

Commits
-------

d5825aa slovenian translations of security component added

Discussion
----------

Slovenian translations of security component added
2013-01-10 17:10:37 +01:00
Fabien Potencier
b954a5b132 merged branch kucharovic/master (PR #6676)
This PR was merged into the master branch.

Commits
-------

d6f972b Created Slovak translation to Security

Discussion
----------

[security][tranlation] Created Slovak translation to Security
2013-01-10 17:07:49 +01:00
Jakub Kucharovic
d6f972bc1e Created Slovak translation to Security 2013-01-10 08:01:03 -08:00
Alex Demchenko
e848bc589b Add Russian translations 2013-01-10 07:53:38 -08:00
Tomasz Kowalczyk
0b75f67ae5 Security component Polish message translations 2013-01-10 16:50:43 +01:00
unknown
d5825aac2f slovenian translations of security component added 2013-01-10 16:29:45 +01:00
Stefan Koopmanschap
e84a8d0106 fixed some small issues with grammar and used terminology 2013-01-10 16:22:58 +01:00
Christian
c06e627e17 Fixed some typos 2013-01-10 15:54:27 +01:00
Fabien Potencier
d600759cc9 merged branch pborreli/typo-hu (PR #6666)
This PR was merged into the master branch.

Commits
-------

9db1515 [Security] Removed extra space

Discussion
----------

[Security] Removed extra space
2013-01-10 15:46:09 +01:00
Pascal Borreli
9db1515b31 [Security] Removed extra space 2013-01-10 14:44:10 +00:00
Fabien Potencier
03c7f59d50 merged branch iambrosi/patch-1 (PR #6663)
This PR was merged into the master branch.

Commits
-------

e908a52 Fixed spanish typos

Discussion
----------

Fixed spanish typos
2013-01-10 15:42:11 +01:00
Fabien Potencier
37aca2df6e merged branch VictorMateo/patch-1 (PR #6662)
This PR was merged into the master branch.

Commits
-------

6ae8ca8 Update src/Symfony/Component/Security/Resources/translations/security.es.xlf

Discussion
----------

Update src/Symfony/Component/Security/Resources/translations/security.es...

....xlf
2013-01-10 15:41:58 +01:00
Fabien Potencier
6f9d957b1e merged branch plebs/patch-2 (PR #6661)
This PR was merged into the master branch.

Commits
-------

9b8428d [security][tranlation]Fixed spanish translation

Discussion
----------

[security][tranlation]Fixed spanish translation
2013-01-10 15:41:50 +01:00
Fabien Potencier
cec47c80a7 merged branch inspiran/master (PR #6664)
This PR was merged into the master branch.

Commits
-------

3c4437c Added Dutch translations

Discussion
----------

	 Added Dutch translations

	 Added Dutch translations
2013-01-10 15:41:13 +01:00
Ismael Ambrosi
e908a523d3 Fixed spanish typos 2013-01-10 12:36:30 -02:00
inspiran
3c4437c975 Added Dutch translations 2013-01-10 15:34:58 +01:00
Fabien Potencier
dc109fc7a1 merged branch matteosister/security_component_italian_translations (PR #6656)
This PR was merged into the master branch.

Commits
-------

0b5177b added italian translations

Discussion
----------

added italian translations for the security component

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

by matteosister at 2013-01-10T14:22:54Z

not sure if the file should be named **security.it_IT.xlf** or **security.it.xlf**

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

by fabpot at 2013-01-10T14:25:49Z

security.it.xlf

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

by matteosister at 2013-01-10T14:31:14Z

ok, renamed the files, and squashed the pr to a single commit!
Thanks @fabpot!
2013-01-10 15:34:09 +01:00
Victor Mateo
6ae8ca8042 Update src/Symfony/Component/Security/Resources/translations/security.es.xlf 2013-01-10 15:33:04 +01:00
plebs
9b8428d44f [security][tranlation]Fixed spanish translation 2013-01-10 15:32:29 +01:00
Fabien Potencier
770271fa8c merged branch vincentaubert/master (PR #6660)
This PR was squashed before being merged into the master branch (closes #6660).

Commits
-------

45c8682 [Security][Translation]Created fr translation for Security

Discussion
----------

[Security][Translation]Created fr translation for Security

adds french translations for the security component
2013-01-10 15:29:18 +01:00
Vincent AUBERT
45c8682606 [Security][Translation]Created fr translation for Security 2013-01-10 15:29:18 +01:00
matteo giachino
0b5177b8e8 added italian translations 2013-01-10 15:28:50 +01:00
Fabien Potencier
605328d42e merged branch 1ed/patch-5 (PR #6658)
This PR was merged into the master branch.

Commits
-------

c3a6659 [Security] added Hungarian translations for exception messages

Discussion
----------

[Security] added Hungarian translations for exception messages
2013-01-10 15:26:36 +01:00
Fabien Potencier
713c284126 merged branch dmecke/patch-1 (PR #6657)
This PR was merged into the master branch.

Commits
-------

2f51961 Created de translation for Security

Discussion
----------

[Security][Translation]Created de translation for Security
2013-01-10 15:26:06 +01:00
Fabien Potencier
13640a22bd merged branch dlsniper/ro-trans (PR #6654)
This PR was merged into the master branch.

Commits
-------

e35998f Translated to Romanian

Discussion
----------

[Security] Translated to Romanian

Added Romanian version for Security messages.

Thanks!
2013-01-10 15:25:03 +01:00
Fabien Potencier
3150a065d9 merged branch AV4TAr/spanish-translation (PR #6655)
This PR was merged into the master branch.

Commits
-------

b194607 spanish translation

Discussion
----------

Security / spanish translation

Spanish Translation.
2013-01-10 15:23:48 +01:00
Gábor Egyed
c3a6659856 [Security] added Hungarian translations for exception messages 2013-01-10 06:23:20 -08:00
Daniel Mecke
2f5196161a Created de translation for Security 2013-01-10 06:19:49 -08:00
Diego Sapriza
b194607e34 spanish translation 2013-01-10 12:17:16 -02:00
Florin Patan
e35998f7fb Translated to Romanian 2013-01-10 16:16:00 +02:00
Rafael Dohms
ff5ba380c5 Created PT_BR translation for Security
Added the PT_BR strings for Security strings.
2013-01-10 06:03:36 -08:00
Fabien Potencier
3e99f4e976 merged branch asm89/issue-837 (PR #4935)
This PR was merged into the master branch.

Commits
-------

73db84f [Security] Move translations file to 'security' domain
324703a [Security] Switch to English messages as message keys
aa74769 [Security] Fix CS + unreachable code
2d7a7ba [Security] Fix `AuthenticationException` serialization
50d5724 [Security] Introduced `UsernameNotFoundException#get/setUsername`
39da27a [Security] Removed `get/setExtraInformation`, added `get/set(Token|User)`
837ae15 [Security] Add note about changed constructor to changelog
d6c57cf [FrameworkBundle] Register security exception translations
d7129b9 [Security] Fix exception constructors called in `UserChecker`
0038fbb [Security] Add initial translations for AccountStatusException childs
50e2cfc [Security] Add custom `getMessageKey` AccountStatusException childs
1147977 [Security] Fix InsufficientAuthenticationException constructor calls
79430b8 [Security] Fix AuthenticationServiceException constructor calls
42cced4 [Security] Fix AuthenticationException constructor calls
963a1d7 [Security] Add initial translations for the exceptions
ed6eed4 [Security] Add `getMessageKey` and `getMessageData` to auth exceptions
694c47c [Security] Change signature of `AuthenticationException` to match `\Exception`

Discussion
----------

[2.2][Security] AuthenticationException enhancements

Bug fix: semi
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=issue-837)](http://travis-ci.org/asm89/symfony)
Fixes the following tickets: #837
License of the code: MIT

This PR adds the functionality discussed in #837 and changes the constructor of the `AuthenticationException` to match that of `\Exception`. This PR will allow developers to show a translated (save) authentication exception message to the user. :)

*Todo:*
- Add some functional test to check that the exceptions can indeed be translated?
- Get feedback on the current English messages

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

by asm89 at 2012-07-15T14:04:11Z

ping @schmittjoh

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

by schmittjoh at 2012-07-15T14:57:32Z

Looks good to me.

While you are at the exceptions, I think we can also get rid of the "extra information" thing and replace it by explicit getters/setters. Mostly that will mean adding set/getToken, set/getUser, set/getUsername. Bundles might add custom exceptions which have other data. This will make it a bit more useful and predictable.

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

by asm89 at 2012-07-15T15:40:45Z

@schmittjoh I removed the `get/setExtraInformation` and added the more explicit getters/setters as you suggested.

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

by asm89 at 2012-07-15T19:33:15Z

@fabpot Did you reschedule this for 2.2? Why? It was originally a 2.1 ticket. I think it is an important one because at the moment there is no reliable way to show users the cause of an `AuthenticationException` without the threat of exposing sensitive information. This issue has been around for a while, see the original issue this PR refers to, or for example [this TODO comment in FOSUB](https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Controller/SecurityController.php#L37).

The PR itself is ready to merge now. My only question that remains is about whether the actual translations should be functional tested?

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

by fabpot at 2012-07-15T19:43:19Z

We need to stop at some point. If not, we never release anything. beta3 was scheduled for today and I don't plan any other one before the first RC and I won't have time to review this PR next week. So, if you, @schmittjoh, @vicb, @stof, and a few other core devs "validate" this PR, I might consider merging it before 2.1.

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

by asm89 at 2012-07-15T19:46:09Z

@fabpot I totally agree with your point of view. I just have been trying to pickup some security issues that were still open. :)

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

by stof at 2012-07-15T19:50:29Z

This looks good to me

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

by asm89 at 2012-08-12T09:06:24Z

Since the beta period is over I assume the window was missed to get this security related PR in 2.1. If I have feedback from @fabpot I'll still try to make it mergeable asap though.

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

by fabpot at 2012-08-13T10:10:32Z

@asm89 This would indeed be considered for merging in 2.2.

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

by Antek88 at 2012-10-03T10:30:46Z

+1

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

by stof at 2012-10-04T21:27:15Z

@asm89 could you rebase this PR ? It conflicts with master

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

by fabpot at 2012-10-05T17:16:44Z

What's the status of this PR? @asm89 Have you taken all the feedback into account?

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

by stof at 2012-10-13T17:48:48Z

@asm89 ping

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

by fabpot at 2012-10-29T09:48:40Z

@asm89 If you don't have time, I can finish the work on this PR, but can you just tell me what's left?

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

by asm89 at 2012-10-29T10:02:22Z

I can pick this up, but I have two outstanding questions:
- One about adding `::create()`? https://github.com/symfony/symfony/pull/4935#discussion_r1358297
- And what is the final verdict on the messages? https://github.com/symfony/symfony/pull/4935#discussion_r1165701 The initial idea was that the exception itself have an exception message which is plain english and informative for the developer. If you want to display the 'safe' user messages you have the optional dependency on the translator. There is a comparison made with the Validator component, but in my opinion that's a different case because the violations always contain the message directed at the user and have no plain english message for the developer. Apart from that the Validator component contains it's own code for replacing `{{ }}` variables in messages (duplication? not as flexible as the translator). Concluding I'd opt for: optional dependency on translator component if you want to show 'safe' user messages + message keys.

@schmittjoh Any things to add?

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

by schmittjoh at 2012-10-29T10:14:09Z

Message keys sound good to me. I wouldn't add the ``create`` method for now.

On Mon, Oct 29, 2012 at 11:02 AM, Alexander <notifications@github.com>wrote:

> I can pick this up, but I have two outstanding questions:
>
>    - One about adding ::create()? symfony/symfony#4935<https://github.com/symfony/symfony/issues/4935#discussion_r1358297>
>    - And what is the final verdict on the messages? symfony/symfony#4935<https://github.com/symfony/symfony/issues/4935#discussion_r1165701>The initial idea was that the exception itself have an exception message
>    which is plain english and informative for the developer. If you want to
>    display the 'safe' user messages you have the optional dependency on the
>    translator. There is a comparison made with the Validator component, but in
>    my opinion that's a different case because the violations always contain
>    the message directed at the user and have no plain english message for the
>    developer. Apart from that the Validator component contains it's own code
>    for replacing {{ }} variables in messages (duplication? not as
>    flexible as the translator). Concluding I'd opt for: optional dependency on
>    translator component if you want to show 'safe' user messages + message
>    keys.
>
> @schmittjoh <https://github.com/schmittjoh> Any things to add?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/4935#issuecomment-9861016>.
>
>

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

by fabpot at 2012-10-29T10:27:37Z

As I said in the discussion about the translations, I'm -1 for the message keys to be consistent with how we manage translations everywhere else in the framework.

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

by stof at 2012-10-29T10:30:50Z

@fabpot When we changed the English translation for the validation errors in 2.1, we had to tag the commit as a BC rbeak as it was changing the source for all other translations. And if you look at the state of the files now, you will see that we are *not* using the English as source anymore in some places as some validation errors have a pluralized translation but the source has not been changed.
So I think using a key is more future-proof.

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

by asm89 at 2012-10-30T19:44:49Z

Any final decision on this? On one hand I have @stof and @schmittjoh +1 on message keys, on the other @fabpot -1. I guess it's your call @fabpot.

Edit: also @vicb seemed to be +1 on message keys earlier on.

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

by drak at 2012-11-01T20:19:00Z

I am also -1, I agree with @fabpot

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

by asm89 at 2012-11-12T09:38:51Z

@fabpot Can you please give a definite answer on this? I personally think @stof and @vicb have good points to do message keys, but with all these different people +1 and -1'ing the PR I'm lost on what it should actually do.

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

by asm89 at 2012-11-14T09:59:06Z

ping @fabpot

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

by asm89 at 2012-11-26T10:01:27Z

ping @fabpot We talked about this in Berlin. Any final thoughts on the PR? :) One idea was to do message keys + opt depend on the translator component if you want to use them, or use your own implementation.

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

by fabpot at 2012-11-26T14:01:37Z

The conclusion is: keep using plain English.

On Mon, Nov 26, 2012 at 11:01 AM, Alexander <notifications@github.com>wrote:

> ping @fabpot <https://github.com/fabpot> We talked about this in Berlin.
> Any final thoughts on the PR? :) One idea was to do message keys + opt
> depend on the translator component if you want to use them, or use your own
> implementation.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/4935#issuecomment-10709997>.
>
>

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

by Inori at 2012-11-26T15:00:22Z

is this final? if not, then +1 for message keys

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

by vicb at 2012-11-27T22:33:47Z

@fabpot I can't understand why we keep discussing this for months as this implementation use *both* keys and plain Englis, ie using  keys  is optional ( if it was not it would not be an issue according to #6129)

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

by asm89 at 2013-01-02T21:43:46Z

@fabpot @vicb I'll rebase this PR, fix the comments and refactor the message keys to use plain English + {{ }} syntax for the placeholders.

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

by asm89 at 2013-01-07T15:00:58Z

@fabpot If I fix this tonight, will it make the beta?

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

by fabpot at 2013-01-07T15:53:00Z

yes, definitely.

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

by asm89 at 2013-01-07T20:13:38Z

@fabpot I switched the implementation to English messages instead of message keys and fixed the final comments + rebased. Anything you want me to do after this?

Still happy with `getMessageKey()`?
2013-01-10 14:38:06 +01:00
Jordi Boggiano
67d7423456 Remove use of deprecated HttpKernel LoggerInterface 2013-01-09 10:52:29 +01:00
Fabien Potencier
3a4869dd14 merged branch Tobion/relative-path (PR #3958)
This PR was merged into the master branch.

Commits
-------

6703fb5 added changelog entries
1997e2e fix phpdoc of UrlGeneratorInterface that missed some exceptions and improve language of exception message
f0415ed [Routing] made reference type fully BC and improved phpdoc considerably
7db07d9 [Routing] added tests for generating relative paths and network paths
75f59eb [Routing] add support for path-relative and scheme-relative URL generation

Discussion
----------

[2.2] [Routing] add support for path-relative URL generation

Tests pass: yes
Feature addition: yes
BC break: <del>tiny (see below)</del> NO
deprecations: NO

At the moment the Routing component only supports absolute and domain-relative URLs, e.g.
`http://example.org/user-slug/article-slug/comments` and
`/user-slug/article-slug/comments`.

But there are two link types missing: schema-relative URLs and path-relative URLs.
schema-relative: e.g. `//example.org/user-slug/article-slug/comments`
path-relative: e.g. `comments`.

Both of them would now be possible with this PR. I think it closes a huge gap in the Routing component.
Use cases are pretty common. Schema-relative URLs are for example used when you want to include assets (scripts, images etc) in a secured website with HTTPS. Path-relative URLs are the only option when you want to generate static files (e.g. documentation) that can be downloaded as an HTML archive. Such use-cases are currently not possible with symfony.

The calculation of the relative path based on the request path and target path is hightly unit tested. So it is really equivalent. I found several implemenations on the internet but none of them worked in all cases. Mine is pretty short and works.

I also added an optional parameter to the twig `path` function, so this feature can also be used in twig templates.

Ref: This implements path-relative URLs as suggested in #3908.

<del>[BC BREAK] The signature of UrlGeneratorInterface::generate changed to support scheme-relative and path-relative URLs. The core UrlGenerator is BC and does not break anything, but users who implemented their own UrlGenerator need to be aware of this change. See UrlGenerator::convertReferenceType.</del>

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

by jalliot at 2012-04-16T09:56:56Z

@Tobion For completeness, you should add the option to the `url` and `asset` twig functions/template helpers.

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

by stof at 2012-04-16T10:46:06Z

@jalliot adding the option to ``url`` does not make any sense. The difference between ``path`` and ``url`` is that ``path`` generates a path and ``url`` generates an absolute url (thus including the scheme and the hostname)

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

by Tobion at 2012-04-16T12:27:49Z

@stof I guess jalliot meant we could then generate scheme-relative URLs with `url`. Otherwise this would have no equivalent in twig.

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

by jalliot at 2012-04-16T12:34:08Z

@stof Yep I meant what @Tobion said :)

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

by Tobion at 2012-04-18T11:57:04Z

The $relative parameter I added besides the existing $absolute parameter of the `->generate` method was not clear enough. So I merged those into a different parameter `referenceType`. I adjusted all parts of symfony to use the new signature. And also made the default `UrlGenerator` implementation BC with the old style. So almost nobody will recognize a change. The only BC break would be for somebody who implemented his own `UrlGenerator` and did not call the parent default generator.
Using `referenceType` instead of a simple Boolean is much more flexible. It will for example allow a custom generator to support a new reference type like http://en.wikipedia.org/wiki/CURIE

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

by Tobion at 2012-04-18T13:34:58Z

ping @schmittjoh considering your https://github.com/schmittjoh/JMSI18nRoutingBundle/blob/master/Router/I18nRouter.php would need a tiny change

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

by schmittjoh at 2012-04-18T13:37:39Z

Can you elaborate the necessary change?

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

by Tobion at 2012-04-18T13:51:10Z

This PR changes the signature of `generate` to be able to generate path-relative and scheme-relative URLs. So it needs to be
`public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)` and your implementation would need to change `if ($absolute && $this->hostMap) {` to `if (self::ABSOLUTE_URL === $referenceType && $this->hostMap) {`
I can do a PR if this gets merged.

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

by schmittjoh at 2012-04-18T13:52:14Z

If I understand correctly, the old parameter still works, no?

edit: Ah, ok I see what you mean now.

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

by Tobion at 2012-04-18T13:56:33Z

Yeah the old parameter still works but $absolute would also evaluate to true (a string) in your case for non-absolute URLs, i.e. paths.

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

by Tobion at 2012-04-19T21:09:46Z

ping @fabpot

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

by fabpot at 2012-04-20T04:30:18Z

Let's discuss that feature for 2.2.

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

by Tobion at 2012-04-20T10:40:59Z

What are your objections against it? It's already implemented, it works and it adds support for things that are part of a web standard. The BC break is tiny at the moment (almost nobody is affected) because the core UrlGenerator works as before. But if we waited for 2.2 it will be much harder to make the transition because 2.1 is LTS. So I think is makes sense to add it now. Furthermore it makes it much more future-proof as custom generators can more easiliy add support for other link types like CURIE. At the moment a Boolean for absolute URLs is simply too limited and also somehow inconsistent because $absolute = false stands for an absolute path. You see the awkwardness in this naming.

Btw, I added a note in the changelog. And I will add documentation of this feature in symfony-docs once this is merged.

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

by fabpot at 2012-04-20T12:14:32Z

nobody has ever said that 2.1 would be LTS. Actually, I think we are going to wait for 2.3 for LTS.

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

by Tobion at 2012-04-20T12:27:18Z

Well what I meant is, the longer we wait with this, the harder to apply it.
In 04ac1fdba2 you modified `generate` signature for better extensibility that is not even made use of. I think changing `$abolute` param goes in the same direction and has direct use.

I'd like to know your reason to wait for 2.2. Not enough time to review it, or afraid of breaking something, or marketing for 2.2?

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

by stof at 2012-04-20T16:28:27Z

@Tobion the issue is that merging new features forces to postpone the release so that it is tested by enough devs first to be sure there is no blocking bug in it. Big changes cannot be merged when we are hunting the remaining bugs to be able to release.

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

by schmittjoh at 2012-04-20T16:42:11Z

Considering the changes that have been made to the Form component, and are still being made, I think this is in comparison to that a fairly minor change.

Maybe a clearer guideline on the release process, or the direction would help, and avoid confusion, or wrong expectations on contributors' part.

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

by Tobion at 2012-10-05T13:52:11Z

@fabpot this is ready. So if you agree with it, I would create a documentation PR.

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

by stof at 2012-10-13T16:09:47Z

@fabpot what do you think about this PR ?

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

by Crell at 2012-11-01T16:05:01Z

This feels like it's overloading the generate() method to do double duty: One, make a URl based on a route.  Two, make a  URI based on a URI snippet.  Those are two separate operations.  Why not just add a second method that does the second operation and avoid the conditionals?  (We're likely to do that in Drupal for our own generator as well.)

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

by Tobion at 2012-11-01T16:38:39Z

@crell: No, you must have misunderstood something. The generate method still only generates a URI based on a route. The returned URI reference can now also be a relative path and a network path. Thats all.

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

by Tobion at 2012-12-13T18:30:28Z

@fabpot this is ready. It is fully BC! I also improved phpdoc considerably.

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

by Tobion at 2012-12-14T20:51:38Z

@fabpot Do you want me to write documentation for it? I would also be interested to write about the new features of the routing component in general. I wanted to do that anyway and it would probably be a good fit for your "new in symfony" articles.

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

by fabpot at 2012-12-14T20:58:16Z

Im' going to review this PR in the next coming days. And to answer your second question, more documentation or better documentation is always a good thing, so go for it.

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

by Tobion at 2013-01-02T21:50:20Z

@fabpot ping. I added changelog entries.
2013-01-09 10:27:51 +01:00
Jordi Boggiano
1e5a890864 [Monolog] Mark old non-PSR3 methods as deprecated 2013-01-09 10:19:50 +01:00
Fabien Potencier
b33d5bc352 removed the .gitattributes files (closes #6605, reverts #5674) 2013-01-09 09:51:07 +01:00
Fabien Potencier
aba96c7cae Merge branch '2.1'
* 2.1:
  [Console] Fix style escaping parsing
  [Console] Make style formatter matching less greedy to avoid having to escape when not needed
  [Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
  [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class.
  [Form] Fixed EntityChoiceList when loading objects with negative integer IDs
  [TwigBundle] There is no CSS visibility of display, should be visible instead
  [Form] corrected source node for a Danish translation
  [DependencyInjection] fixed a bug where the strict flag on references were lost (closes #6607)
  [HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
  [CssSelector] added css selector with empty string
  [HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
  [DependencyInjection] refactored code to avoid logic duplication
  [Form] Deleted references in FormBuilder::getFormConfig() to improve performance
  [HttpFoundation] Update docblock for non-working method

Conflicts:
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig
2013-01-08 19:17:41 +01:00
Hugo Hamon
2155719398 [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class. 2013-01-08 15:45:08 +01:00
Alexander
73db84fd5e [Security] Move translations file to 'security' domain 2013-01-07 21:11:25 +01:00
Alexander
324703a9ff [Security] Switch to English messages as message keys 2013-01-07 21:11:24 +01:00
Alexander
aa7476967a [Security] Fix CS + unreachable code 2013-01-07 21:11:19 +01:00
Alexander
2d7a7ba139 [Security] Fix AuthenticationException serialization 2013-01-07 20:58:58 +01:00
Alexander
50d5724c23 [Security] Introduced UsernameNotFoundException#get/setUsername 2013-01-07 20:58:58 +01:00
Alexander
39da27a06d [Security] Removed get/setExtraInformation, added get/set(Token|User) 2013-01-07 20:58:58 +01:00
Alexander
837ae15102 [Security] Add note about changed constructor to changelog 2013-01-07 20:58:58 +01:00
Alexander
d7129b9a7e [Security] Fix exception constructors called in UserChecker 2013-01-07 20:58:58 +01:00
Alexander
0038fbb8b6 [Security] Add initial translations for AccountStatusException childs 2013-01-07 20:58:58 +01:00
Alexander
50e2cfc1f5 [Security] Add custom getMessageKey AccountStatusException childs 2013-01-07 20:58:58 +01:00
Alexander
1147977212 [Security] Fix InsufficientAuthenticationException constructor calls 2013-01-07 20:58:58 +01:00
Alexander
79430b8238 [Security] Fix AuthenticationServiceException constructor calls 2013-01-07 20:58:58 +01:00
Alexander
42cced4c97 [Security] Fix AuthenticationException constructor calls 2013-01-07 20:58:57 +01:00
Alexander
963a1d7b81 [Security] Add initial translations for the exceptions 2013-01-07 20:58:57 +01:00
Alexander
ed6eed4c36 [Security] Add getMessageKey and getMessageData to auth exceptions 2013-01-07 20:58:57 +01:00
Alexander
694c47ce96 [Security] Change signature of AuthenticationException to match \Exception 2013-01-07 20:58:57 +01:00
Joseph Bielawski
d570dbe545 [Security][Acl] CS fix for commit: 3c3a90b9e5 2013-01-07 10:00:39 +01:00
Ilya Biryukov
3c3a90b9e5 [Security][Acl] Reduce query size when Select ACL entries for many instances of the same Type at once 2013-01-07 09:54:34 +01:00
Fabien Potencier
47b3f8636f merged branch bschussek/exceptionfix (PR #6582)
This PR was merged into the master branch.

Commits
-------

184c8e5 Fixed @expectedException definitions to reference absolute exception paths

Discussion
----------

Added leading slashes to @expectedException definitions

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

This PR adds leading backslashes `\` to `@expectedException` declarations.

The current version is inconsistent with other class references in doc blocks, which default to *relative* class names unless class name has a leading backslash.

```php
/**
 * @param RelativeNs\Class $param1
 * @param \AbsoluteNs\Class $param2
 */

but

/**
 * @expectedException AbsoluteNs\Class
 */
```

Consequently, PHPStorm does not understand the current statements and marks them as erroneous (and correctly so IMO, even though PHPUnit's interpretation is more relaxed).
2013-01-05 19:24:35 +01:00
Bernhard Schussek
184c8e586f Fixed @expectedException definitions to reference absolute exception paths 2013-01-05 18:52:40 +01:00
Fabien Potencier
6250476eaa Merge branch '2.1'
* 2.1:
  Restrict Monolog version to be in version <1.3
  [Console] Make getTerminalWith & getTerminalHeight public
  [DependencyInjection] fixed PhpDumper optimizations when an inlined service depends on the current one indirectly
  [DependencyInjection] fixed PhpDumper when an inlined service definition has some properties
  [DependencyInjection] added some tests for PhpDumper when the container is compiled
  [DependencyInjection] fixed CS
  [Process] Do not reset stdout/stderr pipes on Interrupted system call
  [Locale] Adjust `StubIntlDateFormatter` to have new methods added in PHP 5.5
  use the right RequestMatcherInterface
  [Locale] Fix failing `StubIntlDateFormatter` tests in PHP 5.5
  [Locale] Fix failing `StubIntlDateFormatter` in PHP 5.5
  [Form] Fix failing `MonthChoiceList` in PHP 5.5
  Update .travis.yml

Conflicts:
	src/Symfony/Bridge/Monolog/composer.json
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
2013-01-05 16:33:05 +01:00
Fabien Potencier
ea09a538f2 merged branch dbu/2.1-requestmatcher-httputils (PR #6553)
This PR was merged into the 2.1 branch.

Commits
-------

d601b13 use the right RequestMatcherInterface

Discussion
----------

use the right RequestMatcherInterface

this fixes #6470 by using the right interface
2013-01-04 18:17:24 +01:00
Fabien Potencier
31ff3db517 Merge branch '2.1'
* 2.1: (24 commits)
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Form] Fixed inheritance of "error_bubbling" in RepeatedType
  [Form] Fixed DateType when used with the intl extension disabled.
  [HttpFoundation] fix return types and handling of zero in Response
  [HttpFoundation] better fix for non-parseable Expires header date
  Fixed missing plural message in portuguese validator
  Fix Expires when the header is -1
  [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
  [Console] fixed unitialized properties (closes #5935)
  [Process] Prevented test from failing when pcntl extension is not enabled.
  Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
  [Form] Fixed failing tests for DateTimeToStringTransformer.
  [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  [Form] Fixed test regression introduced in #6440
  [Tests] Fix namespaces
  Fixed php doc of GenericEvent::__construct
  HttpUtils must handle RequestMatcher too
  use preferred_choices in favor of preferred_query
  ...

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
2013-01-04 18:02:19 +01:00
Fabien Potencier
8349816dc5 Merge branch '2.0' into 2.1
* 2.0:
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Console] fixed unitialized properties (closes #5935)
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  bumped Symfony version to 2.0.21-DEV
  updated VERSION for 2.0.21
  updated CHANGELOG for 2.0.21

Conflicts:
	src/Symfony/Bundle/SwiftmailerBundle/LICENSE
	src/Symfony/Component/Filesystem/LICENSE
	src/Symfony/Component/HttpFoundation/Response.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-01-04 18:00:54 +01:00
Fabien Potencier
df5c171490 updated license year 2013-01-04 17:59:43 +01:00
Fabien Potencier
18856428b6 updated license year 2013-01-04 17:58:00 +01:00
David Buchmann
d601b1377c use the right RequestMatcherInterface 2013-01-04 15:29:54 +01:00