Merge pull request #3426 from nextcloud/stable11-set-vendor-during-install

[stable11] Set vendor during install
This commit is contained in:
Lukas Reschke 2017-02-10 11:41:06 +01:00 committed by GitHub
commit 7330430618
1 changed files with 15 additions and 0 deletions

View File

@ -359,6 +359,7 @@ class Setup {
$config = \OC::$server->getConfig();
$config->setAppValue('core', 'installedat', microtime(true));
$config->setAppValue('core', 'lastupdatedat', microtime(true));
$config->setAppValue('core', 'vendor', $this->getVendor());
$group =\OC::$server->getGroupManager()->createGroup('admin');
$group->addUser($user);
@ -499,4 +500,18 @@ class Setup {
file_put_contents($baseDir . '/.htaccess', $content);
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() {
// this should really be a JSON file
require \OC::$SERVERROOT . '/version.php';
/** @var string $vendor */
return (string) $vendor;
}
}