static public function connect(Application $app,
                                   $dsn,
                                  $username,
                                  $password,
                                  $options = [])
    {
        $options += [
            \PDO::ATTR_ERRMODE =>\PDO::ERRMODE_EXCEPTION,
            \PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES'utf8';",
            \PDO::MYSQL_ATTR_FOUND_ROWS => true
        ];

        $connection = new \PDO($dsn, $username, $password, $options);
        return new DB($app, $connection);
    }
static public function connect(Application $app,
                                   $dsn,
                                  $username,
                                  $password,
                                  $options = [])
    {
        $options += [
            \PDO::ATTR_ERRMODE =>\PDO::ERRMODE_EXCEPTION,
            \PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES'utf8';",
            \PDO::MYSQL_ATTR_FOUND_ROWS => true
        ];

        $connection = new \PDO($dsn, $username, $password, $options);
        return new DB($app, $connection);
    }
static public function connect ( Application $ app , $ dsn , $ username , $ password , $ options = [ ] ) { $ options += [ \ PDO :: ATTR_ERRMODE => \ PDO :: ERRMODE_EXCEPTION , \ PDO :: MYSQL_ATTR_INIT_COMMAND => "SET NAMES'utf8';" , \ PDO :: MYSQL_ATTR_FOUND_ROWS => true ] ; $ connection = new \ PDO ( $ dsn , $ username , $ password , $ options ) ; return new DB ( $ app , $ connection ) ; }
DB constructor.
@param Application $app
@param string $dsn @see \PDO
@param string $username @see \PDO
@param string $password @see \PDO
@param array $options @see \PDO
DB constructor .