static function database() { if (!isset(self::$__db_instance)) { self::$__db_instance = self::single('base_db_connections'); } return self::$__db_instance; }
static function database() { if (!isset(self::$__db_instance)) { $classname = defined('DATABASE_OBJECT') ? constant('DATABASE_OBJECT') : 'base_db_connections'; $obj = new $classname(); if ($obj instanceof base_interface_db) { self::$__db_instance = $obj; } else { trigger_error(DATABASE_OBJECT . ' must implements base_interface_db!', E_USER_ERROR); exit; } } return self::$__db_instance; }