8000 Routing options by fabpot · Pull Request #6738 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Routing options #6738

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

Merged
merged 9 commits into from
Jan 15, 2013
Merged

Routing options #6738

merged 9 commits into from
Jan 15, 2013

Conversation

fabpot
Copy link
Member
@fabpot fabpot commented Jan 14, 2013
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #5989, #5990, #6049
License MIT

In #5989, it has unanimously been decided to renamed hostname_pattern to hostname and pattern to path. That makes a lot of sense and I would like to do the renaming now as hostname_pattern is new in Symfony 2.2, so I'd like to avoid breaking BC just after the release. As we are modifying the route options, I've also included changes introduced by @Tobion in #6049 which were discussed in #5990.

As everything is BC, I think it's wise to include that in 2.2. What do you think?

public function setPattern($pattern)
{
$this->pattern = $pattern;
$this->path = $pattenr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Tobion
Copy link
Contributor
Tobion commented Jan 14, 2013

I agree it should be done in 2.2. Thanks for working on it.

@@ -100,10 +100,10 @@ private function compilePattern(Route $route, $pattern, $isHostname)
$isSeparator = '' !== $precedingChar && false !== strpos(static::SEPARATORS, $precedingChar);

if (is_numeric($varName)) {
throw new \DomainException(sprintf('Variable name "%s" cannot be numeric in route pattern "%s". Please use a different name.', $varName, $pattern));
throw new \DomainException(sprintf('Variable name "%s" cannot be numeric in route path "%s". Please use a different name.', $varName, $pattern));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path still wrong (multiple occurences also below)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, sorry, fixed now.

@vicb
Copy link
Contributor
vicb commented Jan 14, 2013

@fabpot "Everything is BC" until it breaks BC in 3.0, that's why I'd like to see deprecations in PR summary what do you think ?

@vicb
Copy link
Contributor
vicb commented Jan 14, 2013

it would also be great to update the CHANGELOG with deprecations (it could also help people answering your question)

@fabpot
Copy link
Member Author
fabpot commented Jan 15, 2013

@vicb: I've just updated the CHANGELOG and created the UPGRADE file for 3.0.

@vicb
Copy link
Contributor
vicb commented Jan 15, 2013

@fabpot thanks.

@@ -115,12 +142,38 @@ public function getPattern()
* @param string $pattern The pattern
*
* @return Route The current Route instance
*
* @deprecated Deprecated in 2.3, to be removed in 3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should say it's deprecated in 2.2 since we want to merge it there. Also please mention to use setPath instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

fabpot added a commit that referenced this pull request Jan 15, 2013
This PR was merged into the master branch.

Commits
-------

9fc7def added the UPGRADE file for Symfony 3.0
e84cad2 [Routing] updated CHANGELOG
65eca8a [Routing] added new schemes and methods options to the annotation loader
5082994 [Routing] renamed pattern to path
b357caf [Routing] renamed hostname pattern to just hostname
e803f46 made schemes and methods available in XmlFileLoader
d374e70 made schemes and methods available in YamlFileLoader
2834e7e added scheme and method setter in RouteCollection
10183de make scheme and method requirements first-class citizen in Route

Discussion
----------

Routing options

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #5989, #5990, #6049
| License       | MIT

In #5989, it has unanimously been decided to renamed `hostname_pattern` to `hostname` and `pattern` to `path`. That makes a lot of sense and I would like to do the renaming now as `hostname_pattern` is new in Symfony 2.2, so I'd like to avoid breaking BC just after the release. As we are modifying the route options, I've also included changes introduced by @Tobion in #6049 which were discussed in #5990.

As everything is BC, I think it's wise to include that in 2.2. What do you think?

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

by Tobion at 2013-01-14T18:25:53Z

I agree it should be done in 2.2. Thanks for working on it.

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

by vicb at 2013-01-14T23:11:12Z

@fabpot "Everything is BC" until it breaks BC in 3.0, that's why I'd like to see [deprecations in PR summary](symfony/symfony-docs#2116) what do you think ?

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

by vicb at 2013-01-14T23:16:40Z

it would also be great to update the CHANGELOG with deprecations (it could also help people answering your question)

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

by fabpot at 2013-01-15T07:07:03Z

@vicb: I've just updated the CHANGELOG and created the UPGRADE file for 3.0.

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

by vicb at 2013-01-15T07:15:32Z

@fabpot thanks.
@fabpot fabpot merged commit 9fc7def into symfony:master Jan 15, 2013
@wouterj
Copy link
Member
wouterj commented Jan 21, 2013

We should also change the arguments of RouteCollection::addCollection() as well as the pattern configuration option in the SecurityBundle.

schemes: https
requirements: { 'id': '\d+' }

<route id="article_edit" pattern="/article/{id}" methods="POST PUT" schemes="https">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be path here as it is the after example right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0