diff options
| author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-01-11 22:56:49 +0000 |
|---|---|---|
| committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-01-11 22:56:49 +0000 |
| commit | 85b196b5fe828c127d321527bd625a1727bad4aa (patch) | |
| tree | 1557472b0431f05a4ae6b9e0fb42219d501ddefc /phpBB/common.php | |
| parent | d7e485e5f6fd5f52e8bda854c3ad67c5b53337ae (diff) | |
| download | forums-85b196b5fe828c127d321527bd625a1727bad4aa.tar forums-85b196b5fe828c127d321527bd625a1727bad4aa.tar.gz forums-85b196b5fe828c127d321527bd625a1727bad4aa.tar.bz2 forums-85b196b5fe828c127d321527bd625a1727bad4aa.tar.xz forums-85b196b5fe828c127d321527bd625a1727bad4aa.zip | |
Implementation of an experimental cache manager.
git-svn-id: file:///svn/phpbb/trunk@3312 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/common.php')
| -rw-r--r-- | phpBB/common.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 62d0ce3af1..6c4da7da4a 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -37,7 +37,7 @@ if ( !get_magic_quotes_gpc() ) } require($phpbb_root_path . 'config.'.$phpEx); -require($phpbb_root_path . 'config_cache.'.$phpEx); +//require($phpbb_root_path . 'config_cache.'.$phpEx); if ( !defined('PHPBB_INSTALLED') ) { @@ -46,6 +46,7 @@ if ( !defined('PHPBB_INSTALLED') ) } // Include files +require($phpbb_root_path . 'includes/acm/cache_' . $acm_type . '.'.$phpEx); require($phpbb_root_path . 'includes/template.'.$phpEx); require($phpbb_root_path . 'includes/session.'.$phpEx); require($phpbb_root_path . 'includes/functions.'.$phpEx); @@ -148,10 +149,14 @@ define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); // Set PHP error handler to ours set_error_handler('msg_handler'); +// Experimental cache manager +$cache = new acm(); + // Need these here so instantiate them now $template = new Template(); $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); +/* // Obtain boardwide default config (rebuilding cache if reqd) if ( empty($config) ) { @@ -176,6 +181,29 @@ if ( empty($acl_options) ) $auth_admin = new auth_admin(); $acl_options = $auth_admin->acl_cache_options(); } +*/ + +if (!$config = $cache->load('config')) +{ + $config = array(); + + $sql = 'SELECT * FROM ' . CONFIG_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $config[$row['config_name']] = $row['config_value']; + } + + $cache->save('config', $config); +} + +/* +if (time() - $config['cache_interval'] >= $config['cache_last_gc']) +{ + $cache->tidy($config['cache_gc']); +} +*/ // Instantiate some basic classes $user = new user(); |
