From a90ad2840f5a10576caf0219036ae26ed1090dcc Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 7 Dec 2011 11:39:36 +0000 Subject: - Deprecate $DB, $USER, $IMAP global variables, Use $RCMAIL instead --- program/include/rcmail.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'program/include/rcmail.php') diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 9f26450a1..59ffaea89 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -159,8 +159,6 @@ class rcmail /** * Initial startup function * to register session, create database and imap connections - * - * @todo Remove global vars $DB, $USER */ private function startup() { @@ -172,7 +170,10 @@ class rcmail } // connect to database - $GLOBALS['DB'] = $this->get_dbh(); + $this->get_dbh(); + + // set global object for backward compatibility + $GLOBALS['DB'] = $this->db; // start session $this->session_init(); @@ -240,6 +241,8 @@ class rcmail { if (is_object($user)) { $this->user = $user; + + // set global object for backward compatibility $GLOBALS['USER'] = $this->user; // overwrite config with user preferences @@ -320,8 +323,8 @@ class rcmail return $this->db; } - - + + /** * Get global handle for memcache access * -- cgit v1.2.3