From c6ed15b88eab56e616e23cbaaeb576e6c83a1e5d Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 9 Feb 2017 23:37:00 -0600 Subject: [PATCH] Set vendor during install Signed-off-by: Morris Jobke --- lib/private/Setup.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 81a5343fe2..12c95c49f8 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -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; + } }