oatmeal/oatmeal.php

31 lines
973 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->register(new ClientCredsRoutes);
$oatmeal->register(new PasswordRoutes);
$oatmeal->register(new DeviceCodeRoutes);