diff --git a/bin/update-release-version.php b/bin/update-release-version.php index 9731cdd13..d9187f614 100755 --- a/bin/update-release-version.php +++ b/bin/update-release-version.php @@ -17,6 +17,7 @@ function usage() to-stable: Mark the current version as stable to-next-patch-dev: Update to the next patch development version to-next-minor-dev: Update to the next minor development version + to-next-major-dev: Update to the next major development version get-version: Print the current version number EOT; @@ -167,6 +168,23 @@ function get_next_minor_version(array $versions): array ]; } +function get_next_major_version(array $versions): array +{ + $versionComponents = $versions['versionComponents']; + + // Increase major version, set other components to 0 + $versionComponents[0] += 1; + $versionComponents[1] = 0; + $versionComponents[2] = 0; + $versionComponents[3] = 0; + + return [ + 'version' => get_version_string_from_components($versionComponents) . 'dev', + 'stability' => 'devel', + 'versionComponents' => $versionComponents, + ]; +} + function get_next_release_version(array $versions, string $releaseVersion): array { $releaseVersion = parse_release_version($releaseVersion); @@ -244,6 +262,10 @@ function get_next_dev_version(array $versions): array $newVersion = get_next_minor_version($currentVersion); break; + case 'to-next-major-dev': + $newVersion = get_next_major_version($currentVersion); + break; + default: usage(); } diff --git a/phongo_version.h b/phongo_version.h index 38727ac5f..a0cd3a0cc 100644 --- a/phongo_version.h +++ b/phongo_version.h @@ -22,9 +22,9 @@ * publishing a release. */ /* clang-format off */ -#define PHP_MONGODB_VERSION "1.21.0dev" +#define PHP_MONGODB_VERSION "2.0.0dev" #define PHP_MONGODB_STABILITY "devel" -#define PHP_MONGODB_VERSION_DESC 1,21,0,0 +#define PHP_MONGODB_VERSION_DESC 2,0,0,0 /* clang-format on */ #endif /* PHONGO_VERSION_H */ diff --git a/tests/manager/manager-debug-001.phpt b/tests/manager/manager-debug-001.phpt index cc4a81841..fa4789740 100644 --- a/tests/manager/manager-debug-001.phpt +++ b/tests/manager/manager-debug-001.phpt @@ -22,5 +22,5 @@ rmdir($name); --EXPECTF-- %A[%s] PHONGO: DEBUG > Connection string: '%s' -[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s +[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s %A===DONE===%A diff --git a/tests/manager/manager-debug-002.phpt b/tests/manager/manager-debug-002.phpt index 470c3a540..89e882da2 100644 --- a/tests/manager/manager-debug-002.phpt +++ b/tests/manager/manager-debug-002.phpt @@ -12,5 +12,5 @@ $manager = new MongoDB\Driver\Manager; --EXPECTF-- %A[%s] PHONGO: DEBUG > Connection string: '%s' -[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s +[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s %A===DONE===%A