From 82c7598861db175617694891bb9f21b426426225 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 18 Sep 2011 19:37:54 +0200 Subject: Remove global vars and use the OC static version. Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY --- 3rdparty/MDB2.php | 5 ++--- 3rdparty/MDB2/Driver/Manager/sqlite.php | 5 ++--- 3rdparty/MDB2/Driver/sqlite.php | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to '3rdparty') diff --git a/3rdparty/MDB2.php b/3rdparty/MDB2.php index fbc7107914e..aa7ec6ba093 100644 --- a/3rdparty/MDB2.php +++ b/3rdparty/MDB2.php @@ -969,11 +969,10 @@ class MDB2 static function fileExists($file) { // safe_mode does notwork with is_readable() - global $SERVERROOT; if (!@ini_get('safe_mode')) { $dirs = explode(PATH_SEPARATOR, ini_get('include_path')); - array_unshift($dirs,$SERVERROOT); - array_unshift($dirs,$SERVERROOT. DIRECTORY_SEPARATOR .'inc'); + array_unshift($dirs,OC::$SERVERROOT); + array_unshift($dirs,OC::$SERVERROOT. DIRECTORY_SEPARATOR .'inc'); // print_r($dirs);die(); foreach ($dirs as $dir) { if (is_readable($dir . DIRECTORY_SEPARATOR . $file)) { diff --git a/3rdparty/MDB2/Driver/Manager/sqlite.php b/3rdparty/MDB2/Driver/Manager/sqlite.php index 64019669645..650910174e7 100644 --- a/3rdparty/MDB2/Driver/Manager/sqlite.php +++ b/3rdparty/MDB2/Driver/Manager/sqlite.php @@ -71,8 +71,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function createDatabase($name, $options = array()) { - global $SERVERROOT; - $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" ); + $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ); $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; @@ -1362,4 +1361,4 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common // }}} } -?> \ No newline at end of file +?> diff --git a/3rdparty/MDB2/Driver/sqlite.php b/3rdparty/MDB2/Driver/sqlite.php index 63db241b863..5d2ad27d016 100644 --- a/3rdparty/MDB2/Driver/sqlite.php +++ b/3rdparty/MDB2/Driver/sqlite.php @@ -347,8 +347,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common **/ function connect() { - global $SERVERROOT; - $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" ); + $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ); $database_file = $this->_getDatabaseFile($this->database_name); if (is_resource($this->connection)) { //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0 @@ -1086,4 +1085,4 @@ class MDB2_Statement_sqlite extends MDB2_Statement_Common } -?> \ No newline at end of file +?> -- cgit v1.2.3