本文整理汇总了PHP中cache::obtain_hooks方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::obtain_hooks方法的具体用法?PHP cache::obtain_hooks怎么用?PHP cache::obtain_hooks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache
的用法示例。
在下文中一共展示了cache::obtain_hooks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
function loadPHPBB3($path)
{
global $phpbb_root_path, $phpEx;
global $db, $user, $auth, $template, $cache, $config, $phpbb_hook, $sql_db;
if (!defined('IN_PHPBB')) {
define('IN_PHPBB', true);
}
if (!defined('STRIP')) {
define('STRIP', get_magic_quotes_gpc() ? true : false);
}
if (!defined('JPATH_FORUM')) {
define('JPATH_FORUM', $path);
}
// Create the JConfig object
require_once JPATH_FORUM . DS . 'configuration.php';
$config = new JConfigForum();
$phpbb_root_path = JPATH_ROOT . DS . $config->phpbb_path . DS;
$phpEx = substr(strrchr(__FILE__, '.'), 1);
//Load configuration
require $phpbb_root_path . 'config.php';
// Include files
require_once $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.php';
require_once $phpbb_root_path . 'includes/cache.php';
require_once $phpbb_root_path . 'includes/template.php';
require_once $phpbb_root_path . 'includes/session.php';
require_once $phpbb_root_path . 'includes/auth.php';
require_once $phpbb_root_path . 'includes/functions.php';
require_once $phpbb_root_path . 'includes/constants.php';
require_once $phpbb_root_path . 'includes/db/' . $dbms . '.php';
require_once JPATH_FORUM . DS . 'includes' . DS . 'utf8.php';
// Instantiate some basic classes
$user = new user();
$auth = new auth();
$template = new template();
$cache = new cache();
$db = new $sql_db();
// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
// We do not need this any longer, unset for safety purposes
unset($dbpasswd);
// Grab global variables, re-cache if necessary
$config = $cache->obtain_config();
// Add own hook handler
require_once $phpbb_root_path . 'includes/hooks/index.' . $phpEx;
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
foreach ($cache->obtain_hooks() as $hook) {
@(include $phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
}
示例2: user
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
$user = new user();
$auth = new auth();
$cache = new cache();
$template = new template();
// Add own hook handler, if present. :o
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
{
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
foreach ($cache->obtain_hooks() as $hook)
{
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
}
else
{
$phpbb_hook = false;
}
// Set some standard variables we want to force
$config = array(
'load_tplcompile' => '1'
);
$template->set_custom_template('../adm/style', 'admin');