Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
8126b09b
Commit
8126b09b
authored
12 years ago
by
Jörn Friedrich Dreyer
Browse files
Options
Downloads
Patches
Plain Diff
add debug logging for user backend registration
parent
f7f462f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/user.php
+18
-11
18 additions, 11 deletions
lib/user.php
with
18 additions
and
11 deletions
lib/user.php
+
18
−
11
View file @
8126b09b
...
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment