-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrun.php
More file actions
41 lines (30 loc) · 892 Bytes
/
run.php
File metadata and controls
41 lines (30 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
chdir(__DIR__);
if ($_SERVER['REQUEST_URI'] === '/ping') {
echo 'PHP_OK';
exit(0);
}
define('PRODUCTION', true);
require_once('debug.php');
ini_set('date.timezone', 'UTC');
$loader = require 'vendor/autoload.php';
$loader->add('', 'app/');
$app = new \Admin\App(array(
'view' => (new \Admin\DoView()),
));
$app->view()->setApp($app);
//$app->add(new \Slim\Middleware\HttpBasicAuthentication([
// "users" => [
// "root" => "root",
// ]
//]));
// Define auth resource
$app->container->singleton('auth', function () {
return new \User\Auth();
});
$app->map('/(:module(/)(:controller(/)(:action(/))(:id)))', [$app, 'doRoute'])
->via(\Slim\Http\Request::METHOD_GET, \Slim\Http\Request::METHOD_HEAD, \Slim\Http\Request::METHOD_POST);
$app->notFound(function () use ($app) {
echo $app->request->getResourceUri() . ' not found';
});
$app->run();