本文整理汇总了PHP中Hooks::run_hooks方法的典型用法代码示例。如果您正苦于以下问题:PHP Hooks::run_hooks方法的具体用法?PHP Hooks::run_hooks怎么用?PHP Hooks::run_hooks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hooks
的用法示例。
在下文中一共展示了Hooks::run_hooks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTMLPurifier
}
//Database password no longer needed, unset variable
unset($config_password);
//HTML Purifier Config
$purifier_config = HTMLPurifier_Config::createDefault();
$purifier_config->set('HTML.Allowed', 'b,a[href],i,br,em,strong,ul,li');
$purifier_config->set('URI.Base', $_SERVER['DOCUMENT_ROOT']);
$purifier_config->set('URI.MakeAbsolute', true);
$purifier_config->set('URI.DisableExternal', true);
$purifier = new HTMLPurifier($purifier_config);
//Smarty
$tpl = new Smarty();
$tpl->template_dir = CUR_DIR . '/smarty/templates/';
$tpl->compile_dir = CUR_DIR . '/smarty/templates_c/';
$tpl->config_dir = CUR_DIR . '/smarty/configs/';
$tpl->cache_dir = CUR_DIR . '/smarty/cache/';
//Initialize $player
$player = 0;
//Create a hooks object
$hooks = new Hooks($db, $tpl, $player);
//Include all hook files
$hook_files = scandir(HOOKS_DIR);
foreach ($hook_files as $hook_file) {
$path_parts = pathinfo(HOOKS_DIR . '/' . $hook_file);
if ($path_parts['extension'] == 'php' && $path_parts['basename'] != 'index.php') {
include_once HOOKS_DIR . '/' . $hook_file;
}
}
//Run login hooks on player variable
$player = $hooks->run_hooks('player', 0);