updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -101,6 +101,7 @@ final class ExceptionConverter implements ExceptionConverterInterface
return new ConnectionException($exception, $query);
case 2006:
case 4031:
return new ConnectionLost($exception, $query);
case 1048:
@@ -87,7 +87,7 @@ abstract class AbstractDB2Driver implements VersionAwarePlatformDriver
'/^(?:[^\s]+\s)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
$versionString,
$versionParts,
) === 0
) !== 1
) {
throw DBALException::invalidPlatformVersionSpecified(
$versionString,
@@ -8,12 +8,14 @@ use Doctrine\DBAL\Driver\API\MySQL;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MariaDb1010Platform;
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
use Doctrine\DBAL\Platforms\MariaDb1043Platform;
use Doctrine\DBAL\Platforms\MariaDb1052Platform;
use Doctrine\DBAL\Platforms\MariaDb1060Platform;
use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQL84Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\MySQLSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver;
@@ -40,6 +42,10 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
if ($mariadb) {
$mariaDbVersion = $this->getMariaDbMysqlVersionNumber($version);
if (version_compare($mariaDbVersion, '10.10.0', '>=')) {
return new MariaDb1010Platform();
}
if (version_compare($mariaDbVersion, '10.6.0', '>=')) {
return new MariaDb1060Platform();
}
@@ -64,6 +70,20 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
}
} else {
$oracleMysqlVersion = $this->getOracleMysqlVersionNumber($version);
if (version_compare($oracleMysqlVersion, '8.4.0', '>=')) {
if (! version_compare($version, '8.4.0', '>=')) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/dbal/pull/5779',
'Version detection logic for MySQL will change in DBAL 4. '
. 'Please specify the version as the server reports it, e.g. "8.4.0" instead of "8.4".',
);
}
return new MySQL84Platform();
}
if (version_compare($oracleMysqlVersion, '8', '>=')) {
if (! version_compare($version, '8.0.0', '>=')) {
Deprecation::trigger(
@@ -116,7 +136,7 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/',
$versionString,
$versionParts,
) === 0
) !== 1
) {
throw Exception::invalidPlatformVersionSpecified(
$versionString,
@@ -130,6 +150,8 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
if ($majorVersion === '5' && $minorVersion === '7') {
$patchVersion ??= '9';
} else {
$patchVersion ??= '0';
}
return $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
@@ -160,7 +182,7 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
'/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
$versionString,
$versionParts,
) === 0
) !== 1
) {
throw Exception::invalidPlatformVersionSpecified(
$versionString,
@@ -8,6 +8,7 @@ use Doctrine\DBAL\Driver\API\PostgreSQL;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSQL120Platform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager;
@@ -28,7 +29,7 @@ abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
*/
public function createDatabasePlatformForVersion($version)
{
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) === 0) {
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) !== 1) {
throw Exception::invalidPlatformVersionSpecified(
$version,
'<major_version>.<minor_version>.<patch_version>',
@@ -40,6 +41,10 @@ abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
$patchVersion = $versionParts['patch'] ?? 0;
$version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion;
if (version_compare($version, '12.0', '>=')) {
return new PostgreSQL120Platform();
}
if (version_compare($version, '10.0', '>=')) {
return new PostgreSQL100Platform();
}
@@ -26,7 +26,6 @@ class InitializeSession implements Middleware
'ALTER SESSION SET'
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIME_FORMAT = 'HH24:MI:SS'"
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS TZH:TZM'"
. " NLS_NUMERIC_CHARACTERS = '.,'",
@@ -126,6 +126,10 @@ final class Driver extends AbstractPostgreSQLDriver
$dsn .= 'application_name=' . $params['application_name'] . ';';
}
if (isset($params['gssencmode'])) {
$dsn .= 'gssencmode=' . $params['gssencmode'] . ';';
}
return $dsn;
}
}
@@ -72,6 +72,7 @@ final class Driver extends AbstractPostgreSQLDriver
'user' => $params['user'] ?? null,
'password' => $params['password'] ?? null,
'sslmode' => $params['sslmode'] ?? null,
'gssencmode' => $params['gssencmode'] ?? null,
],
static fn ($value) => $value !== '' && $value !== null,
);