}
$list = new PackageUpdateServerList();
- $list->getConditionBuilder()->add("isDisabled = ?", [0]);
$list->readObjects();
+ $woltlabUpdateServer = null;
+ $woltlabStoreServer = null;
+ $results = [];
+ foreach ($list as $packageServer) {
+ if ($packageServer->isWoltLabUpdateServer()) $woltlabUpdateServer = $packageServer;
+ if ($packageServer->isWoltLabStoreServer()) $woltlabStoreServer = $packageServer;
+ if ($packageServer->isDisabled) continue;
+
+ $results[] = $packageServer;
+ }
+
+ if (!$woltlabUpdateServer) {
+ $results[] = PackageUpdateServerEditor::create([
+ 'serverURL' => 'http://update.woltlab.com/'.\wcf\getMinorVersion().'/',
+ ]);
+ }
+ if (!$woltlabStoreServer) {
+ $results[] = PackageUpdateServerEditor::create([
+ 'serverURL' => 'http://store.woltlab.com/'.\wcf\getMinorVersion().'/',
+ ]);
+ }
+
if (ENABLE_ENTERPRISE_MODE) {
- return array_filter($list->getObjects(), function (PackageUpdateServer $server) {
+ return array_filter($results, function (PackageUpdateServer $server) {
return $server->isWoltLabStoreServer() || $server->isTrustedServer();
});
}
- return $list->getObjects();
+ return $results;
}
/**