Merge pull request #14798 from owncloud/enable-oci-autotest-master

Setting oci as supported database
This commit is contained in:
Lukas Reschke 2015-03-11 16:14:54 +01:00
commit 73dc02d42c
2 changed files with 12 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class Install extends Command {
// validate the environment // validate the environment
$setupHelper = new Setup($this->config, \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'), new \OC_Defaults()); $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']; $errors = $sysInfo['errors'];
if (count($errors) > 0) { if (count($errors) > 0) {
$this->printErrors($output, $errors); $this->printErrors($output, $errors);

View File

@ -68,10 +68,11 @@ class Setup {
/** /**
* Get the available and supported databases of this instance * Get the available and supported databases of this instance
* *
* @throws Exception * @param bool $allowAllDatabases
* @return array * @return array
* @throws Exception
*/ */
public function getSupportedDatabases() { public function getSupportedDatabases($allowAllDatabases = false) {
$availableDatabases = array( $availableDatabases = array(
'sqlite' => array( 'sqlite' => array(
'type' => 'class', 'type' => 'class',
@ -99,8 +100,12 @@ class Setup {
'name' => 'MS SQL' 'name' => 'MS SQL'
) )
); );
$configuredDatabases = $this->config->getSystemValue('supportedDatabases', if ($allowAllDatabases) {
array('sqlite', 'mysql', 'pgsql')); $configuredDatabases = array_keys($availableDatabases);
} else {
$configuredDatabases = $this->config->getSystemValue('supportedDatabases',
array('sqlite', 'mysql', 'pgsql'));
}
if(!is_array($configuredDatabases)) { if(!is_array($configuredDatabases)) {
throw new Exception('Supported databases are not properly configured.'); throw new Exception('Supported databases are not properly configured.');
} }
@ -131,8 +136,8 @@ class Setup {
* @return array of system info, including an "errors" value * @return array of system info, including an "errors" value
* in case of errors/warnings * in case of errors/warnings
*/ */
public function getSystemInfo() { public function getSystemInfo($allowAllDatabases = false) {
$databases = $this->getSupportedDatabases(); $databases = $this->getSupportedDatabases($allowAllDatabases);
$dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');