oatmeal/oatmeal.php

28 lines
954 B
PHP
Raw Normal View History

<?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';
2024-09-03 16:14:03 +00:00
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()));
2024-07-20 00:26:16 +00:00
$oatmeal->register(new RefreshTokenRoutes($oatmeal->getCSRFP()));
2024-07-20 01:44:36 +00:00
$oatmeal->register(new ClientCredsRoutes($oatmeal->getCSRFP()));
2024-07-20 18:48:31 +00:00
$oatmeal->register(new DeviceCodeRoutes($oatmeal->getCSRFP()));