note 114492 added to features.commandline.webserver
| From: | tobi at saibotd dot com | Date: | Wed, 26 Feb 2014 17:34:07 +0000 |
| Subject: | note 114492 added to features.commandline.webserver | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198734@lists.php.net to get a copy of this message | ||
A more complete example of a router file:
<?php
// router.php
$route = parse_url(substr($_SERVER["REQUEST_URI"], 1))["path"];
if (is_file($route)) {
if(substr($route, -4) == ".php"){
require $route; // Include requested script files
exit;
}
return false; // Serve file as is
} else { // Fallback to index.php
$_GET["q"] = $route; // Try to emulate the behaviour of your htaccess here, if
needed
require "index.php";
}
This should give you a basic development enviroment.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/features.commandline.webserver.php
Edit -- https://master.php.net/note/edit/114492
Del: integrated -- https://master.php.net/note/delete/114492/integrated
Del: useless -- https://master.php.net/note/delete/114492/useless
Del: bad code -- https://master.php.net/note/delete/114492/bad+code
Del: spam -- https://master.php.net/note/delete/114492/spam
Del: non-english -- https://master.php.net/note/delete/114492/non-english
Del: in docs -- https://master.php.net/note/delete/114492/in+docs
Del: other reasons-- https://master.php.net/note/delete/114492
Reject -- https://master.php.net/note/reject/114492
Search -- https://master.php.net/manage/user-notes.php