-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update built_in.rst #4194
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
Update built_in.rst #4194
Conversation
In the `\Symfony\Bundle\FrameworkBundle\Command\ServerRunCommand` the line 100 reads : $builder->setWorkingDirectory($input->getOption('docroot')); That does mean than relative paths would be interpreted from 'docroot' which is "web" in the standard distribution.
👎 there is a flag called --docroot=web for that, but also i use $(pwd):
which i think it makes more sense |
@cordoval , For the moment, "--router" would be relative to the "docroot". So, the documentation should clearly reflect that full paths must be used (that's what you do with |
correct @programaths but you are not accomplishing this in this PR, you need to further explain it. |
Ok, I edit this PR but I have to see how to make the "warning" and "info" box first. |
Well, he at least fixes the code, which is a very good thing, @cordoval... However, it would indeed be even better if you could add a small text after this code block explaining it @programaths. You can do that with normal text, or in a note directive: .. note::
The text inside the info box |
@wouterj , thanks. Now rewriting a bit. |
Attempted to clarify
I modified the path too because it was confusing. (It matched some symfony path) |
|
||
.. warning | ||
|
||
the router path is relative to the application's document root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upper case i believe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a . at the end i believe too
caution instead of warning
I would combine it into one caution block. And please note that you have to add a line break after the first word that crosses the 72th character |
Is there any doc on Symfony specifcs to write the doc ? (I mean some guide on directive) |
@wouterj Thank you, reading it :-) |
Learned a bit and corrected my errors.
@programaths Thanks for noticing and fixing this. Though, I'm not sure if we should change it here. To me, having to use the command like this is not intentional and its behaviour should be changed. |
This can still be merged into 2.3 till 2.5, but 2.6 will properbly fix this behaviour. Thank you for fixing the docs, @programaths ! |
What's funny is that achieved it with your support. Also I know that a lot of php "developers" won't dig in the sources and will do "smart code" to get around. Fixing in source or documentation seemed to be the thing to do. Other did push me a little too. I learned a bit about Sphynx. Next step : following the "contribute" guide. Thank you to all of you and beyond. Symfony is great. |
…xabbuh) This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] improve handling router script paths | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The `server:run` command switches the working directory before starting the built-in web server. Therefore, the path to a custom router script had to be specified based on the document root path and not based on the user's working directory. Another option is to update the documentation (as started in symfony/symfony-docs#4194). Though I think the current behaviour is a bug. The intended behaviour can be derived from the command's help message: > ``` If you have custom docroot directory layout, you can specify your own router script using --router option: > ./app/console server:run --router=app/config/router.php ``` As you can see, the path is specified based on the current working directory. Commits ------- 0a16cf2 improve handling router script paths
…xabbuh) This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] improve handling router script paths | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The `server:run` command switches the working directory before starting the built-in web server. Therefore, the path to a custom router script had to be specified based on the document root path and not based on the user's working directory. Another option is to update the documentation (as started in symfony/symfony-docs#4194). Though I think the current behaviour is a bug. The intended behaviour can be derived from the command's help message: > ``` If you have custom docroot directory layout, you can specify your own router script using --router option: > ./app/console server:run --router=app/config/router.php ``` As you can see, the path is specified based on the current working directory. Commits ------- 0a16cf2 improve handling router script paths
@programaths Thank you for making us aware of this issue. I didn't even notice this when writing this article. Actually, the referenced code pull request was merged into the 2.3 branch. So, this documentation update is no longer necessarry. Nonetheless, I'm really happy that you not only noticed the issue but also provided a nice fix for it. 👍 Hopefully, we'll see more contributions by you in the future. |
@xabbuh I will update my applications to include your fix 👍 |
…xabbuh) This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] improve handling router script paths | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The `server:run` command switches the working directory before starting the built-in web server. Therefore, the path to a custom router script had to be specified based on the document root path and not based on the user's working directory. Another option is to update the documentation (as started in symfony/symfony-docs#4194). Though I think the current behaviour is a bug. The intended behaviour can be derived from the command's help message: > ``` If you have custom docroot directory layout, you can specify your own router script using --router option: > ./app/console server:run --router=app/config/router.php ``` As you can see, the path is specified based on the current working directory. Commits ------- 0a16cf2 improve handling router script paths
In the
\Symfony\Bundle\FrameworkBundle\Command\ServerRunCommand
one line reads : $builder->setWorkingDirectory($input->getOption('docroot'));That does mean than relative paths would be interpreted from 'docroot' which is "web" in the standard distribution.