1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

new hook system (do not get it confused with events or plugins please)

- introducing two new hookable functions too


git-svn-id: file:///svn/phpbb/trunk@8100 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-09-22 19:18:13 +00:00
parent e3882844ec
commit 7f65bc98ad
8 changed files with 1201 additions and 10 deletions

View File

@@ -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;
}
}
?>