fatal("failed to read old version from \"xml/version.xml\"\n");
}
-/** @var string $newVersion */
-/** @var bool $doCommit */
-/** @var bool $doSql */
+/**
+ * @var string $newVersion */
+/**
+ * @var bool $doCommit */
+/**
+ * @var bool $doSql */
extract(parseArgs($argv));
if (!isVersionValid($newVersion)) {
echo "Changing version from $oldVersion to $newVersion...\n";
$verName = makeVerName($newVersion);
-$phpFile = initFile("CRM/Upgrade/Incremental/php/{$verName}.php", function () use ($verName) {
+$phpFile = initFile("CRM/Upgrade/Incremental/php/{$verName}.php", function () use ($verName, $newVersion) {
ob_start();
global $camelNumber;
+ global $versionNumber;
$camelNumber = $verName;
+ $versionNumber = $newVersion;
require 'CRM/Upgrade/Incremental/php/Template.php';
- unset($camelNumber);
+ unset($camelNumber, $versionNumber);
return ob_get_clean();
});
foreach ($infoXmls as $infoXml) {
updateXmlFile($infoXml, function (DOMDocument $dom) use ($newVersion) {
foreach ($dom->getElementsByTagName('version') as $tag) {
- /** @var \DOMNode $tag */
+ /* @var \DOMNode $tag */
$tag->textContent = $newVersion;
}
});
}
/**
-* @param array $argv
+ * @param array $argv
* Ex: ['myscript.php', '--no-commit', '5.6.7']
* @return array
- * Ex: ['scriptFile' => 'myscript.php', 'doCommit' => FALSE, 'newVersion' => '5.6.7']
+ * Ex: ['scriptFile' => 'myscript.php', 'doCommit' => FALSE, 'newVersion' => '5.6.7']
*/
function parseArgs($argv) {
$parsed = [];