diff options
author | Paul Arthur <flowerysong00@yahoo.com> | 2012-11-08 14:28:27 -0500 |
---|---|---|
committer | Paul Arthur <flowerysong00@yahoo.com> | 2012-11-08 14:31:53 -0500 |
commit | 649298b24109c72ce664c744f4c7895d93bf987d (patch) | |
tree | bdf1d0891df5c706f0ca7037d2ca53ce60432adf /lib/class/dba.class.php | |
parent | c51ddbd3d64e92209bf4fc214bf80d8cc33cc2af (diff) | |
download | ampache-649298b24109c72ce664c744f4c7895d93bf987d.tar.gz ampache-649298b24109c72ce664c744f4c7895d93bf987d.tar.bz2 ampache-649298b24109c72ce664c744f4c7895d93bf987d.zip |
Clean up remaining direct calls to mysql functions
This makes it theoretically possible to replace Dba with a different
implementation somewhat painlessly.
Diffstat (limited to 'lib/class/dba.class.php')
-rw-r--r-- | lib/class/dba.class.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php index bec7cc00..2127a6aa 100644 --- a/lib/class/dba.class.php +++ b/lib/class/dba.class.php @@ -48,7 +48,6 @@ class Dba { public static $stats = array('query'=>0); - private static $_default_db; private static $_sql; private static $config; @@ -295,6 +294,13 @@ class Dba { } // check_database + public static function check_database_exists() { + $dbh = self::_connect(); + $select = mysql_select_db(Config::get('database_name'), $dbh); + mysql_close($dbh); + return $select; + } + /** * check_database_inserted * checks to make sure that you have inserted the database @@ -318,6 +324,9 @@ class Dba { } // check_database_inserted + public static function get_client_info() { + return mysql_get_client_info(); + } /** * show_profile @@ -343,7 +352,9 @@ class Dba { */ public static function dbh($database='') { - if (!$database) { $database = self::$_default_db; } + if (!$database) { + $database = Config::get('database_name'); + } // Assign the Handle name that we are going to store $handle = 'dbh_' . $database; @@ -367,7 +378,9 @@ class Dba { */ public static function disconnect($database='') { - if (!$database) { $database = self::$_default_db; } + if (!$database) { + $database = Config::get('database_name'); + } $handle = 'dbh_' . $database; @@ -404,19 +417,6 @@ class Dba { } // error /** - * auto_init - * This is the auto init function it sets up the config class - * and also sets the default database - */ - public static function _auto_init() { - - self::$_default_db = Config::get('database_name'); - - return true; - - } // auto_init - - /** * translate_to_mysqlcharset * This translates the specified charset to a mysqlcharset, stupid ass mysql * demands that it's charset list is different! |