return str_replace($oldVersion, $newVersion, $content);
});
+// Update core extension info
$infoXmls = findCoreInfoXml();
foreach ($infoXmls as $infoXml) {
updateXmlFile($infoXml, function (DOMDocument $dom) use ($newVersion) {
+ // Update extension version
foreach ($dom->getElementsByTagName('version') as $tag) {
/* @var \DOMNode $tag */
$tag->textContent = $newVersion;
}
+ // Update compatability - set to major version of core
+ foreach ($dom->getElementsByTagName('compatibility') as $compat) {
+ /* @var \DOMNode $compat */
+ foreach ($compat->getElementsByTagName('ver') as $tag) {
+ /* @var \DOMNode $tag */
+ $tag->textContent = implode('.', array_slice(explode('.', $newVersion), 0, 2));
+ }
+ }
});
}