From 2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen <acydburn@phpbb.com>
Date: Thu, 29 May 2008 12:25:56 +0000
Subject: ok... i hope i haven't messed too much with the code and everything
 is still working. Changes: - Ascraeus now uses constants for the phpbb root
 path and the php extension. This ensures more security for external
 applications and modifications (no more overwriting of root path and
 extension possible through insecure mods and register globals enabled) as
 well as no more globalizing needed. - A second change implemented here is an
 additional short-hand-notation for append_sid(). It is allowed to omit the
 root path and extension now (for example calling append_sid('memberlist')) -
 in this case the root path and extension get added automatically. The hook is
 called after these are added.

git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0
---
 phpBB/includes/acm/acm_apc.php | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

(limited to 'phpBB/includes/acm/acm_apc.php')

diff --git a/phpBB/includes/acm/acm_apc.php b/phpBB/includes/acm/acm_apc.php
index 15f3705d9e..e4c4b79de3 100644
--- a/phpBB/includes/acm/acm_apc.php
+++ b/phpBB/includes/acm/acm_apc.php
@@ -33,8 +33,7 @@ class acm
 	*/
 	function __construct()
 	{
-		global $phpbb_root_path;
-		$this->cache_dir = $phpbb_root_path . 'cache/';
+		$this->cache_dir = PHPBB_ROOT_PATH . 'cache/';
 	}
 
 	/**
@@ -42,8 +41,6 @@ class acm
 	*/
 	private function load()
 	{
-		global $phpEx;
-
 		// grab the global cache
 		if ($this->vars = apc_fetch('global'))
 		{
@@ -86,8 +83,6 @@ class acm
 	*/
 	public function tidy()
 	{
-		global $phpEx;
-
 		// cache has auto GC, no need to have any code here :)
 
 		set_config('cache_last_gc', time(), true);
@@ -100,8 +95,6 @@ class acm
 	{
 		if ($var_name[0] === '_')
 		{
-			global $phpEx;
-
 			return apc_fetch($var_name);
 		}
 		else
@@ -171,8 +164,6 @@ class acm
 	*/
 	public function destroy($var_name, $table = '')
 	{
-		global $phpEx;
-
 		if ($var_name === 'sql' && !empty($table))
 		{
 			if (!is_array($table))
@@ -221,8 +212,6 @@ class acm
 	*/
 	public function sql_load($query)
 	{
-		global $phpEx;
-
 		// Remove extra spaces and tabs
 		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
 		$query_id = sizeof($this->sql_rowset);
@@ -244,7 +233,7 @@ class acm
 	*/
 	public function sql_save($query, &$query_result, $ttl)
 	{
-		global $db, $phpEx;
+		global $db;
 
 		// Remove extra spaces and tabs
 		$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
-- 
cgit v1.2.1