/** * Initialize the hooks. * This must be called immediately after loading modSettings[] from the database * * also: sets the addons base directory. It must exist, be writeable and be a directory. * If any check fails, it falls back to the default hardcoded sub-folder ($boarddir/addons). * * @param $the_hooks string - serialized array of hooks * */ public static function setHooks(&$the_hooks) { global $boarddir; self::$hooks = @unserialize($the_hooks); if (isset($GLOBALS['addonsdir']) && !empty($GLOBALS['addonsdir']) && file_exists($GLOBALS['addonsdir']) && is_dir($GLOBALS['addonsdir'])) { self::$addonsdir = rtrim($GLOBALS['addonsdir'], '/\\ ') . '/'; } else { self::$addonsdir = rtrim($boarddir, '/\\ ') . '/addons/'; } }