Created
November 9, 2011 11:08
-
-
Save igorw/1351142 to your computer and use it in GitHub Desktop.
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
/path/to/php-5.4.0beta2/sapi/cli/php -S localhost:8080 -t web -d 'error_log=error.log' -d 'log_errors=1' web/index_dev.php |
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 | |
// src/app.php | |
require_once __DIR__.'/../vendor/silex.phar'; | |
$app = new Silex\Application(); | |
$app['debug'] = true; | |
$app->get('/', function () { | |
return "Hello World!"; | |
}); | |
$app->get('/foo', function () { | |
return "Bar!"; | |
}); | |
return $app; |
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 | |
// web/index.php | |
$app = require __DIR__.'/../src/app.php'; | |
$app->run(); |
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 | |
// web/index_dev.php | |
if ('/favicon.ico' === $_SERVER['REQUEST_URI']) { | |
header('HTTP/1.0 204 No Content'); | |
exit; | |
} | |
if (is_file(__DIR__.$_SERVER['REQUEST_URI']) && !in_array($_SERVER['REQUEST_URI'], array('/', '/index.php'))) { | |
return false; | |
} else { | |
require __DIR__.'/index.php'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment