src/RawPHP/RawApplication/Application.php
protected function initDatabase( array $config )
    {
        if ( isset( $config[ 'db' ] ) )
        {
            if ( isset( $config[ 'db' ][ 'class' ] ) )
            {
                $this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
                {
                    $class = $config[ 'db' ][ 'class' ];

                    return new $class( $config[ 'db' ] );
                }
                );
            }
            else
            {
                $this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
                {
                    return new Database( $config[ 'db' ] );
                }
                );
            }
        }

        $this->alias( 'RawPHP\RawDatabase\Contract\IDatabase', 'db' );
    }
protected function initDatabase( array $config )
    {
        if ( isset( $config[ 'db' ] ) )
        {
            if ( isset( $config[ 'db' ][ 'class' ] ) )
            {
                $this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
                {
                    $class = $config[ 'db' ][ 'class' ];

                    return new $class( $config[ 'db' ] );
                }
                );
            }
            else
            {
                $this->bindShared( 'RawPHP\RawDatabase\Contract\IDatabase', function () use ( $config )
                {
                    return new Database( $config[ 'db' ] );
                }
                );
            }
        }

        $this->alias( 'RawPHP\RawDatabase\Contract\IDatabase', 'db' );
    }
protected function initDatabase ( array $ config ) { if ( isset ( $ config [ 'db' ] ) ) { if ( isset ( $ config [ 'db' ] [ 'class' ] ) ) { $ this -> bindShared ( 'RawPHP\RawDatabase\Contract\IDatabase' , function ( ) use ( $ config ) { $ class = $ config [ 'db' ] [ 'class' ] ; return new $ class ( $ config [ 'db' ] ) ; } ) ; } else { $ this -> bindShared ( 'RawPHP\RawDatabase\Contract\IDatabase' , function ( ) use ( $ config ) { return new Database ( $ config [ 'db' ] ) ; } ) ; } } $ this -> alias ( 'RawPHP\RawDatabase\Contract\IDatabase' , 'db' ) ; }
Initialise the database.

@param array $config
Initialise the database .