本文整理汇总了PHP中cache::obtain_config方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::obtain_config方法的具体用法?PHP cache::obtain_config怎么用?PHP cache::obtain_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache
的用法示例。
在下文中一共展示了cache::obtain_config方法的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: cache
if (empty($acm_type) || empty($dbms)) {
exit;
}
require $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx;
require $phpbb_root_path . 'includes/cache.' . $phpEx;
require $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
require $phpbb_root_path . 'includes/constants.' . $phpEx;
require_once $phpbb_root_path . 'gym_sitemaps/includes/gym_common.' . $phpEx;
$db = new $sql_db();
$cache = new cache();
// Connect to DB
if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false)) {
exit;
}
unset($dbhost, $dbuser, $dbpasswd, $dbname, $dbport);
$config = $cache->obtain_config();
$gym_config = array();
obtain_gym_config($action, $gym_config);
// Do we load phpbb css ?
$load_phpbb_css = isset($gym_config[$action . '_load_phpbb_css']) ? $gym_config[$action . '_load_phpbb_css'] : $load_phpbb_css;
// Check if requested style does exists
if ($theme_id > 0) {
$sql = 'SELECT s.style_id, c.theme_path, c.theme_name, t.template_path
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c
WHERE s.style_id = ' . $theme_id . '
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id';
$result = $db->sql_query($sql, 300);
$theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}