Skip to content

Commit a2c7252

Browse files
authored
Update version for 2.x branch (#1672)
* Add to-next-major-dev command to update-release-version * 2.x is now 2.0.0-dev * Use %d for major version in tests
1 parent d20de7e commit a2c7252

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

bin/update-release-version.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function usage()
1717
to-stable: Mark the current version as stable
1818
to-next-patch-dev: Update to the next patch development version
1919
to-next-minor-dev: Update to the next minor development version
20+
to-next-major-dev: Update to the next major development version
2021
get-version: Print the current version number
2122
2223
EOT;
@@ -167,6 +168,23 @@ function get_next_minor_version(array $versions): array
167168
];
168169
}
169170

171+
function get_next_major_version(array $versions): array
172+
{
173+
$versionComponents = $versions['versionComponents'];
174+
175+
// Increase major version, set other components to 0
176+
$versionComponents[0] += 1;
177+
$versionComponents[1] = 0;
178+
$versionComponents[2] = 0;
179+
$versionComponents[3] = 0;
180+
181+
return [
182+
'version' => get_version_string_from_components($versionComponents) . 'dev',
183+
'stability' => 'devel',
184+
'versionComponents' => $versionComponents,
185+
];
186+
}
187+
170188
function get_next_release_version(array $versions, string $releaseVersion): array
171189
{
172190
$releaseVersion = parse_release_version($releaseVersion);
@@ -244,6 +262,10 @@ function get_next_dev_version(array $versions): array
244262
$newVersion = get_next_minor_version($currentVersion);
245263
break;
246264

265+
case 'to-next-major-dev':
266+
$newVersion = get_next_major_version($currentVersion);
267+
break;
268+
247269
default:
248270
usage();
249271
}

phongo_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* publishing a release. */
2323

2424
/* clang-format off */
25-
#define PHP_MONGODB_VERSION "1.21.0dev"
25+
#define PHP_MONGODB_VERSION "2.0.0dev"
2626
#define PHP_MONGODB_STABILITY "devel"
27-
#define PHP_MONGODB_VERSION_DESC 1,21,0,0
27+
#define PHP_MONGODB_VERSION_DESC 2,0,0,0
2828
/* clang-format on */
2929

3030
#endif /* PHONGO_VERSION_H */

tests/manager/manager-debug-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ rmdir($name);
2222
<?php exit(0); ?>
2323
--EXPECTF--
2424
%A[%s] PHONGO: DEBUG > Connection string: '%s'
25-
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
25+
[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
2626
%A===DONE===%A

tests/manager/manager-debug-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ $manager = new MongoDB\Driver\Manager;
1212
<?php exit(0); ?>
1313
--EXPECTF--
1414
%A[%s] PHONGO: DEBUG > Connection string: '%s'
15-
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
15+
[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s
1616
%A===DONE===%A

0 commit comments

Comments
 (0)