Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5976452
AbstractPostgreSQLDriver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
AbstractPostgreSQLDriver.php
View Options
<?php
namespace
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Driver\API\ExceptionConverter
;
use
Doctrine\DBAL\Driver\API\PostgreSQL
;
use
Doctrine\DBAL\Exception
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Platforms\PostgreSQL100Platform
;
use
Doctrine\DBAL\Platforms\PostgreSQL94Platform
;
use
Doctrine\DBAL\Platforms\PostgreSQLPlatform
;
use
Doctrine\DBAL\Schema\PostgreSQLSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\Deprecations\Deprecation
;
use
function
assert
;
use
function
preg_match
;
use
function
version_compare
;
/**
* Abstract base implementation of the {@see Driver} interface for PostgreSQL based drivers.
*/
abstract
class
AbstractPostgreSQLDriver
implements
VersionAwarePlatformDriver
{
/**
* {@inheritDoc}
*/
public
function
createDatabasePlatformForVersion
(
$version
)
{
if
(
preg_match
(
'/^(?P<major>
\d
+)(?:
\.
(?P<minor>
\d
+)(?:
\.
(?P<patch>
\d
+))?)?/'
,
$version
,
$versionParts
)
===
0
)
{
throw
Exception
::
invalidPlatformVersionSpecified
(
$version
,
'<major_version>.<minor_version>.<patch_version>'
,
);
}
$majorVersion
=
$versionParts
[
'major'
];
$minorVersion
=
$versionParts
[
'minor'
]
??
0
;
$patchVersion
=
$versionParts
[
'patch'
]
??
0
;
$version
=
$majorVersion
.
'.'
.
$minorVersion
.
'.'
.
$patchVersion
;
if
(
version_compare
(
$version
,
'10.0'
,
'>='
))
{
return
new
PostgreSQL100Platform
();
}
Deprecation
::
trigger
(
'doctrine/dbal'
,
'https://github.com/doctrine/dbal/pull/5060'
,
'PostgreSQL 9 support is deprecated and will be removed in DBAL 4.'
.
' Consider upgrading to Postgres 10 or later.'
,
);
return
new
PostgreSQL94Platform
();
}
/**
* {@inheritDoc}
*/
public
function
getDatabasePlatform
()
{
return
new
PostgreSQL94Platform
();
}
/**
* {@inheritDoc}
*
* @deprecated Use {@link PostgreSQLPlatform::createSchemaManager()} instead.
*/
public
function
getSchemaManager
(
Connection
$conn
,
AbstractPlatform
$platform
)
{
Deprecation
::
triggerIfCalledFromOutside
(
'doctrine/dbal'
,
'https://github.com/doctrine/dbal/pull/5458'
,
'AbstractPostgreSQLDriver::getSchemaManager() is deprecated.'
.
' Use PostgreSQLPlatform::createSchemaManager() instead.'
,
);
assert
(
$platform
instanceof
PostgreSQLPlatform
);
return
new
PostgreSQLSchemaManager
(
$conn
,
$platform
);
}
public
function
getExceptionConverter
():
ExceptionConverter
{
return
new
PostgreSQL\ExceptionConverter
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 19:09 (2 d, 19 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
18/bc/ebdbdbd4f69401bd440ecc0d7fac
Default Alt Text
AbstractPostgreSQLDriver.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment