Skip to content

Instantly share code, notes, and snippets.

@chadrien
Created March 22, 2013 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadrien/5225006 to your computer and use it in GitHub Desktop.
Save chadrien/5225006 to your computer and use it in GitHub Desktop.
Server.php for laravel 3 and the PHP built in server
<?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