Last active
January 25, 2016 04:11
-
-
Save kurozumi/c3c499f853675aa21be8 to your computer and use it in GitHub Desktop.
【Silex】Silexをコマンドラインから実行する方法
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 | |
require_once 'vendor/autoload.php'; | |
use Symfony\Component\HttpFoundation\Request; | |
$app = new Silex\Application(); | |
$app->get('/', function(Request $request){ | |
// do something | |
}); | |
if(count($argv) < 3) | |
return; | |
list($file, $method, $path) = $argv; | |
$request = Request::create($path, $method); | |
$app->handle($request); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment