neotel-apply/bootstrap.php

29 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
define('IX_ENVBASE', 'SITE');
define('IX_BASE', dirname(__FILE__));
require_once(IX_BASE . '/vendor/autoload.php');
use ix\HookMachine;
use ix\Container\Container;
use ix\Controller\Controller;
use ix\Application\Application;
/* Container hooks */
HookMachine::add([Container::class, 'construct'], '\ix\Container\ContainerHooksHtmlRenderer::hookContainerHtmlRenderer');
HookMachine::add([Container::class, 'construct'], '\ix\Container\ContainerHooksSession::hookContainerSession');
HookMachine::add([Container::class, 'construct'], '\ix\Container\ContainerHooksEasyCSRF::hookContainerEasyCSRFSession');
/* CSRF error */
HookMachine::add([Controller::class, 'request', 'invalidCSRFToken'], '\ix\Controller\ControllerHookInvalidCSRFTokenErrorPage::hookControllerInvalidCSRFToken');
/* Application alerters */
HookMachine::add([\NeotelApply\IndexController::class, 'sendAlert'], '\NeotelApply\ApplicationAlerters::pushover');
HookMachine::add([\NeotelApply\IndexController::class, 'sendAlert'], '\NeotelApply\ApplicationAlerters::discord');
/* Application routes */
HookMachine::add([Application::class, 'create_app', 'routeRegister'], (function ($key, $app) {
$app->any('/', \NeotelApply\IndexController::class);
return $app;
}));