Skip to content

Commit

Permalink
Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 authored and morozov committed Feb 2, 2018
1 parent 64566f2 commit 67b8f76
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 66 deletions.
6 changes: 5 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Upgrade to DEVELOP
# Upgrade to 3.0 (DEVELOP)

## 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: the PDO symbols are no longer part of the DBAL API

Expand Down
3 changes: 0 additions & 3 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# Version class and file
project.version_class = Doctrine\\DBAL\\Version
project.version_file = lib/Doctrine/DBAL/Version.php
23 changes: 0 additions & 23 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,6 @@
</exec>
</target>

<target name="make-release" depends="check-git-checkout-clean,prepare,php">
<replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
<exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
<arg value="-r" />
<arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
</exec>
<exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
<arg value="-r" />
<arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
if (count($parts) != 3) {
throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
}
$parts[2]++;
echo implode('.', $parts);
" />
</exec>

<git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
<git-tag version="${doctrine.current_version}" />
<replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
<git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" />
</target>

<target name="check-git-checkout-clean">
<exec executable="git" failonerror="true">
<arg value="diff-index" />
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"require": {
"php": "^7.2",
"doctrine/common": "^2.7.1"
"doctrine/common": "^2.7.1",
"ocramius/package-versions": "^1.2"
},
"require-dev": {
"doctrine/coding-standard": "~2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand;
use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
use Doctrine\DBAL\Version;
use PackageVersions\Versions;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Helper\HelperSet;

Expand Down Expand Up @@ -40,7 +40,7 @@ public static function createHelperSet(Connection $connection)
*/
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->setHelperSet($helperSet);
Expand Down
36 changes: 0 additions & 36 deletions lib/Doctrine/DBAL/Version.php

This file was deleted.

0 comments on commit 67b8f76

Please sign in to comment.