27 lines
954 B
PHP
27 lines
954 B
PHP
<?php
|
|
namespace Oatmeal;
|
|
|
|
define('OAT_STARTUP', microtime(true));
|
|
define('OAT_ROOT', __DIR__);
|
|
define('OAT_DEBUG', is_file(OAT_ROOT . '/.debug'));
|
|
define('OAT_DIR_PUBLIC', OAT_ROOT . '/public');
|
|
define('OAT_DIR_SOURCE', OAT_ROOT . '/src');
|
|
|
|
require_once OAT_ROOT . '/vendor/autoload.php';
|
|
|
|
error_reporting(OAT_DEBUG ? -1 : 0);
|
|
mb_internal_encoding('UTF-8');
|
|
date_default_timezone_set('GMT');
|
|
|
|
$oatmeal = new OatmealContext((function() {
|
|
$path = OAT_ROOT . '/.rng';
|
|
if(!is_file($path))
|
|
return 'hey you should really generate a .rng file using head -c 1K </dev/urandom >.rng or something similar!!!';
|
|
|
|
return file_get_contents($path);
|
|
})());
|
|
$oatmeal->register(new HomeRoutes);
|
|
$oatmeal->register(new AuthzCodeRoutes($oatmeal->getCSRFP()));
|
|
$oatmeal->register(new RefreshTokenRoutes($oatmeal->getCSRFP()));
|
|
$oatmeal->register(new ClientCredsRoutes($oatmeal->getCSRFP()));
|
|
$oatmeal->register(new DeviceCodeRoutes($oatmeal->getCSRFP()));
|