public static function connection($name, $definition = null)
	{
		if (empty($definition))
			return static::get(static::$pool, $name);

		if (static::isScalar($definition))
			list(, $dsn, $username, $password, $options) = func_get_args() + [null, '', '', '', []];
		else
			extract(static::pick($definition, ['dsn', 'username', 'password', 'options']));

		return static::$pool[$name] = new \PDO($dsn, $username, $password, $options);
	}
public static function connection($name, $definition = null)
	{
		if (empty($definition))
			return static::get(static::$pool, $name);

		if (static::isScalar($definition))
			list(, $dsn, $username, $password, $options) = func_get_args() + [null, '', '', '', []];
		else
			extract(static::pick($definition, ['dsn', 'username', 'password', 'options']));

		return static::$pool[$name] = new \PDO($dsn, $username, $password, $options);
	}
public static function connection ( $ name , $ definition = null ) { if ( empty ( $ definition ) ) return static :: get ( static :: $ pool , $ name ) ; if ( static :: isScalar ( $ definition ) ) list ( , $ dsn , $ username , $ password , $ options ) = func_get_args ( ) + [ null , '' , '' , '' , [ ] ] ; else extract ( static :: pick ( $ definition , [ 'dsn' , 'username' , 'password' , 'options' ] ) ) ; return static :: $ pool [ $ name ] = new \ PDO ( $ dsn , $ username , $ password , $ options ) ; }
Get an existing database connection or initialize a new one. Database connections are managed as PDO instances.
If such instance doesn't exists or could not be initialized, will return NULL.

@category Database Functions

@param string $name the connection name
@param array,scalar $definition multiple, the equivalent of PDO::__construct arguments

@return PDO
Get an existing database connection or initialize a new one . Database connections are managed as PDO instances . If such instance doesn t exists or could not be initialized will return NULL .