]> source.dussan.org Git - nextcloud-server.git/commitdiff
replaced $CONFIG_DB* with OC_CONFIG::getValue( "db*" )
authorJakob Sack <kde@jakobsack.de>
Sat, 16 Apr 2011 09:11:16 +0000 (11:11 +0200)
committerJakob Sack <kde@jakobsack.de>
Sat, 16 Apr 2011 09:11:16 +0000 (11:11 +0200)
lib/base.php
lib/database.php
lib/plugin.php

index c84d61b3214875c41c48c5e375489ded4e540e8b..270bf09e9acface4cea858f171b0bb99bf2c0562 100644 (file)
@@ -51,6 +51,9 @@ set_include_path($SERVERROOT.'/lib'.PATH_SEPARATOR.$SERVERROOT.'/config'.PATH_SE
 if( !isset( $RUNTIME_NOSETUPFS )){
        $RUNTIME_NOSETUPFS = false;
 }
+if( !isset( $RUNTIME_NOAPPS )){
+       $RUNTIME_NOAPPS = false;
+}
 
 // define default config values
 $CONFIG_INSTALLED=false;
@@ -113,8 +116,11 @@ OC_UTIL::addScript( "jquery-ui-1.8.10.custom.min" );
 OC_UTIL::addScript( "js" );
 OC_UTIL::addStyle( "jquery-ui-1.8.10.custom" );
 OC_UTIL::addStyle( "styles" );
+
 // Load Apps
-OC_APP::loadApps();
+if( !$RUNTIME_NOAPPS ){
+       OC_APP::loadApps();
+}
 
 // check if the server is correctly configured for ownCloud
 OC_UTIL::checkserver();
@@ -232,13 +238,13 @@ class OC_UTIL {
                global $CONFIG_DATADIRECTORY_ROOT;
                global $CONFIG_BACKUPDIRECTORY;
                global $CONFIG_ENABLEBACKUP;
-               global $CONFIG_INSTALLED;
+               $CONFIG_INSTALLED = OC_CONFIG::getValue( "installed", false );
                $error='';
                if(!is_callable('sqlite_open') and !is_callable('mysql_connect')){
                        $error.='No database drivers (sqlite or mysql) installed.<br/>';
                }
-               global $CONFIG_DBTYPE;
-               global $CONFIG_DBNAME;
+               $CONFIG_DBTYPE = OC_CONFIG::getValue( "dbtype", "sqlite" );
+               $CONFIG_DBNAME = OC_CONFIG::getValue( "dbname", "owncloud" );
                if(!stristr(PHP_OS, 'WIN')){
                        if($CONFIG_DBTYPE=='sqlite'){
                                $file=$SERVERROOT.'/'.$CONFIG_DBNAME;
index 6d65665df4392597ec63bf93294798e0bc447372..dc4bf75649b1479ffb6c21ae18ca3b263719e43a 100644 (file)
@@ -38,11 +38,11 @@ class OC_DB {
         */
        static public function connect(){
                // The global data we need
-               global $CONFIG_DBNAME;
-               global $CONFIG_DBHOST;
-               global $CONFIG_DBUSER;
-               global $CONFIG_DBPASSWORD;
-               global $CONFIG_DBTYPE;
+               $CONFIG_DBNAME = OC_CONFIG::getValue( "dbname", "owncloud" );;
+               $CONFIG_DBHOST = OC_CONFIG::getValue( "dbhost", "" );;
+               $CONFIG_DBUSER = OC_CONFIG::getValue( "dbuser", "" );;
+               $CONFIG_DBPASSWORD = OC_CONFIG::getValue( "dbpassword", "" );;
+               $CONFIG_DBTYPE = OC_CONFIG::getValue( "dbtype", "sqlite" );;
                global $DOCUMENTROOT;
                global $SERVERROOT;
 
@@ -232,8 +232,8 @@ class OC_DB {
         * TODO: write more documentation
         */
        public static function createDbFromStructure( $file ){
-               global $CONFIG_DBNAME;
-               global $CONFIG_DBTABLEPREFIX;
+               $CONFIG_DBNAME  = OC_CONFIG::getValue( "dbname", "owncloud" );
+               $CONFIG_DBTABLEPREFIX = OC_CONFIG::getValue( "dbtableprefix", "oc_" );
 
                self::connectScheme();
 
@@ -295,8 +295,8 @@ class OC_DB {
         */
        private static function processQuery( $query ){
                // We need Database type and table prefix
-               global $CONFIG_DBTYPE;
-               global $CONFIG_DBTABLEPREFIX;
+               $CONFIG_DBTYPE = OC_CONFIG::getValue( "dbtype", "sqlite" );
+               $CONFIG_DBTABLEPREFIX = OC_CONFIG::getValue( "dbtableprefix", "oc_" );
 
                // differences in escaping of table names (` for mysql)
                // Problem: what if there is a ` in the value we want to insert?
index 0cec329ea35318b9a2e0467e04b7e4a7e35f9a62..0d4e9744dc363db0b2d5354531744c138fee898d 100644 (file)
@@ -90,7 +90,7 @@ class OC_PLUGIN{
         * Load all plugins that aren't blacklisted
         */
        public static function loadPlugins() {
-               global $CONFIG_INSTALLED;
+               $CONFIG_INSTALLED = OC_CONFIG::getValue( "installed", false );
                if($CONFIG_INSTALLED){
                        global $SERVERROOT;
                        $plugins = self::listPlugins();