Skip to content

Instantly share code, notes, and snippets.

@kapv89
Created February 24, 2014 10:05
Show Gist options
  • Save kapv89/9184955 to your computer and use it in GitHub Desktop.
Save kapv89/9184955 to your computer and use it in GitHub Desktop.
<?php
use div\Std\App;
use div\Std\Http;
use div\Std\Jobs;
use Illuminate\Http\Request;
$app = new App('app', __DIR__.'/..', include 'config.php');
$req = Request::createFromGlobals();
$app->startErrorHandling()
->loadModules([
'data',
'http' => ['type' => Http::class],
'jobs' => ['type' => Jobs::class]
])
->init(function ($req) {
// set the default timezone (either from the config or UTC)
date_default_timezone_set($this->config('timezone', 'UTC'));
$res = $this['http']->handle($req);
$res->send();
$this['http']->terminate($req, $res);
})
->start([$req])
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment