8000 Update built_in.rst by programaths · Pull Request #4194 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 5 commits into from
Closed

Update built_in.rst #4194

wants to merge 5 commits into from

Conversation

programaths
Copy link

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.

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.
@cordoval
Copy link
Contributor
cordoval commented Sep 2, 2014

👎 there is a flag called --docroot=web for that, but also i use $(pwd):

--router=$(pwd)/app/config/router.php

which i think it makes more sense

@programaths
Copy link
Author

@cordoval ,
the "working dir" and "doc root" are two distinct things.

For the moment, "--router" would be relative to the "docroot".
If someone used the php cli server, they would have seen that it is not the case for it.

So, the documentation should clearly reflect that full paths must be used (that's what you do with $(pwd)) or that the path is relative to the docroot and not the working dir. (Very important to stress it for people used to the php built in server.)

@cordoval
Copy link
Contributor
cordoval commented Sep 2, 2014

correct @programaths but you are not accomplishing this in this PR, you need to further explain it.

@programaths
Copy link
Author

Ok, I edit this PR but I have to see how to make the "warning" and "info" box first.

@wouterj
Copy link
Member
wouterj commented Sep 2, 2014

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

@cordoval
Copy link
Contributor
cordoval commented Sep 2, 2014

@programaths 👍

@programaths
Copy link
Author

@wouterj , thanks. Now rewriting a bit.

Attempted to clarify
@programaths
Copy link
Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

upper case i believe?

Copy link
Contributor

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
@wouterj
Copy link
Member
wouterj commented Sep 2, 2014

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

@programaths
Copy link
Author

Is there any doc on Symfony specifcs to write the doc ? (I mean some guide on directive)

@programaths
Copy link
Author

@wouterj Thank you, reading it :-)

Learned a bit and corrected my errors.
@xabbuh
Copy link
Member
xabbuh commented Sep 2, 2014

@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.

@wouterj
Copy link
Member
wouterj commented Sep 8, 2014

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 !

@programaths
Copy link
Author

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.

fabpot added a commit to symfony/symfony that referenced this pull request Sep 8, 2014
…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
fabpot added a commit to symfony/framework-bundle that referenced this pull request Sep 8, 2014
…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
Copy link
Member
xabbuh commented Sep 8, 2014

@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.

8000

@wouterj wouterj closed this Sep 8, 2014
@programaths programaths deleted the patch-1 branch September 9, 2014 05:49
@programaths
Copy link
Author

@xabbuh I will update my applications to include your fix 👍
I will of course continue to contribute when I can.

fabpot added a commit to symfony/framework-bundle that referenced this pull request Nov 11, 2014
…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
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.

4 participants
0