aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/style.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/style.php')
-rw-r--r--phpBB/style.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/phpBB/style.php b/phpBB/style.php
index 8ca1751391..9f8b77c1f5 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -45,6 +45,7 @@ if (!empty($load_extensions) && function_exists('dl'))
}
}
+// no $request here because it is not loaded yet
$id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
// This is a simple script to grab and output the requested CSS data stored in the DB
@@ -55,14 +56,24 @@ $id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
if ($id)
{
// Include files
- require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
- require($phpbb_root_path . 'includes/cache.' . $phpEx);
+ require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
+ $class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
+ $class_loader->register();
+
+ // set up caching
+ $cache_factory = new phpbb_cache_factory($acm_type);
+ $cache = $cache_factory->get_service();
+ $class_loader->set_cache($cache->get_driver());
+
+ $request = new phpbb_request();
$db = new $sql_db();
- $cache = new cache();
+
+ // make sure request_var uses this request instance
+ request_var('', 0, false, false, $request); // "dependency injection" for a function
// Connect to DB
if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
@@ -71,7 +82,10 @@ if ($id)
}
unset($dbpasswd);
- $config = $cache->obtain_config();
+ $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE);
+ set_config(null, null, null, $config);
+ set_config_count(null, null, null, $config);
+
$user = false;
// try to get a session ID from REQUEST array
@@ -298,7 +312,3 @@ if ($id)
}
$db->sql_close();
}
-
-exit;
-
-?> \ No newline at end of file