mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #34136 from nextcloud/fix/default-channel
on installation save channel to config.php if not stable
This commit is contained in:
commit
294a00d8e0
2 changed files with 16 additions and 11 deletions
|
|
@ -3371,6 +3371,9 @@
|
|||
<code>$content !== ''</code>
|
||||
<code>$type === 'pdo'</code>
|
||||
</RedundantCondition>
|
||||
<UndefinedVariable occurrences="1">
|
||||
<code>$vendor</code>
|
||||
</UndefinedVariable>
|
||||
</file>
|
||||
<file src="lib/private/Setup/AbstractDatabase.php">
|
||||
<UndefinedThisPropertyFetch occurrences="4">
|
||||
|
|
|
|||
|
|
@ -393,7 +393,12 @@ class Setup {
|
|||
$config = \OC::$server->getConfig();
|
||||
$config->setAppValue('core', 'installedat', microtime(true));
|
||||
$config->setAppValue('core', 'lastupdatedat', microtime(true));
|
||||
$config->setAppValue('core', 'vendor', $this->getVendor());
|
||||
|
||||
$vendorData = $this->getVendorData();
|
||||
$config->setAppValue('core', 'vendor', $vendorData['vendor']);
|
||||
if ($vendorData['channel'] !== 'stable') {
|
||||
$config->setSystemValue('updater.release.channel', $vendorData['channel']);
|
||||
}
|
||||
|
||||
$group = \OC::$server->getGroupManager()->createGroup('admin');
|
||||
if ($group instanceof IGroup) {
|
||||
|
|
@ -582,17 +587,14 @@ class Setup {
|
|||
file_put_contents($baseDir . '/index.html', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return vendor from which this version was published
|
||||
*
|
||||
* @return string Get the vendor
|
||||
*
|
||||
* Copy of \OC\Updater::getVendor()
|
||||
*/
|
||||
private function getVendor() {
|
||||
private function getVendorData(): array {
|
||||
// this should really be a JSON file
|
||||
require \OC::$SERVERROOT . '/version.php';
|
||||
/** @var string $vendor */
|
||||
return (string)$vendor;
|
||||
/** @var mixed $vendor */
|
||||
/** @var mixed $OC_Channel */
|
||||
return [
|
||||
'vendor' => (string)$vendor,
|
||||
'channel' => (string)$OC_Channel,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue