Skip to content

Commit 8399566

Browse files
Majkl578morozov
authored andcommitted
Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions
1 parent db5399e commit 8399566

File tree

6 files changed

+9
-66
lines changed

6 files changed

+9
-66
lines changed

UPGRADE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Upgrade to DEVELOP
1+
# Upgrade to 3.0 (DEVELOP)
2+
3+
## BC BREAK: Removed Doctrine\DBAL\Version
4+
5+
The Doctrine\DBAL\Version class is no longer available: please refrain from checking the DBAL version at runtime.
26

37
## BC BREAK: the PDO symbols are no longer part of the DBAL API
48

build.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
# Version class and file
2-
project.version_class = Doctrine\\DBAL\\Version
3-
project.version_file = lib/Doctrine/DBAL/Version.php

build.xml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,6 @@
3838
</exec>
3939
</target>
4040

41-
<target name="make-release" depends="check-git-checkout-clean,prepare,php">
42-
<replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
43-
<exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
44-
<arg value="-r" />
45-
<arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
46-
</exec>
47-
<exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
48-
<arg value="-r" />
49-
<arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
50-
if (count($parts) != 3) {
51-
throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
52-
}
53-
$parts[2]++;
54-
echo implode('.', $parts);
55-
" />
56-
</exec>
57-
58-
<git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
59-
<git-tag version="${doctrine.current_version}" />
60-
<replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
61-
<git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" />
62-
</target>
63-
6441
<target name="check-git-checkout-clean">
6542
<exec executable="git" failonerror="true">
6643
<arg value="diff-index" />

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
],
1414
"require": {
1515
"php": "^7.2",
16-
"doctrine/common": "^2.7.1"
16+
"doctrine/common": "^2.7.1",
17+
"ocramius/package-versions": "^1.2"
1718
},
1819
"require-dev": {
1920
"doctrine/coding-standard": "^3.0",

lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand;
88
use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
99
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
10-
use Doctrine\DBAL\Version;
10+
use PackageVersions\Versions;
1111
use Symfony\Component\Console\Application;
1212
use Symfony\Component\Console\Helper\HelperSet;
1313

@@ -40,7 +40,7 @@ public static function createHelperSet(Connection $connection)
4040
*/
4141
public static function run(HelperSet $helperSet, $commands = [])
4242
{
43-
$cli = new Application('Doctrine Command Line Interface', Version::VERSION);
43+
$cli = new Application('Doctrine Command Line Interface', Versions::getVersion('doctrine/dbal'));
4444

4545
$cli->setCatchExceptions(true);
4646
$cli->setHelperSet($helperSet);

lib/Doctrine/DBAL/Version.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)