summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-12-11 06:34:20 -0800
committerFrank Karlitschek <frank@owncloud.org>2012-12-11 06:34:20 -0800
commit728ea711b23c796c670559a02701ce0fd1c5851c (patch)
treec74fabcd1dfdf2ed8fc1c47780c9e89a15e3e00c /lib
parenteb7dbf3701d27faffb7cdf612da06a158942787f (diff)
parent8126b09bfe28a2af07d38aa907dc574c6819ecfc (diff)
downloadnextcloud-server-728ea711b23c796c670559a02701ce0fd1c5851c.tar.gz
nextcloud-server-728ea711b23c796c670559a02701ce0fd1c5851c.zip
Merge pull request #824 from owncloud/add_user_backend_registration_debug_log
add debug logging for user backend registration
Diffstat (limited to 'lib')
-rw-r--r--lib/user.php29
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);
}
}