diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-12-11 14:56:04 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-12-11 14:56:04 +0100 |
commit | 8126b09bfe28a2af07d38aa907dc574c6819ecfc (patch) | |
tree | 42441220f4f55eba7d525ab23950018714b065fe /lib/user.php | |
parent | f7f462f2733117cc2e3be0421e7ebca85bac1562 (diff) | |
download | nextcloud-server-8126b09bfe28a2af07d38aa907dc574c6819ecfc.tar.gz nextcloud-server-8126b09bfe28a2af07d38aa907dc574c6819ecfc.zip |
add debug logging for user backend registration
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/lib/user.php b/lib/user.php index 31c93740d77..94ea899b841 100644 --- a/lib/user.php +++ b/lib/user.php @@ -86,8 +86,9 @@ class OC_User { */ public static function useBackend( $backend = 'database' ) { if($backend instanceof OC_User_Interface) { + OC_Log::write('core', 'Adding user backend instance of '.get_class($backend).'.', OC_Log::DEBUG); self::$_usedBackends[get_class($backend)]=$backend; - }else{ + } else { // You'll never know what happens if( null === $backend OR !is_string( $backend )) { $backend = 'database'; @@ -98,15 +99,17 @@ class OC_User { case 'database': case 'mysql': case 'sqlite': + OC_Log::write('core', 'Adding user backend '.$backend.'.', OC_Log::DEBUG); self::$_usedBackends[$backend] = new OC_User_Database(); break; default: + OC_Log::write('core', 'Adding default user backend '.$backend.'.', OC_Log::DEBUG); $className = 'OC_USER_' . strToUpper($backend); self::$_usedBackends[$backend] = new $className(); break; } } - true; + return true; } /** @@ -124,15 +127,19 @@ class OC_User { foreach($backends as $i=>$config) { $class=$config['class']; $arguments=$config['arguments']; - if(class_exists($class) and array_search($i, self::$_setupedBackends)===false) { - // make a reflection object - $reflectionObj = new ReflectionClass($class); - - // use Reflection to create a new instance, using the $args - $backend = $reflectionObj->newInstanceArgs($arguments); - self::useBackend($backend); - $_setupedBackends[]=$i; - }else{ + if(class_exists($class)) { + if(array_search($i, self::$_setupedBackends)===false) { + // make a reflection object + $reflectionObj = new ReflectionClass($class); + + // use Reflection to create a new instance, using the $args + $backend = $reflectionObj->newInstanceArgs($arguments); + self::useBackend($backend); + $_setupedBackends[]=$i; + } else { + OC_Log::write('core', 'User backend '.$class.' already initialized.', OC_Log::DEBUG); + } + } else { OC_Log::write('core', 'User backend '.$class.' not found.', OC_Log::ERROR); } } |