Skip to content

Commit

Permalink
Add HOOK_INSTALL_FINISH
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed May 30, 2024
1 parent 66ecc48 commit 08ac8eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions install/steps/7-finish.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use MyAAC\Cache\Cache;
use MyAAC\Models\News;
use MyAAC\Settings;

Expand All @@ -11,15 +12,21 @@
return;
}

$cache = Cache::getInstance();
if ($cache->enabled()) {
// clear plugin_hooks to have fresh hooks
$cache->delete('plugins_hooks');
}

require SYSTEM . 'init.php';
if($error) {
return;
}

if(USE_ACCOUNT_NAME || USE_ACCOUNT_NUMBER)
$account = isset($_SESSION['var_account']) ? $_SESSION['var_account'] : null;
$account = $_SESSION['var_account'] ?? null;
else
$account_id = isset($_SESSION['var_account_id']) ? $_SESSION['var_account_id'] : null;
$account_id = $_SESSION['var_account_id'] ?? null;

$password = $_SESSION['var_password'];

Expand Down Expand Up @@ -190,3 +197,5 @@
if(file_exists(CACHE . 'install.txt')) {
unlink(CACHE . 'install.txt');
}

$hooks->trigger(HOOK_INSTALL_FINISH);
1 change: 1 addition & 0 deletions system/src/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
define('HOOK_TWIG', ++$i);
define('HOOK_CACHE_CLEAR', ++$i);
define('HOOK_INSTALL_FINISH', ++$i);

const HOOK_FIRST = HOOK_STARTUP;
define('HOOK_LAST', $i);
Expand Down

0 comments on commit 08ac8eb

Please sign in to comment.