Unverified Commit b0ccc05f authored by Michael Moravec's avatar Michael Moravec Committed by Sergei Morozov

Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions

parent 7e3e4350
# Upgrade to 3.0 # Upgrade to 3.0
## BC BREAK: Removed Doctrine\DBAL\Version
The `Doctrine\DBAL\Version` class is no longer available: please refrain from checking the DBAL version at runtime.
## BC BREAK User-provided `PDO` instance is no longer supported ## BC BREAK User-provided `PDO` instance is no longer supported
In order to share the same `PDO` instances between DBAL and other components, initialize the connection in DBAL and access it using `Connection::getWrappedConnection()->getWrappedConnection()`. In order to share the same `PDO` instances between DBAL and other components, initialize the connection in DBAL and access it using `Connection::getWrappedConnection()->getWrappedConnection()`.
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
"require": { "require": {
"php": "^7.2", "php": "^7.2",
"doctrine/cache": "^1.0", "doctrine/cache": "^1.0",
"doctrine/event-manager": "^1.0" "doctrine/event-manager": "^1.0",
"ocramius/package-versions": "^1.4"
}, },
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^6.0", "doctrine/coding-standard": "^6.0",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5917f568d73e1f502700514d88d00b8c", "content-hash": "d2829e570f6cbea341f9ce388f4349b4",
"packages": [ "packages": [
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
...@@ -153,6 +153,56 @@ ...@@ -153,6 +153,56 @@
"eventmanager" "eventmanager"
], ],
"time": "2018-06-11T11:59:03+00:00" "time": "2018-06-11T11:59:03+00:00"
},
{
"name": "ocramius/package-versions",
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/Ocramius/PackageVersions.git",
"reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d",
"reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0.0",
"php": "^7.1.0"
},
"require-dev": {
"composer/composer": "^1.6.3",
"doctrine/coding-standard": "^5.0.1",
"ext-zip": "*",
"infection/infection": "^0.7.1",
"phpunit/phpunit": "^7.5.17"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"PackageVersions\\": "src/PackageVersions"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"time": "2019-11-15T16:17:10+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
...@@ -1095,56 +1145,6 @@ ...@@ -1095,56 +1145,6 @@
], ],
"time": "2019-08-12T20:17:41+00:00" "time": "2019-08-12T20:17:41+00:00"
}, },
{
"name": "ocramius/package-versions",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/Ocramius/PackageVersions.git",
"reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb",
"reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0.0",
"php": "^7.1.0"
},
"require-dev": {
"composer/composer": "^1.6.3",
"doctrine/coding-standard": "^5.0.1",
"ext-zip": "*",
"infection/infection": "^0.7.1",
"phpunit/phpunit": "^7.0.0"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"PackageVersions\\": "src/PackageVersions"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"time": "2019-02-21T12:16:21+00:00"
},
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
"version": "1.0.3", "version": "1.0.3",
......
...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection; ...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand; use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand;
use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand; use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
use Doctrine\DBAL\Version; use PackageVersions\Versions;
use Symfony\Component\Console\Application; use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\HelperSet;
...@@ -37,7 +37,7 @@ class ConsoleRunner ...@@ -37,7 +37,7 @@ class ConsoleRunner
*/ */
public static function run(HelperSet $helperSet, $commands = []) public static function run(HelperSet $helperSet, $commands = [])
{ {
$cli = new Application('Doctrine Command Line Interface', Version::VERSION); $cli = new Application('Doctrine Command Line Interface', Versions::getVersion('doctrine/dbal'));
$cli->setCatchExceptions(true); $cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet); $cli->setHelperSet($helperSet);
......
<?php
namespace Doctrine\DBAL;
use function str_replace;
use function strtolower;
use function version_compare;
/**
* Class to store and retrieve the version of Doctrine.
*/
class Version
{
/**
* Current Doctrine Version.
*/
public const VERSION = '3.0.0-DEV';
/**
* Compares a Doctrine version with the current one.
*
* @param string $version The Doctrine version to compare to.
*
* @return int -1 if older, 0 if it is the same, 1 if version passed as argument is newer.
*/
public static function compare($version)
{
$currentVersion = str_replace(' ', '', strtolower(self::VERSION));
$version = str_replace(' ', '', $version);
return version_compare($version, $currentVersion);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment