Commaaa2
This commit is contained in:
31
vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php
vendored
Normal file → Executable file
31
vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php
vendored
Normal file → Executable file
@@ -3,13 +3,28 @@
|
||||
namespace Illuminate\Database;
|
||||
|
||||
use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrineDriver;
|
||||
use Doctrine\DBAL\Version;
|
||||
use Illuminate\Database\PDO\MySqlDriver;
|
||||
use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar;
|
||||
use Illuminate\Database\Query\Processors\MySqlProcessor;
|
||||
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar;
|
||||
use Illuminate\Database\Schema\MySqlBuilder;
|
||||
use Illuminate\Database\Schema\MySqlSchemaState;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use PDO;
|
||||
|
||||
class MySqlConnection extends Connection
|
||||
{
|
||||
/**
|
||||
* Determine if the connected database is a MariaDB database.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isMaria()
|
||||
{
|
||||
return strpos($this->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB') !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default query grammar instance.
|
||||
*
|
||||
@@ -44,6 +59,18 @@ class MySqlConnection extends Connection
|
||||
return $this->withTablePrefix(new SchemaGrammar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the schema state for the connection.
|
||||
*
|
||||
* @param \Illuminate\Filesystem\Filesystem|null $files
|
||||
* @param callable|null $processFactory
|
||||
* @return \Illuminate\Database\Schema\MySqlSchemaState
|
||||
*/
|
||||
public function getSchemaState(Filesystem $files = null, callable $processFactory = null)
|
||||
{
|
||||
return new MySqlSchemaState($this, $files, $processFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default post processor instance.
|
||||
*
|
||||
@@ -57,10 +84,10 @@ class MySqlConnection extends Connection
|
||||
/**
|
||||
* Get the Doctrine DBAL driver.
|
||||
*
|
||||
* @return \Doctrine\DBAL\Driver\PDOMySql\Driver
|
||||
* @return \Doctrine\DBAL\Driver\PDOMySql\Driver|\Illuminate\Database\PDO\MySqlDriver
|
||||
*/
|
||||
protected function getDoctrineDriver()
|
||||
{
|
||||
return new DoctrineDriver;
|
||||
return class_exists(Version::class) ? new DoctrineDriver : new MySqlDriver;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user