src/Arvici/Heart/Database/Database.php
public static function driver($name = 'default', $driverName = null)
    {
        if ($name !== null && $driverName === null) {
            $databaseConfig = self::getConnectionConfiguration($name);
            $driverName = $databaseConfig['driver'];
        }

        // Make the driver if we don't have it already this run.
        if (! isset(self::$drivers[$driverName])) {
            // We will make the driver class first, prepare the full class name.
            $driverClass = new \ReflectionClass("\\Arvici\\Heart\\Database\\Driver\\$driverName\\Driver");

            self::$drivers[$driverName] = $driverClass->newInstance();
        }

        return self::$drivers[$driverName];
    }
public static function driver($name = 'default', $driverName = null)
    {
        if ($name !== null && $driverName === null) {
            $databaseConfig = self::getConnectionConfiguration($name);
            $driverName = $databaseConfig['driver'];
        }

        // Make the driver if we don't have it already this run.
        if (! isset(self::$drivers[$driverName])) {
            // We will make the driver class first, prepare the full class name.
            $driverClass = new \ReflectionClass("\\Arvici\\Heart\\Database\\Driver\\$driverName\\Driver");

            self::$drivers[$driverName] = $driverClass->newInstance();
        }

        return self::$drivers[$driverName];
    }
public static function driver ( $ name = 'default' , $ driverName = null ) { if ( $ name !== null && $ driverName === null ) { $ databaseConfig = self :: getConnectionConfiguration ( $ name ) ; $ driverName = $ databaseConfig [ 'driver' ] ; } // Make the driver if we don't have it already this run. if ( ! isset ( self :: $ drivers [ $ driverName ] ) ) { // We will make the driver class first, prepare the full class name. $ driverClass = new \ ReflectionClass ( "\\Arvici\\Heart\\Database\\Driver\\$driverName\\Driver" ) ; self :: $ drivers [ $ driverName ] = $ driverClass -> newInstance ( ) ; } return self :: $ drivers [ $ driverName ] ; }
Get driver instance for connection name or driver name.

@param string $name Connection name.
@param string $driverName Driver name.

@return Driver
Get driver instance for connection name or driver name .