oatmeal/oatmeal.php

32 lines
995 B
PHP
Raw Normal View History

<?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()));
2024-07-20 00:26:16 +00:00
$oatmeal->register(new RefreshTokenRoutes($oatmeal->getCSRFP()));
$oatmeal->register(new ClientCredsRoutes);
$oatmeal->register(new PasswordRoutes);
$oatmeal->register(new DeviceCodeRoutes);