]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't play with config values ...
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 11 Mar 2015 14:47:24 +0000 (15:47 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 11 Mar 2015 14:47:24 +0000 (15:47 +0100)
core/command/maintenance/install.php
lib/private/setup.php

index 92a28425e50213940251137c1c9ddec2854d142e..eecdb08e620a6a41c6ba68ff14664fda1c4f508a 100644 (file)
@@ -40,9 +40,8 @@ class Install extends Command {
        protected function execute(InputInterface $input, OutputInterface $output) {
 
                // validate the environment
-               $this->config->setSystemValue('supportedDatabases', ['sqlite', 'mysql', 'pgsql', 'oci']);
                $setupHelper = new Setup($this->config, \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'), new \OC_Defaults());
-               $sysInfo = $setupHelper->getSystemInfo();
+               $sysInfo = $setupHelper->getSystemInfo(true);
                $errors = $sysInfo['errors'];
                if (count($errors) > 0) {
                        $this->printErrors($output, $errors);
index 1da42f0f8a42a9ab024f07228fa9d8dba870f0a4..44b6ad56cb89a77645aa44fae2c97a1737b70d46 100644 (file)
@@ -68,10 +68,11 @@ class Setup {
        /**
         * Get the available and supported databases of this instance
         *
-        * @throws Exception
+        * @param bool $allowAllDatabases
         * @return array
+        * @throws Exception
         */
-       public function getSupportedDatabases() {
+       public function getSupportedDatabases($allowAllDatabases = false) {
                $availableDatabases = array(
                        'sqlite' =>  array(
                                'type' => 'class',
@@ -99,8 +100,12 @@ class Setup {
                                'name' => 'MS SQL'
                        )
                );
-               $configuredDatabases = $this->config->getSystemValue('supportedDatabases',
-                       array('sqlite', 'mysql', 'pgsql'));
+               if ($allowAllDatabases) {
+                       $configuredDatabases = array_keys($availableDatabases);
+               } else {
+                       $configuredDatabases = $this->config->getSystemValue('supportedDatabases',
+                               array('sqlite', 'mysql', 'pgsql'));
+               }
                if(!is_array($configuredDatabases)) {
                        throw new Exception('Supported databases are not properly configured.');
                }
@@ -131,8 +136,8 @@ class Setup {
         * @return array of system info, including an "errors" value
         * in case of errors/warnings
         */
-       public function getSystemInfo() {
-               $databases = $this->getSupportedDatabases();
+       public function getSystemInfo($allowAllDatabases = false) {
+               $databases = $this->getSupportedDatabases($allowAllDatabases);
 
                $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');