}
// register compatibility versions of this update package version.
+ // @deprecated 5.2
if (isset($versionData['compatibility'])) {
foreach ($versionData['compatibility'] as $version) {
$compatibilityInserts[] = [
'version' => $version
];
}
+
+ // The API compatibility versions are deprecated, any package that exposes them must
+ // exclude at most `com.woltlab.wcf` in version `6.0.0 Alpha 1`.
+ if (!empty($compatibilityInserts)) {
+ if (!isset($versionData['excludedPackages'])) $versionData['excludedPackages'] = [];
+ $excludeCore60 = '6.0.0 Alpha 1';
+
+ $coreExclude = null;
+ $versionData['excludedPackages'] = array_filter($versionData['excludedPackages'], function($excludedPackage) use (&$coreExclude) {
+ if ($excludedPackage['excludedPackage'] === 'com.woltlab.wcf') {
+ $coreExclude = $excludedPackage['excludedPackageVersion'];
+ return false;
+ }
+
+ return true;
+ });
+
+ if ($coreExclude === null || Package::compareVersion($coreExclude, $excludeCore60, '>')) {
+ $versionData['excludedPackages'][] = [
+ 'packageUpdateVersionID' => $packageUpdateVersionID,
+ 'excludedPackage' => 'com.woltlab.wcf',
+ 'excludedPackageVersion' => $excludeCore60,
+ ];
+ }
+ }
}
}
}
}
// insert compatibility versions
+ // @deprecated 5.2
if (!empty($compatibilityInserts)) {
$sql = "INSERT INTO wcf".WCF_N."_package_update_compatibility
(packageUpdateVersionID, version)