Storm\Drivers\Platforms\PDO\Connection::Connect PHP Метод

Connect() публичный статический Метод

public static Connect ( $DSN, $Username = null, $Password = null, array $DriverOptions = null, $EmulatePreparedStatements = self::DefaultEmulatePrepares ) : Connection
$DriverOptions array
Результат Connection
    public static function Connect($DSN, $Username = null, $Password = null, array $DriverOptions = null, $EmulatePreparedStatements = self::DefaultEmulatePrepares)
    {
        return new self(new \PDO($DSN, $Username, $Password, $DriverOptions), $EmulatePreparedStatements);
    }

Usage Example

Пример #1
0
 private static function GetConnection()
 {
     $PDOConnection = Platforms\PDO\Connection::Connect('mysql:host=localhost;dbname=StormTest', 'root', 'admin');
     return new Logging\Connection(self::DevelopmentMode > 0 ? new Logging\DumpLogger() : new Logging\NullLogger(), $PDOConnection);
 }