예제 #1
0
파일: index.php 프로젝트: aodkrisda/phprest
            $fi = __DIR__ . '/app/controllers/admin/' . $class;
            if (file_exists($fi)) {
                require $fi;
            }
        }
    }
}
spl_autoload_register('__autoload', true, false);
//require
require_once __DIR__ . '/app/WebConfig.php';
require_once __DIR__ . '/app/WebSession.php';
require_once __DIR__ . '/app/WebUser.php';
require_once __DIR__ . '/app/WebApp.php';
//create Web Appication
$app = new WebApp($CONFIGS);
$app->config('rewrite_r', $rewrite_r);
$app->config('view', new \Slim\Views\Twig());
$app->config('web_dir', __DIR__);
$app->notFound(function () use($app) {
    $app->render('not_found.twig');
});
$app->any('/auth/(:args+)', function ($args = null) use($app) {
    $app->default_webapp_handler($app, $args);
});
$app->any('/admin/(:args+)', array($app, 'Authenticate'), function ($args = null) use($app) {
    $app->default_webapp_handler($app, $args, 'admin');
});
$app->any('/(:args+)', function ($args = null) use($app) {
    $app->default_webapp_handler($app, $args);
});
$app->run();