static function getInstance()
    {
        if (\array_key_exists('default', static::$connections)) {
            return static::$connections['default'];
        }

        $config = Config::getInstance();

        $params = new ConnectionParams();
        $params->id = 'default';
        $params->host = $config->host;
        $params->user = $config->user;
        $params->password = $config->password;
        $params->database = $config->database;
        $params->charset = $config->charset;
        $params->persistent = $config->persistent;

        return static::factory($params);
    }
static function getInstance()
    {
        if (\array_key_exists('default', static::$connections)) {
            return static::$connections['default'];
        }

        $config = Config::getInstance();

        $params = new ConnectionParams();
        $params->id = 'default';
        $params->host = $config->host;
        $params->user = $config->user;
        $params->password = $config->password;
        $params->database = $config->database;
        $params->charset = $config->charset;
        $params->persistent = $config->persistent;

        return static::factory($params);
    }
static function getInstance ( ) { if ( \ array_key_exists ( 'default' , static :: $ connections ) ) { return static :: $ connections [ 'default' ] ; } $ config = Config :: getInstance ( ) ; $ params = new ConnectionParams ( ) ; $ params -> id = 'default' ; $ params -> host = $ config -> host ; $ params -> user = $ config -> user ; $ params -> password = $ config -> password ; $ params -> database = $ config -> database ; $ params -> charset = $ config -> charset ; $ params -> persistent = $ config -> persistent ; return static :: factory ( $ params ) ; }
The easiest way to retrieve a database connection. Works as a singleton,
and returns a connection with the default parameters
@return \ManiaLib\Database\Connection
The easiest way to retrieve a database connection . Works as a singleton and returns a connection with the default parameters