diff options
Diffstat (limited to 'phpBB/includes/cache.php')
-rw-r--r-- | phpBB/includes/cache.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index 97b98e1227..77fc5e30f3 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -403,6 +403,38 @@ class cache extends acm return $usernames; } + + /** + * Obtain hooks... + */ + function obtain_hooks() + { + global $phpbb_root_path, $phpEx; + + if (($hook_files = $this->get('_hooks')) === false) + { + $hook_files = array(); + + // Now search in acp and mods folder for permissions_ files. + $dh = @opendir($phpbb_root_path . 'includes/hooks/'); + + if ($dh) + { + while (($file = readdir($dh)) !== false) + { + if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) + { + $hook_files[] = substr($file, 0, -(strlen($phpEx) + 1)); + } + } + closedir($dh); + } + + $this->put('_hooks', $hook_files); + } + + return $hook_files; + } } ?>
\ No newline at end of file |