-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
add router.php for php Built-in webserver #1517
Conversation
Hello @Flyingmana, this is good idea, and it will be really helpful feature, thank you! I have suggestion, may you move that router script to separate directory and add documentation how to use it and short description of algorithm? |
Could you suggest a directory? |
I think "phpserver" should be self descriptive, also would be good to add .htaccess (like in bin directory). |
have the documentation with detailed description added to an own readme inside the new phpserver directory. Is this good so, or have you any other wishes? |
@Flyingmana, thank you! Right now we are merging your PR. Internal ticket MAGETWO-40675 |
Merge commit 'refs/pull/1517/head' of https://github.com/magento/magento2 into MAGETWO-40675-PR-1517
[TSG] Backporting for 2.1 (pr30) (2.1.10)
php has a Built-in webserver since version 5.4 https://secure.php.net/manual/en/features.commandline.webserver.php
As many applications and frameworks rely on rewrite on webserver side, the same as magento does, it offers an argument for a router script. Either the script returns
false
which means, it should try to deliver the file via the file system, or it executes the specific php scripts via include.Example:
requests to
/static/frontend/Magento/blank/en_US/mage/calendar.css
should deliver the file if it exists, or execute/static.php
if not.Without a router script, that is not possible via the php built-in server.
advantage: one step less for developers, as no working webserver is needed anymore.
Hint: the script works for me, but is maybe not perfect.
I would like to also have some comments from the community, if it matches their needs