| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Doctrine\DBAL\Driver;
|
|
|
4 |
|
|
|
5 |
use Doctrine\DBAL\Connection;
|
|
|
6 |
use Doctrine\DBAL\Driver;
|
|
|
7 |
use Doctrine\DBAL\Driver\API\ExceptionConverter;
|
|
|
8 |
use Doctrine\DBAL\Driver\API\SQLite;
|
|
|
9 |
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
|
|
10 |
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
|
|
11 |
use Doctrine\DBAL\Schema\SqliteSchemaManager;
|
|
|
12 |
use Doctrine\Deprecations\Deprecation;
|
|
|
13 |
|
|
|
14 |
use function assert;
|
|
|
15 |
|
|
|
16 |
/**
|
|
|
17 |
* Abstract base implementation of the {@see Doctrine\DBAL\Driver} interface for SQLite based drivers.
|
|
|
18 |
*/
|
|
|
19 |
abstract class AbstractSQLiteDriver implements Driver
|
|
|
20 |
{
|
|
|
21 |
/**
|
|
|
22 |
* {@inheritdoc}
|
|
|
23 |
*/
|
|
|
24 |
public function getDatabasePlatform()
|
|
|
25 |
{
|
|
|
26 |
return new SqlitePlatform();
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
/**
|
|
|
30 |
* {@inheritdoc}
|
|
|
31 |
*
|
|
|
32 |
* @deprecated Use {@link SqlitePlatform::createSchemaManager()} instead.
|
|
|
33 |
*/
|
|
|
34 |
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
|
|
35 |
{
|
|
|
36 |
Deprecation::triggerIfCalledFromOutside(
|
|
|
37 |
'doctrine/dbal',
|
|
|
38 |
'https://github.com/doctrine/dbal/pull/5458',
|
|
|
39 |
'AbstractSQLiteDriver::getSchemaManager() is deprecated.'
|
|
|
40 |
. ' Use SqlitePlatform::createSchemaManager() instead.',
|
|
|
41 |
);
|
|
|
42 |
|
|
|
43 |
assert($platform instanceof SqlitePlatform);
|
|
|
44 |
|
|
|
45 |
return new SqliteSchemaManager($conn, $platform);
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
public function getExceptionConverter(): ExceptionConverter
|
|
|
49 |
{
|
|
|
50 |
return new SQLite\ExceptionConverter();
|
|
|
51 |
}
|
|
|
52 |
}
|