Skip to content

Commit afc928d

Browse files
authored
Merge pull request #1289 from nextcloud/backport-1284-allow-status.php-before-install-9
[stable9] Allow to call status.php before the instance is installed
2 parents b627eca + 930fd6f commit afc928d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

core/command/status.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ protected function configure() {
3838
}
3939

4040
protected function execute(InputInterface $input, OutputInterface $output) {
41+
$installed = (bool) \OC::$server->getConfig()->getSystemValue('installed', false);
42+
4143
$values = array(
42-
'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
44+
'installed' => $installed,
4345
'version' => implode('.', \OCP\Util::getVersion()),
4446
'versionstring' => \OC_Util::getVersionString(),
45-
'edition' => \OC_Util::getEditionString(),
47+
'edition' => $installed ? \OC_Util::getEditionString() : '',
4648
);
4749

4850
$this->writeArrayInOutputFormat($input, $output, $values);

lib/base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public static function checkInstalled() {
287287
return;
288288
}
289289
// Redirect to installer if not installed
290-
if (!\OC::$server->getSystemConfig()->getValue('installed', false) && OC::$SUBURI != '/index.php') {
290+
if (!\OC::$server->getSystemConfig()->getValue('installed', false) && OC::$SUBURI !== '/index.php' && OC::$SUBURI !== '/status.php') {
291291
if (OC::$CLI) {
292292
throw new Exception('Not installed');
293293
} else {

status.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'maintenance' => $maintenance,
4141
'version'=>implode('.', \OCP\Util::getVersion()),
4242
'versionstring'=>OC_Util::getVersionString(),
43-
'edition'=>OC_Util::getEditionString());
43+
'edition'=> $installed ? OC_Util::getEditionString() : '');
4444
if (OC::$CLI) {
4545
print_r($values);
4646
} else {

0 commit comments

Comments
 (0)