Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] Changed Route vars to protected #18701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1,329 commits into from

Conversation

ragboyjr
Copy link
Contributor

@ragboyjr ragboyjr commented May 3, 2016

Q A
Branch? 2.8
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR N/A

Updated all of the route variables to be protected in order to allow useful extension of Route class. This is related to silexphp/Silex#149. We'd need this merged in before we can properly extend and update the Route class.

Also, I'm not 100% sure 2.8 is the best branch for this, but I know silex (recently) uses a min version of 2.8 for Symfony

Signed-off-by: RJ Garcia [email protected]

nicolas-grekas and others added 30 commits March 23, 2016 14:47
…_DEPRECATIONS_HELPER (nicolas-grekas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Bridge\PhpUnit] Add "disabled" mode to SYMFONY_DEPRECATIONS_HELPER

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#18222
| License       | MIT
| Doc PR        | -

See https://github.com/symfony/symfony/pull/18232/files?w=1

Because we keep adding features to the bridge, so that one could want some features but not the deprecations helper.
In weak mode, this PR also disables colors.
Fetching the SYMFONY_DEPRECATIONS_HELPER env var is also done lazily to workaround old phpunit versions affected by sebastianbergmann/phpunit#1216

Commits
-------

64fe539 [Bridge\PhpUnit] Add "disabled" mode to SYMFONY_DEPRECATIONS_HELPER
… anonymous in ContextListener (WouterJ)

This PR was squashed before being merged into the 3.1-dev branch (closes symfony#18211).

Discussion
----------

[Security] Use auth trust resolver to determine anonymous in ContextListener

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | not done yet

There is a nice class in Symfony that is used to check whether a token is anonymously: `AuthenticationTrustResolver`. However, its logic was still hard coded in the `ContextListener`, making it impossible to customize it (e.g. using another anonymous token class). I think it makes lots of sense to use the dedicated class.

Commits
-------

ab5578e [Security] Use auth trust resolver to determine anonymous in ContextListener
* 2.8:
  [ci] Tweak scripts
* 3.0:
  [ci] Tweak scripts

Conflicts:
	appveyor.yml
This PR was merged into the 3.1-dev branch.

Discussion
----------

use class constants instead of FQCN strings

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#18211 (comment)
| License       | MIT
| Doc PR        |

Commits
-------

d4ec7dd use class constants instead of FQCN strings
…RedisAdapter::doSave) (masterklavi)

This PR was squashed before being merged into the 3.1-dev branch (closes symfony#18248).

Discussion
----------

Fast multiple setEx with the pipeline transcation (RedisAdapter::doSave)

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

e132763 Fast multiple setEx with the pipeline transcation (RedisAdapter::doSave)
* 2.8:
  move test methods to test case class
Add missing public method stubs to `TestController` (all methods in the
base `Controller` class from the FrameworkBundle are `protected` since
Symfony 3.0).
This PR was merged into the 3.0 branch.

Discussion
----------

fix controller tests

| Q             | A
| ------------- | ---
| Branch?       | 3.0
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | items 9 to 12 from sebastianbergmann/phpunit-mock-objects#299 (comment)
| License       | MIT
| Doc PR        |

Add missing public method stubs to `TestController` (all methods in the base `Controller` class from the FrameworkBundle are `protected` since Symfony 3.0).

Commits
-------

fb963d2 fix controller tests
* 3.0:
  fix controller tests
  move test methods to test case class
This PR was merged into the 3.0 branch.

Discussion
----------

[3.0] fix mocking of some methods

| Q             | A
| ------------- | ---
| Branch?       | 3.0
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | items 1 and 2 of sebastianbergmann/phpunit-mock-objects#299 (comment)
| License       | MIT
| Doc PR        |

Commits
-------

07308e9 [3.0] fix mocking of some methods
…(HeahDude)

This PR was merged into the 3.0 branch.

Discussion
----------

[Form] Remove unused legacy code in `ChoiceType`

| Q             | A
| ------------- | ---
| Branch?       | 3.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | -

Commits
-------

8af78e9 [Form] Remove unused legacy code in `ChoiceType`
…Dude)

This PR was merged into the 3.0 branch.

Discussion
----------

[Form] Fix `FormBuilderInterface` docblocks

| Q             | A
| ------------- | ---
| Branch?       | 3.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#18301
| License       | MIT
| Doc PR        | -

Commits
-------

67458d8 [Form] Fix `FormBuilderInterface` docblocks
…er Bex)

This PR was merged into the 3.1-dev branch.

Discussion
----------

Make Request::isFromTrustedProxy() public.

| Q             | A
| ------------- | ---
| Branch        | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

When adding custom headers to your proxy (in our particular case, a `X-Base-Url` header, but it could be anything), it is necessary to be able to tell whether the request came from a trusted proxy or not. Unfortunately, currently the `isFromTrustedProxy()` method is private, which means you'll need to subclass `Request` and add your own *differently named* method just to be able to access this information.

This functionality is pretty straightforward, and I don't see a reason to keep this method private so this a trivial pull request to make it public (and it adds a comment so it'll show up in the API docs with proper documentation).

Commits
-------

286f64f Make Request::isFromTrustedProxy() public.
…ace autowirable (dunglas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle][TwigBundle] Make EngineInterface autowirable

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

26ed582 [FrameworkBundle][TwigBundle] Make EngineInterface autowirable
…ts name is the class name (dunglas)

This PR was squashed before being merged into the 3.1-dev branch (closes symfony#18289).

Discussion
----------

[FrameworkBundle] Return the invokable service if its name is the class name

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

 if a service is invokable and has the same name than its class name, the controller resolver of FrameworkBundle doesn't retrieve the service and tries to construct a new instance of the class instead.

This is a very rare edge case, but this fix is useful for dunglas/DunglasActionBundle#36: referencing auto-registered controllers following the ADR style in YAML and XML routing files will be more intuitive.

Currently: `defaults:  { _controller: 'Your\Action\FQN:__invoke' }`, after this fix: `defaults:  { _controller: 'Your\Action\FQN' }`.

This PR also fix a currently useless test.

Commits
-------

70b9309 [FrameworkBundle] Return the invokable service if its name is the class name
…(xabbuh)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Guard] fix minimum required Seucirty Http version

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#17714
| License       | MIT
| Doc PR        |

Otherwise, the `TargetPathTrait` is not available.

Commits
-------

952bf01 [Guard] fix minimum required Seucirty Http version
* 2.8:
  improved comment
  [FileSystem] Add support for Google App Engine.
  [2.8] fix mocks
  [Form] Fix BC break introduced in symfony#14403
nicolas-grekas and others added 12 commits May 1, 2016 11:31
…(nicolas-grekas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Add DSN based Redis connection factory

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Required by symfony#18667

Commits
-------

3073efb [Cache] Add DSN based Redis connection factory
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Cleanups

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

9a56498 [Cache] Cleanups
…hnchen)

This PR was merged into the 3.1-dev branch.

Discussion
----------

add @event annotation for AuthenticationEvents

| Q             | A
| ------------- | ---
| Branch       | 2.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#18684
| License       | MIT

split of symfony#18684 for targeting 2.3 branch

Commits
-------

e2c1270 add @event annotation for AuthenticationEvents
* 2.8:
  add @event annotation for AuthenticationEvents
  bumped Symfony version to 2.8.6
  [PropertyInfo] PHPDoc correction
  add @event annotation for KernelEvents
  updated VERSION for 2.8.5
  updated CHANGELOG for 2.8.5
  bumped Symfony version to 2.7.13
  updated VERSION for 2.7.12
  update CONTRIBUTORS for 2.7.12
  updated CHANGELOG for 2.7.12
  bumped Symfony version to 2.3.41
  updated VERSION for 2.3.40
  update CONTRIBUTORS for 2.3.40
  updated CHANGELOG for 2.3.40
  Revert "minor symfony#18257 [Routing] Don't needlessly execute strtr's as they are fairly expensive (arjenm)"
  Revert "fixed CS"
  fixed deprecation notices in tests
  [Security] Normalize "symfony/security-acl" dependency versions across all composer.json files
  [FrameworkBundle] Remove misleading comment
  bug symfony#17460 [DI] fix ambiguous services schema
* 3.0: (24 commits)
  add @event annotation for AuthenticationEvents
  bumped Symfony version to 3.0.6
  updated VERSION for 3.0.5
  updated CHANGELOG for 3.0.5
  bumped Symfony version to 2.8.6
  [PropertyInfo] PHPDoc correction
  add @event annotation for KernelEvents
  Fixed typo
  updated VERSION for 2.8.5
  updated CHANGELOG for 2.8.5
  bumped Symfony version to 2.7.13
  updated VERSION for 2.7.12
  update CONTRIBUTORS for 2.7.12
  updated CHANGELOG for 2.7.12
  bumped Symfony version to 2.3.41
  updated VERSION for 2.3.40
  update CONTRIBUTORS for 2.3.40
  updated CHANGELOG for 2.3.40
  Revert "minor symfony#18257 [Routing] Don't needlessly execute strtr's as they are fairly expensive (arjenm)"
  Revert "fixed CS"
  ...
@GuilhemN
Copy link
Contributor

GuilhemN commented May 3, 2016

Features are merged in master.

@ragboyjr
Copy link
Contributor Author

ragboyjr commented May 3, 2016

@Ener-Getick Well, I'm not even sure it's a feature. I just put yes because I didn't want to say no for all of them.

@GuilhemN
Copy link
Contributor

GuilhemN commented May 3, 2016

And I think it would be better to add an optional parameter $trim to setPath instead as changing the visibility of this properties means a lot of BC to support then.
I think this is a feature ;-)

@ragboyjr
Copy link
Contributor Author

ragboyjr commented May 3, 2016

Interesting about the BC support, I didn't consider that. Could you explain why making them protected affects the BC?

Ok, I can change to master, however, if this merge isn't on 2.8, then it wouldn't work to well for silex. My goal for this PR is to fix this issue in silex. So if we could come up with a way to do that, that'd be great.

@GromNaN
Copy link
Member

GromNaN commented May 3, 2016

@Ener-Getick There is no BC break at changing from private to protected.
But this change looks like monkey patching, it is a broken solution for the issue. It opens a hole for hacking into the Route class.

@stof
Copy link
Member

stof commented May 3, 2016

@Ener-Getick There is no BC break at changing from private to protected.

but it then forces us to maintain BC on any protected property, which is a much bigger maintenance task (BC on protected stuff is the harder stuff btw).

So for sure, this will not be accepted in 2.8 or 3.0. And it cannot be accepted in master without a valid use case for which the core team thinks that inheritance is the right way to handle it (hint: most of the time, it is not the case)

@GuilhemN
Copy link
Contributor

GuilhemN commented May 3, 2016

@GromNaN I didn't mean a BC break, I meant we won't be able to remove this parameters or change their name for example.
Anyway, I don't think that's the solution for the initial issue.

@stof
Copy link
Member

stof commented May 3, 2016

to be clear, I'm putting a 👎 vote on this PR in its current state

@ragboyjr
Copy link
Contributor Author

ragboyjr commented May 3, 2016

Ah, ok @Ener-Getick I understand what you are saying. Adding a parameter would be a better solution. However, that would be a feature, but I guess that feature could be merged in 2.8 right?

@GuilhemN
Copy link
Contributor

GuilhemN commented May 3, 2016

@ragboyjr old branches only accept bug fixes

@ragboyjr
Copy link
Contributor Author

ragboyjr commented May 3, 2016

True True, it'd have to be a patch for it to be in 2.8...

Added a trim flag to Route::setPath in order to allow paths
to be set as is without any trimming to sanitize the input

Signed-off-by: RJ Garcia <[email protected]>
@ragboyjr ragboyjr force-pushed the route-protected-vars branch from b698647 to 3848120 Compare May 3, 2016 16:08
@ragboyjr
Copy link
Contributor Author

ragboyjr commented May 3, 2016

Let me close this and try again.

@ragboyjr ragboyjr closed this May 3, 2016
@ragboyjr ragboyjr deleted the route-protected-vars branch May 3, 2016 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.