Files
php-curl-class/scripts/bump_minor_version.php
T
Zach Borboa 6ceabf7293 Clean up
2021-07-26 00:35:01 -04:00

23 lines
748 B
PHP
Executable File

#!/usr/bin/php
<?php
require __DIR__ . '/../src/Curl/Curl.php';
$current_version = Curl\Curl::VERSION;
list($major, $minor, $_) = explode('.', $current_version);
$new_version = implode('.', [$major, (string)((int)$minor += 1), '0']);
foreach ([
[
__DIR__ . '/../src/Curl/Curl.php',
'/const VERSION = \'(?:\d+.\d+.\d+)\';/',
'const VERSION = \'' . $new_version . '\';',
],
] as $info) {
list($filepath, $find, $replace) = $info;
$data = preg_replace($find, $replace, file_get_contents($filepath));
file_put_contents($filepath, $data);
}
$rightwards_arrow = json_decode('"\u2192"');
echo 'Bump version: ' . $current_version . ' ' . $rightwards_arrow . ' ' . $new_version . "\n";