diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-11-11 19:05:22 +0400 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-11-11 19:05:22 +0400 |
commit | 0a422ed489bad6d624bf6798a4bbd156623ce4b8 (patch) | |
tree | ad6e1d7072da2f3e1f59efadf11c711c7d0c83ed /lib | |
parent | ea914b6f47e8af2dda247614e35f80f68773a293 (diff) | |
parent | 0b295d995286964135e8d93221fabda1a10880de (diff) |
Merge pull request #5725 from owncloud/fix_enabling_apps_on_oracle_cornercase
fix enabling apps for oracle - cornercase
Diffstat (limited to 'lib')
-rw-r--r-- | lib/db.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/db.php b/lib/db.php index 0dd4b32adf7..84b05dfe6e5 100644 --- a/lib/db.php +++ b/lib/db.php @@ -561,9 +561,29 @@ class OC_DB { * TODO: write more documentation */ public static function createDbFromStructure( $file ) { - $CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" ); - $CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" ); - $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); + $CONFIG_DBNAME = OC_Config::getValue('dbname', 'owncloud'); + $CONFIG_DBTABLEPREFIX = OC_Config::getValue('dbtableprefix', 'oc_'); + $CONFIG_DBTYPE = OC_Config::getValue('dbtype', 'sqlite'); + $CONFIG_DBHOST = OC_Config::getValue('dbhost', ''); + + if( $CONFIG_DBTYPE === 'oci' + && $CONFIG_DBNAME === '' + && ! empty($CONFIG_DBHOST) + ) { + // we are connecting by user name, pwd and SID (host) + $CONFIG_DBUSER = OC_Config::getValue('dbuser', ''); + $CONFIG_DBPASSWORD = OC_Config::getValue('dbpassword'); + if ($CONFIG_DBUSER !== '' + && $CONFIG_DBPASSWORD !== '' + ) { + // use dbuser as dbname + $CONFIG_DBNAME = $CONFIG_DBUSER; + } else { + throw new DatabaseException('Please specify ' + .'username and password when ' + .'connecting via SID as the hostname.', ''); + } + } // cleanup the cached queries self::$preparedQueries = array(); |