mirror of
https://github.com/slawkens/myaac.git
synced 2025-07-03 10:10:14 +02:00
Load hooks before twig, add new hooks: HOOK_TWIG + HOOK_INIT
This commit is contained in:
parent
26b2c472cc
commit
5726c9fa94
@ -34,11 +34,6 @@ if(config('env') === 'dev') {
|
|||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// event system
|
|
||||||
require_once SYSTEM . 'hooks.php';
|
|
||||||
$hooks = new Hooks();
|
|
||||||
$hooks->load();
|
|
||||||
|
|
||||||
require SYSTEM . 'status.php';
|
require SYSTEM . 'status.php';
|
||||||
require SYSTEM . 'login.php';
|
require SYSTEM . 'login.php';
|
||||||
require SYSTEM . 'migrate.php';
|
require SYSTEM . 'migrate.php';
|
||||||
|
@ -193,10 +193,6 @@ define('PAGE', $page);
|
|||||||
|
|
||||||
$template_place_holders = array();
|
$template_place_holders = array();
|
||||||
|
|
||||||
// event system
|
|
||||||
require_once SYSTEM . 'hooks.php';
|
|
||||||
$hooks = new Hooks();
|
|
||||||
$hooks->load();
|
|
||||||
require_once SYSTEM . 'login.php';
|
require_once SYSTEM . 'login.php';
|
||||||
require_once SYSTEM . 'status.php';
|
require_once SYSTEM . 'status.php';
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ if(PHP_SAPI !== 'cli') {
|
|||||||
require_once __DIR__ . '/../../common.php';
|
require_once __DIR__ . '/../../common.php';
|
||||||
require_once SYSTEM . 'functions.php';
|
require_once SYSTEM . 'functions.php';
|
||||||
require_once SYSTEM . 'init.php';
|
require_once SYSTEM . 'init.php';
|
||||||
require_once SYSTEM . 'hooks.php';
|
|
||||||
|
|
||||||
if($argc !== 2) {
|
if($argc !== 2) {
|
||||||
echo 'This command expects one parameter: zip file name (plugin)' . PHP_EOL;
|
echo 'This command expects one parameter: zip file name (plugin)' . PHP_EOL;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
define('HOOK_INIT', ++$i);
|
||||||
define('HOOK_STARTUP', ++$i);
|
define('HOOK_STARTUP', ++$i);
|
||||||
define('HOOK_BEFORE_PAGE', ++$i);
|
define('HOOK_BEFORE_PAGE', ++$i);
|
||||||
define('HOOK_AFTER_PAGE', ++$i);
|
define('HOOK_AFTER_PAGE', ++$i);
|
||||||
@ -61,6 +62,7 @@ define('HOOK_ACCOUNT_MANAGE_BEFORE_ACCOUNT_LOGS', ++$i);
|
|||||||
define('HOOK_ACCOUNT_MANAGE_BEFORE_CHARACTERS', ++$i);
|
define('HOOK_ACCOUNT_MANAGE_BEFORE_CHARACTERS', ++$i);
|
||||||
define('HOOK_EMAIL_CONFIRMED', ++$i);
|
define('HOOK_EMAIL_CONFIRMED', ++$i);
|
||||||
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
|
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
|
||||||
|
define('HOOK_TWIG', ++$i);
|
||||||
define('HOOK_FIRST', HOOK_STARTUP);
|
define('HOOK_FIRST', HOOK_STARTUP);
|
||||||
define('HOOK_LAST', $i);
|
define('HOOK_LAST', $i);
|
||||||
|
|
||||||
|
@ -124,6 +124,12 @@ require_once SYSTEM . 'libs/pot/OTS.php';
|
|||||||
$ots = POT::getInstance();
|
$ots = POT::getInstance();
|
||||||
require_once SYSTEM . 'database.php';
|
require_once SYSTEM . 'database.php';
|
||||||
|
|
||||||
|
// event system
|
||||||
|
require_once SYSTEM . 'hooks.php';
|
||||||
|
$hooks = new Hooks();
|
||||||
|
$hooks->load();
|
||||||
|
$hooks->trigger(HOOK_INIT);
|
||||||
|
|
||||||
// twig
|
// twig
|
||||||
require_once SYSTEM . 'twig.php';
|
require_once SYSTEM . 'twig.php';
|
||||||
|
|
||||||
|
@ -83,3 +83,5 @@ $filter = new TwigFilter('urlencode', function ($s) {
|
|||||||
|
|
||||||
$twig->addFilter($filter);
|
$twig->addFilter($filter);
|
||||||
unset($function, $filter);
|
unset($function, $filter);
|
||||||
|
|
||||||
|
$hooks->trigger(HOOK_TWIG, ['twig' => $twig, 'twig_loader' => $twig_loader]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user