8000 Route match doesn't work on Windows 7 · Issue #11780 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Route match doesn't work on Windows 7 #11780

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
rokerkony opened this issue Aug 27, 2014 · 5 comments
Closed

Route match doesn't work on Windows 7 #11780

rokerkony opened this issue Aug 27, 2014 · 5 comments
Labels

Comments

@rokerkony
Copy link

Hi guys,
I tried route match command for console and it doesn't work on my PC, I'm using Windows 7.

This is route debug and it's working:

$ php app/console rou:deb
[router] Current routes
 Name                     Method Scheme Host Path
 _wdt                     ANY    ANY    ANY  /_wdt/{token}
 _profiler_home           ANY    ANY    ANY  /_profiler/
 _profiler_search         ANY    ANY    ANY  /_profiler/search
 _profiler_search_bar     ANY    ANY    ANY  /_profiler/search_bar
 _profiler_purge          ANY    ANY    ANY  /_profiler/purge
 _profiler_info           ANY    ANY    ANY  /_profiler/info/{about}
 _profiler_import         ANY    ANY    ANY  /_profiler/import
 _profiler_export         ANY    ANY    ANY  /_profiler/export/{token}.txt
 _profiler_phpinfo        ANY    ANY    ANY  /_profiler/phpinfo
 _profiler_search_results ANY    ANY    ANY  /_profiler/{token}/search/results
 _profiler                ANY    ANY    ANY  /_profiler/{token}
 _profiler_router         ANY    ANY    ANY  /_profiler/{token}/router
 _profiler_exception      ANY    ANY    ANY  /_profiler/{token}/exception
 _profiler_exception_css  ANY    ANY    ANY  /_profiler/{token}/exception.css
 _configurator_home       ANY    ANY    ANY  /_configurator/
 _configurator_step       ANY    ANY    ANY  /_configurator/step/{index}
 _configurator_final      ANY    ANY    ANY  /_configurator/final
 hangman_game             GET    ANY    ANY  /{_locale}/game/
 hangman_fail             GET    ANY    ANY  /{_locale}/game/fail
 hangman_win              GET    ANY    ANY  /{_locale}/game/win
 hangman_reset            GET    ANY    ANY  /{_locale}/game/reset
 hangman_game_letter      GET    ANY    ANY  /{_locale}/game/letter/{letter}
 hangman_game_word        POST   ANY    ANY  /{_locale}/game/
 hangman_login            GET    ANY    ANY  /{_locale}/login

But route match is always returning

$ php app/console rou:mat hangman_game
None of the routes match

$ php app/console rou:mat 'hangman_game'
None of the routes match

$ php app/console rou:mat "hangman_game"
None of the routes match
@1emming
Copy link
Contributor
1emming commented Aug 27, 2014

I think you should call it the other way around, like:
app/console router:match /en/game/
for example

@rokerkony
Copy link
Author

actually i wrote it wrong sorry but still not working:

$ php app/console rou:mat en/game/
None of the routes match

$ php app/console rou:mat /en/game/
None of the routes match

$ php app/console rou:mat /en/game
None of the routes match

but the route is working:

http://localhost:8000/app_dev.php/en/game/

@Tobion
Copy link
Contributor
Tobion commented Aug 27, 2014

It's probably because you use cygwin and cygwin automatically resolves parameters that look like paths to absolute paths. I.e. what the command actually receives is: php app/console rou:mat C:/en/game/

@rokerkony
Copy link
Author

yes you're right i'm using Git Bash for all php comands and others...

if I run command in CMD i'll get the results:

Route "hangman_game" matches

[router] Route "hangman_game"
Name         hangman_game
Path         /{_locale}/game/
Host         ANY
Scheme       ANY
Method       GET
Class        Symfony\Component\Routing\Route
Defaults     _controller: SensioHangmanBundle:Game:index
Requirements
Options      compiler_class: Symfony\Component\Routing\RouteCompiler
Path-Regex   #^/(?P<_locale>[^/]++)/game/$#s

is any way how to use it in cygwin or git bash?

@stof
Copy link
Member
stof commented Aug 27, 2014

@rokerkony gitbash needs to double the first / to escape it in a way telling it it is not a path but an option starting with /

@fabpot fabpot added the 7E91 Routing label Sep 5, 2014
fabpot added a commit that referenced this issue Sep 25, 2014
…cation (Tobion)

This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] output failed matched path for clarification

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

Because cygwin resolves the path behind the scenes, it is otherwise very unclear what path is actually used for matching.

Commits
-------

8d13af7 [FrameworkBundle] output failed matched path for clarification
@fabpot fabpot closed this as completed Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0