Created
March 22, 2013 21:43
-
-
Save chadrien/5225006 to your computer and use it in GitHub Desktop.
Server.php for laravel 3 and the PHP built in server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
$uri = urldecode($uri); | |
$web = true; | |
$paths = require __DIR__.'/paths.php'; | |
$requested = path('public').$uri; | |
// This file allows us to emulate Apache's "mod_rewrite" functionality from the | |
// built-in PHP web server. This provides a convenient way to test a Laravel | |
// application without having installed a "real" web server software here. | |
if ($uri !== '/' and file_exists($requested)) | |
{ | |
return false; | |
} | |
define('LARAVEL_START', microtime(true)); | |
unset($web); | |
require path('sys').'laravel.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment