diff --git a/core/Command/Status.php b/core/Command/Status.php index f06b26982075..87e1f074efc3 100644 --- a/core/Command/Status.php +++ b/core/Command/Status.php @@ -40,7 +40,8 @@ protected function configure() { protected function execute(InputInterface $input, OutputInterface $output) { $values = [ 'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false), - 'version' => implode('.', \OCP\Util::getVersion()), + 'first_install_version' => \OC::$server->getConfig()->getAppValue('core', 'first_install_version', 'unknown'), + 'version' => \implode('.', \OCP\Util::getVersion()), 'versionstring' => \OC_Util::getVersionString(), 'edition' => \OC_Util::getEditionString(), ]; diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 76bbe6b1a886..336339e445e2 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -380,6 +380,9 @@ public function install($options) { self::installBackgroundJobs(); + // save the origin version that we installed at + $config->setAppValue('core', 'first_install_version', \implode('.', \OCP\Util::getVersion())); + //and we are done $config->setSystemValue('installed', true); } diff --git a/tests/acceptance/features/bootstrap/BasicStructure.php b/tests/acceptance/features/bootstrap/BasicStructure.php index 7ec9c5dd74a6..4fb61f95f64f 100644 --- a/tests/acceptance/features/bootstrap/BasicStructure.php +++ b/tests/acceptance/features/bootstrap/BasicStructure.php @@ -937,11 +937,11 @@ public function statusPhpRespondedShouldMatch(PyStringNode $jsonExpected) { = \json_encode(\json_decode($this->response->getBody(), true)); if ($this->runOcc(['status']) === 0) { $output = \explode("- ", $this->lastStdOut); - $version = \explode(": ", $output[2]); + $version = \explode(": ", $output[3]); PHPUnit_Framework_Assert::assertEquals( "version", $version[0] ); - $versionString = \explode(": ", $output[3]); + $versionString = \explode(": ", $output[4]); PHPUnit_Framework_Assert::assertEquals( "versionstring", $versionString[0] );