oatmeal/oatmeal.php

30 lines
977 B
PHP

<?php
namespace Oatmeal;
use Index\Environment;
use Index\Data\DbTools;
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';
Environment::setDebug(OAT_DEBUG);
mb_internal_encoding('utf-8');
date_default_timezone_set('utc');
$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);