当前位置: 首页>>代码示例>>PHP>>正文


PHP cache::obtain_config方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:skyview059,项目名称:e-learning-website,代码行数:49,代码来源:helper.php

示例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);
        }
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:31,代码来源:gym_style.php


注:本文中的cache::obtain_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。