Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php namespace System\Database;
- final class DBManager
- {
- private static $connection = null;
- public static function dumpit()
- {
- $result = var_dump(self::GetConnection());
- return $result;
- }
- /**
- * Returns a specifies initialized database handler for a connection.
- *
- * @param string $ConnectionKey; Could be 'environment'or 'central'.
- * @param string $Instance; User 'master' or 'slave' for each instance.
- * @return \ADOConnection; Return the database connection object.
- */
- public static function GetConnection($ConnectionKey = null, $Instance = null)
- {
- $Server = DB_SERVER;
- if( self::$connection === null)
- {
- $DBUser = DB_USER;
- $DBPass = DB_PASS;
- self::$connection = new Database($Server, $DBUser, $DBPass, DB_NAME, DB_PLATFORM);
- }
- return self::$connection;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement