Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
1f197134
Commit
1f197134
authored
9 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Look up services in the app container before trying the core container
parent
412e4ed3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/servercontainer.php
+24
-0
24 additions, 0 deletions
lib/private/servercontainer.php
with
24 additions
and
0 deletions
lib/private/servercontainer.php
+
24
−
0
View file @
1f197134
...
...
@@ -62,4 +62,28 @@ class ServerContainer extends SimpleContainer {
return
new
DIContainer
(
$appName
);
}
/**
* @param string $name name of the service to query for
* @return mixed registered service for the given $name
* @throws QueryException if the query could not be resolved
*/
public
function
query
(
$name
)
{
$name
=
$this
->
sanitizeName
(
$name
);
// In case the service starts with OCA\ we try to find the service in
// the apps container first.
if
(
strpos
(
$name
,
'OCA\\'
)
===
0
&&
substr_count
(
$name
,
'\\'
)
>=
2
)
{
$segments
=
explode
(
'\\'
,
$name
);
$appContainer
=
$this
->
getAppContainer
(
strtolower
(
$segments
[
0
]));
try
{
return
$appContainer
->
query
(
$name
);
}
catch
(
QueryException
$e
)
{
// Didn't find the service in the respective app container,
// ignore it and fall back to the core container.
}
}
return
parent
::
query
(
$name
);
}
}
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