Commit Graph

11884 Commits

Author SHA1 Message Date
Tobias Schultze
3d0c70e434 made ExecutionContext more consistent 2012-12-03 19:34:26 +01:00
Fabien Potencier
cc53fc25b5 merged branch Tobion/routing-loaders (PR #6165)
This PR was merged into the master branch.

Commits
-------

20dbe47 added annotation
c73cb8a add default for pattern for clarity
ddd8918 make id attribute required
62536e5 refactor to an xsd:group
451dcdc it should be possible to define the defaults, req. and options in any order, just like in YAML

Discussion
----------

improve routing xml scheme

bc break: no

Main points:
- the xml scheme only allowed defaults, requirements and options in this specific order. but the XmlFileLoader does not have the restriction and the YAML definions does not have such an restriction either. this is now fixed. so you can use
```
<requirement key="_locale">en</requirement>
<default key="_controller">Foo</default>
```
Before it had the be first all defaults, then all requirements, then all options.
- make id attribute required

For more changes see commits.
2012-12-02 15:14:10 +01:00
Fabien Potencier
150a138936 merged branch TerjeBr/persistent-token-provider (PR #6149)
This PR was merged into the master branch.

Commits
-------

373be62 Bugfix for creating cookie on loginSuccess in AbstractRememberMeServices

Discussion
----------

Bugfix for creating cookie on loginSuccess in AbstractRememberMeServices

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

By a mistake setting of new cookies did not work for other RememberMe services than PersistentTokenBasedRememberMeServices

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

by TerjeBr at 2012-12-01T17:28:08Z

Ping.  Any feedback on this?
2012-12-02 15:11:29 +01:00
Tobias Schultze
20dbe47223 added annotation 2012-12-02 01:30:09 +01:00
Tobias Schultze
c73cb8a1be add default for pattern for clarity 2012-12-01 22:22:36 +01:00
Tobias Schultze
ddd8918512 make id attribute required 2012-12-01 22:22:35 +01:00
Tobias Schultze
62536e5bec refactor to an xsd:group 2012-12-01 22:22:16 +01:00
Tobias Schultze
451dcdcb63 it should be possible to define the defaults, req. and options in any order, just like in YAML 2012-12-01 22:22:11 +01:00
Fabien Potencier
9ab4a9692f merged branch vicb/realfix (PR #6160)
This PR was merged into the master branch.

Commits
-------

bad50ac [HttpFoundation] Request::getRealMethod() now returns UPPERCASE

Discussion
----------

[HttpFoundation] Request::getRealMethod() now returns UPPERCASE
2012-12-01 07:59:56 +01:00
Victor Berchet
bad50ac501 [HttpFoundation] Request::getRealMethod() now returns UPPERCASE 2012-11-30 23:41:06 +01:00
Terje Bråten
373be626ae Bugfix for creating cookie on loginSuccess in AbstractRememberMeServices 2012-11-29 16:28:59 +01:00
Fabien Potencier
50a62da114 Merge branch '2.1'
* 2.1:
  [HttpFoundation] reverted variable rename
2012-11-29 12:32:58 +01:00
Fabien Potencier
d50f9d7431 Merge branch '2.0' into 2.1
* 2.0:
  [HttpFoundation] reverted variable rename

Conflicts:
	src/Symfony/Component/HttpFoundation/Request.php
2012-11-29 12:32:44 +01:00
Fabien Potencier
9ce892cf43 [HttpFoundation] reverted variable rename 2012-11-29 12:31:26 +01:00
Fabien Potencier
995219f39b Merge branch '2.1'
* 2.1:
  replaced magic strings by proper constants
  refactored tests for Request
  fixed the logic in Request::isSecure() (if the information comes from a source that we trust, don't check other ones)
  added a way to configure the X-Forwarded-XXX header names and a way to disable trusting them
  fixed algorithm used to determine the trusted client IP
  removed the non-standard Client-IP HTTP header

Conflicts:
	src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
2012-11-29 12:29:12 +01:00
Fabien Potencier
6c67476ef0 Merge branch '2.0' into 2.1
* 2.0:
  replaced magic strings by proper constants
  refactored tests for Request
  fixed the logic in Request::isSecure() (if the information comes from a source that we trust, don't check other ones)
  added a way to configure the X-Forwarded-XXX header names and a way to disable trusting them
  fixed algorithm used to determine the trusted client IP
  removed the non-standard Client-IP HTTP header

Conflicts:
	src/Symfony/Component/HttpFoundation/Request.php
	src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
2012-11-29 12:27:48 +01:00
Fabien Potencier
e5536f0fe1 replaced magic strings by proper constants 2012-11-29 12:23:09 +01:00
Fabien Potencier
f5d8cca25d refactored tests for Request 2012-11-29 12:23:09 +01:00
Fabien Potencier
6a3ba52858 fixed the logic in Request::isSecure() (if the information comes from a source that we trust, don't check other ones) 2012-11-29 12:23:09 +01:00
Fabien Potencier
67e12f3ecb added a way to configure the X-Forwarded-XXX header names and a way to disable trusting them 2012-11-29 12:23:09 +01:00
Fabien Potencier
b45873a3f6 fixed algorithm used to determine the trusted client IP 2012-11-29 12:23:09 +01:00
Fabien Potencier
254b11062e removed the non-standard Client-IP HTTP header 2012-11-29 12:23:09 +01:00
Fabien Potencier
18495e7b3c Merge branch '2.1'
* 2.1: (29 commits)
  [DependencyInjection] fixed composer.json
  [Validator] Fix typos in validators.ru.xlf
  Edited some minor grammar and style errors in russian validation file
  Updated Bulgarian translation
  [Form] improve error message with a "hasser" hint for PropertyAccessDeniedException
  [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6
  [Form] simplified a test from previous merge
  Update src/Symfony/Component/Form/Extension/Core/Type/FileType.php
  fixed CS
  Xliff with other node than source or target are ignored
  small fix of #5984 when the container param is not set
  Filesystem Component mirror symlinked directory fix
  [Process][Tests] fixed chainedCommandsOutput tests
  fixed CS
  Use better default ports in urlRedirectAction
  Add tests for urlRedirectAction
  info about session namespace
  fix upgrade info about locale
  Update src/Symfony/Component/DomCrawler/Tests/FormTest.php
  Update src/Symfony/Component/DomCrawler/Form.php
  ...
2012-11-29 11:32:45 +01:00
Fabien Potencier
922c2015f6 Merge branch '2.0' into 2.1
* 2.0:
  [DependencyInjection] fixed composer.json
  [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6
  fixed CS
  small fix of #5984 when the container param is not set
  fixed CS
  Use better default ports in urlRedirectAction
  Add tests for urlRedirectAction
  Update src/Symfony/Component/DomCrawler/Tests/FormTest.php
  Update src/Symfony/Component/DomCrawler/Form.php
  [Security] remove escape charters from username provided by Digest DigestAuthenticationListener
  [Security] added test extra for digest authentication
  fixed CS
  [Security] Fixed digest authentication
  [Security] Fixed digest authentication
  [SecurityBundle] Convert Http method to uppercase in the config
  Use Norm Data instead of Data

Conflicts:
	src/Symfony/Bridge/Doctrine/Form/EventListener/MergeCollectionListener.php
	src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php
	src/Symfony/Component/DependencyInjection/composer.json
2012-11-29 11:32:18 +01:00
Fabien Potencier
7fce02c818 merged branch nomack84/issue6135 (PR #6136)
This PR was merged into the master branch.

Commits
-------

c8e65a2 [FrameworkBundle][Routing] Resolve placeholders in hostnamePattern rules

Discussion
----------

[FrameworkBundle][Routing] Resolve placeholders in hostnamePattern rules

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6135
License of the code: MIT

Currently the placeholders in the `hostname_pattern` rule are not resolved, so that's why this PR is it for.

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

by nomack84 at 2012-11-28T14:18:02Z

@fabpot Could you please merge this? I really need this fix to be solve.
Thanks!
2012-11-28 17:24:04 +01:00
Fabien Potencier
aacfe74f18 merged branch fabpot/http-method-override (PR #6143)
This PR was merged into the master branch.

Commits
-------

0a380cf [HttpFoundation] disabled Request _method feature by default (should now be explicitely enabled via a call to enableHttpMethodOverride())

Discussion
----------

[HttpFoundation] disabled Request _method feature by default

It should now be explicitely enabled via a call to enableHttpMethodOverride())
2012-11-28 17:23:21 +01:00
Fabien Potencier
0a380cfdbf [HttpFoundation] disabled Request _method feature by default (should now be explicitely enabled via a call to enableHttpMethodOverride()) 2012-11-28 15:06:57 +01:00
Fabien Potencier
13b47b6591 merged branch marcw/twig-chain-loader (PR #6131)
This PR was merged into the master branch.

Commits
-------

431d593 [TwigBundle] Renames twig.loader to twig.loader.filesystem.

Discussion
----------

[TwigBundle] Renames twig.loader to twig.loader.filesystem.

In the previous form of twig's service definitions, it was impossible to
use a chain loader correctly because the TwigBundle was registering paths
on the twig.loader service. This patch fixes that by creating a
twig.loader.filesystem definition and an alias twig.loader that points
to twig.loader.filesystem by default.

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

by marcw at 2012-11-27T21:05:53Z

Failed build seems unrelated to this PR.
2012-11-28 12:33:18 +01:00
Fabien Potencier
c12c68f7f9 merged branch Tobion/route-name (PR #6133)
This PR was squashed before being merged into the master branch (closes #6133).

Commits
-------

828c95d [Routing] removed restriction of route names

Discussion
----------

[Routing] removed restriction of route names

bc break: no

The restriction is not relevant anymore. It was probably added when the PhpMatcherDumper compiled the route name to php methods, e.g. `DumpedMatcher::get...()`. But this is not the case anymore since 2.1. So the restriction is useless as my added tests show and it does not make any sense from an API point of view.

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

by stof at 2012-11-27T19:40:52Z

you should add an entry in the changelog

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

by Tobion at 2012-11-27T20:19:19Z

Done.
2012-11-28 12:31:06 +01:00
Tobias Schultze
828c95d750 [Routing] removed restriction of route names 2012-11-28 12:31:05 +01:00
Mario A. Alvarez Garcia
c8e65a28e9 [FrameworkBundle][Routing] Resolve placeholders in hostnamePattern rules 2012-11-27 17:22:45 -05:00
marc.weistroff
431d593d59 [TwigBundle] Renames twig.loader to twig.loader.filesystem.
In the previous form of twig's service definitions, it was impossible to
use a chain loader correctly because the TwigBundle was registering paths
on the twig.loader service. This patch fixes that by creating a
twig.loader.filesystem definition and an alias twig.loader that points
to twig.loader.filesystem by default.
2012-11-27 14:37:15 -05:00
Fabien Potencier
1b34ddb6b4 merged branch ragtek/master (PR #6121)
This PR was merged into the master branch.

Commits
-------

1db6f05 Update UPGRADE-2.2.md

Discussion
----------

Removed duplicate words in the "validator changes" description in file UPGRADE-2.2.md
2012-11-27 14:17:08 +01:00
Fabien Potencier
fc89d6b643 [DependencyInjection] fixed composer.json 2012-11-27 09:54:37 +01:00
ragtek
1db6f05ead Update UPGRADE-2.2.md
fixed typo
2012-11-26 19:12:13 +01:00
Fabien Potencier
ed6a345162 merged branch rybakit/validator_messages (PR #6114)
This PR was merged into the 2.1 branch.

Commits
-------

31c32c5 [Validator] Fix typos in validators.ru.xlf

Discussion
----------

[Validator] Fix typos in validators.ru.xlf

This PR fixes PR #6106 as it still [contains some issues](https://github.com/symfony/symfony/pull/6106#discussion_r2215735).  I also removed the word "файла" ([L119](31c32c551f/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf (L119))), as it is not necessary and there is no such addition in the other messages (e.g. [L167](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf#L167), [L171](https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf#L171), ...).
2012-11-26 11:27:20 +01:00
Eugene Leonovich
31c32c551f [Validator] Fix typos in validators.ru.xlf 2012-11-25 22:04:02 +01:00
Fabien Potencier
2adb781b23 merged branch andremaha/validator_russian_translation (PR #6106)
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #6106).

Commits
-------

e628c26 [Validator] Edited some minor grammar and style errors in russian validation file

Discussion
----------

[Validator] Edited some minor grammar and style errors in russian validation file

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR:
2012-11-25 12:00:36 +01:00
Andrey Esaulov
7f5c4198ba Edited some minor grammar and style errors in russian validation file 2012-11-25 12:00:35 +01:00
Fabien Potencier
96da146b9d merged branch bicpi/add_hasser_hint (PR #6110)
This PR was merged into the 2.1 branch.

Commits
-------

06ee53b [Form] improve error message with a "hasser" hint for PropertyAccessDeniedException

Discussion
----------

[Form] improve error msg w/ a "hasser" hint for PropertyAccessDeniedException

"Hasser" support was added under the 2.1 branch of the Form component

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no, but fails exactly the same as without this fix
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#1958
2012-11-25 11:54:09 +01:00
Fabien Potencier
fae3e35ef5 fixed typo 2012-11-25 11:49:19 +01:00
Fabien Potencier
3299fc64b2 merged branch bschussek/drupal-validator (PR #6105)
This PR was merged into the master branch.

Commits
-------

24c6530 [Validator] Added instructions on integrating the latest Validator changes to the UPGRADE file

Discussion
----------

[Validator] Added instructions on integrating the latest Validator changes

This is a documentation change only. See the file diff for more information.
2012-11-25 11:48:45 +01:00
Fabien Potencier
202fe0b0d9 merged branch RoumenMe/translation-2.1 (PR #6112)
This PR was merged into the 2.1 branch.

Commits
-------

7cba683 Updated Bulgarian translation

Discussion
----------

[Validator][Form] Updated Bulgarian translation

Added Bulgarian translation for form component.
Updated Bulgarian translation for validator messages.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/RoumenMe/symfony.png?branch=translation-2.1)](https://travis-ci.org/RoumenMe/symfony)
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
2012-11-25 11:48:04 +01:00
Fabien Potencier
fc7a39ccd4 merged branch bschussek/icu-check-update (PR #6107)
This PR was merged into the 2.0 branch.

Commits
-------

ac77c5b [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6

Discussion
----------

[Form] Updated checks for the ICU version from 4.5+ to 4.7+

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: -
2012-11-25 11:47:37 +01:00
Roumen Damianoff
7cba683f04 Updated Bulgarian translation
Added Bulgarian translation for form component.
Updated Bulgarian translation for validator messages.
2012-11-25 01:16:21 +02:00
Philipp Rieber
06ee53b73e [Form] improve error message with a "hasser" hint for PropertyAccessDeniedException
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no, but fails exactly the same as without this fix
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#1958
2012-11-24 15:59:58 +01:00
Bernhard Schussek
ac77c5b2d8 [Form] Updated checks for the ICU version from 4.5+ to 4.7+ due to test failures with ICU 4.6 2012-11-24 14:53:14 +01:00
Bernhard Schussek
24c653045d [Validator] Added instructions on integrating the latest Validator changes to the UPGRADE file 2012-11-24 13:30:10 +01:00
Fabien Potencier
ee90986c9f merged branch bschussek/drupal-validator (PR #6096)
This PR was merged into the master branch.

Commits
-------

1858b96 [Form] Adapted FormValidator to latest changes in the Validator
1f752e8 [DoctrineBridge] Adapted UniqueValidator to latest changes in the Validator
efe42cb [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern.

Discussion
----------

[Validator] Refactored the Validator for use in Drupal

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

Drupal wants to use the Symfony Validator component in their next version. I was talking to @fago recently about the changes that we'd need to make and implemented these changes in this PR. I don't want to rush this, but the deadline is tight, since Drupal feature freeze is on December 1st and @fago needs at least a couple of days to integrate the Validator into Drupal.

This PR introduces two significant changes:

* Interfaces were created for all classes that constitute the Validator's API. This is were the PR breaks BC, because `ConstraintValidatorInterface::initialize()` is now type hinted against `ExecutionContextInterface` instead of `ExecutionContext`.

* The graph walker was refactored into an implementation of the Visitor pattern. This way, the validator was decoupled from the structure of the metadata (class → properties and getter methods) and makes it possible to implement a different metadata structure, as is required by the Drupal Entity API.

As a consequence of the API change, custom validation code is now much easier to write, because `ValidatorInterface` and `ExecutionContextInterface` share the following set of methods:

```php
interface ValidatorInterface
{
    public function validate($value, $groups = null, $traverse = false, $deep = false);
    public function validateValue($value, $constraints, $groups = null);
    public function getMetadataFor($value);
}

interface ExecutionContextInterface
{
    public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false);
    public function validateValue($value, $constraints, $subPath = '', $groups = null);
    public function getMetadataFor($value);
}
```

No more juggling with property paths, no more fiddling with the graph walker. Just call on the execution context what you'd call on the validator and you're done.

There are two controversial things to discuss and decide (cc @fabpot):

* I moved the `@api` tags of all implementations to the respective interfaces. Is this ok?
* I would like to deprecate `ValidatorInterface::getMetadataFactory()` (tagged as `@api`) in favor of the added `ValidatorInterface::getMetadataFor()`, which offers the exact same functionality, but with a different API and better encapsulation, which makes it easier to maintain for us. We can tag `getMetadataFor()` as `@api`, as I don't expect it to change. Can we do this or should we leave the old method in?

I would like to decide the major issues of this PR until **Sunday November 25th** in order to give @fago enough room for his implementation.

Let me hear your thoughts.
2012-11-24 13:18:53 +01:00
Fabien Potencier
d5ff2388cb merged branch TerjeBr/persistent-token-provider (PR #6055)
This PR was merged into the master branch.

Commits
-------

d1b5093 Try to make sure cookies get deleted from the TokenProvider when no longer in use

Discussion
----------

Delete cookies from the TokenProvider that is no longer in use

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

When the user logs in, or login fails for some reason, the old "remember me" cookie should be deleted from the TokenProvider if you are using the PersistentTokenBasedRememberMeServices.

As the code is now, the token is only deleted on logout.

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

by TerjeBr at 2012-11-20T13:45:54Z

So, anything else that needs to be done before this is merged?

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

by TerjeBr at 2012-11-21T10:30:53Z

Ok, I have corrected the typo in the comment and squashed the commit.

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

by schmittjoh at 2012-11-21T10:36:29Z

btw, ``canceled`` (more American) and ``cancelled`` (more British) are both
correct English forms.

On Wed, Nov 21, 2012 at 11:30 AM, Terje Bråten <notifications@github.com>wrote:

> Ok, I have corrected the typo in the comment and squashed the commit.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/6055#issuecomment-10592112>.
>
>

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

by schmittjoh at 2012-11-21T10:40:24Z

As a side-note have you verified that this does not break the cookie theft protection?

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

by TerjeBr at 2012-11-21T10:51:10Z

Yes, cookie theft protection is still there and is functioning well.

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

by TerjeBr at 2012-11-21T11:14:04Z

I am using this together with the DoctrineTokenProvider in issue #6057 in my own project and done some extensive testing on it.

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

by TerjeBr at 2012-11-23T10:30:34Z

Is this ready to be merged now?
2012-11-24 13:14:48 +01:00