Browse Source

Set vendor during install

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
tags/v12.0.0beta1
Morris Jobke 7 years ago
parent
commit
d548329543
No account linked to committer's email address
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      lib/private/Setup.php

+ 15
- 0
lib/private/Setup.php View File

$config = \OC::$server->getConfig(); $config = \OC::$server->getConfig();
$config->setAppValue('core', 'installedat', microtime(true)); $config->setAppValue('core', 'installedat', microtime(true));
$config->setAppValue('core', 'lastupdatedat', microtime(true)); $config->setAppValue('core', 'lastupdatedat', microtime(true));
$config->setAppValue('core', 'vendor', $this->getVendor());


$group =\OC::$server->getGroupManager()->createGroup('admin'); $group =\OC::$server->getGroupManager()->createGroup('admin');
$group->addUser($user); $group->addUser($user);
file_put_contents($baseDir . '/.htaccess', $content); file_put_contents($baseDir . '/.htaccess', $content);
file_put_contents($baseDir . '/index.html', ''); 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;
}
} }

Loading…
Cancel
Save