Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Error out when detecting incompatible DBAL version #38543

Merged
merged 1 commit into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Illuminate/Database/MySqlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Database\Query\Processors\MySqlProcessor;
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar;
use Illuminate\Database\Schema\MySqlBuilder;
use LogicException;

class MySqlConnection extends Connection
{
Expand Down Expand Up @@ -61,6 +62,12 @@ protected function getDefaultPostProcessor()
*/
protected function getDoctrineDriver()
{
if (! class_exists(DoctrineDriver::class)) {
throw new LogicException(
'Laravel v6 is only compatible with doctrine/dbal 2, in order to use this feature you must require the package "doctrine/dbal:^2.6".'
);
}

return new DoctrineDriver;
}
}
7 changes: 7 additions & 0 deletions src/Illuminate/Database/PostgresConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Database\Query\Processors\PostgresProcessor;
use Illuminate\Database\Schema\Grammars\PostgresGrammar as SchemaGrammar;
use Illuminate\Database\Schema\PostgresBuilder;
use LogicException;

class PostgresConnection extends Connection
{
Expand Down Expand Up @@ -61,6 +62,12 @@ protected function getDefaultPostProcessor()
*/
protected function getDoctrineDriver()
{
if (! class_exists(DoctrineDriver::class)) {
throw new LogicException(
'Laravel v6 is only compatible with doctrine/dbal 2, in order to use this feature you must require the package "doctrine/dbal:^2.6".'
);
}

return new DoctrineDriver;
}
}
7 changes: 7 additions & 0 deletions src/Illuminate/Database/SQLiteConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Database\Query\Processors\SQLiteProcessor;
use Illuminate\Database\Schema\Grammars\SQLiteGrammar as SchemaGrammar;
use Illuminate\Database\Schema\SQLiteBuilder;
use LogicException;

class SQLiteConnection extends Connection
{
Expand Down Expand Up @@ -85,6 +86,12 @@ protected function getDefaultPostProcessor()
*/
protected function getDoctrineDriver()
{
if (! class_exists(DoctrineDriver::class)) {
throw new LogicException(
'Laravel v6 is only compatible with doctrine/dbal 2, in order to use this feature you must require the package "doctrine/dbal:^2.6".'
);
}

return new DoctrineDriver;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Illuminate/Database/SqlServerConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Database\Query\Processors\SqlServerProcessor;
use Illuminate\Database\Schema\Grammars\SqlServerGrammar as SchemaGrammar;
use Illuminate\Database\Schema\SqlServerBuilder;
use LogicException;
use Throwable;

class SqlServerConnection extends Connection
Expand Down Expand Up @@ -108,6 +109,12 @@ protected function getDefaultPostProcessor()
*/
protected function getDoctrineDriver()
{
if (! class_exists(DoctrineDriver::class)) {
throw new LogicException(
'Laravel v6 is only compatible with doctrine/dbal 2, in order to use this feature you must require the package "doctrine/dbal:^2.6".'
);
}

return new DoctrineDriver;
}
}