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
a7226996
Commit
a7226996
authored
8 years ago
by
Joas Schilling
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1359 from nextcloud/cache_controller_name
Cache the build ControllerName
parents
cf570559
959bf0d1
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/AppFramework/Routing/RouteConfig.php
+15
-1
15 additions, 1 deletion
lib/private/AppFramework/Routing/RouteConfig.php
with
15 additions
and
1 deletion
lib/private/AppFramework/Routing/RouteConfig.php
+
15
−
1
View file @
a7226996
...
@@ -36,14 +36,25 @@ use OCP\Route\IRouter;
...
@@ -36,14 +36,25 @@ use OCP\Route\IRouter;
* @package OC\AppFramework\routing
* @package OC\AppFramework\routing
*/
*/
class
RouteConfig
{
class
RouteConfig
{
/** @var DIContainer */
private
$container
;
private
$container
;
/** @var IRouter */
private
$router
;
private
$router
;
/** @var array */
private
$routes
;
private
$routes
;
/** @var string */
private
$appName
;
private
$appName
;
/** @var string[] */
private
$controllerNameCache
=
[];
/**
/**
* @param \OC\AppFramework\DependencyInjection\DIContainer $container
* @param \OC\AppFramework\DependencyInjection\DIContainer $container
* @param \OCP\Route\IRouter $router
* @param \OCP\Route\IRouter $router
* @param array $routes
* @internal param $appName
* @internal param $appName
*/
*/
public
function
__construct
(
DIContainer
$container
,
IRouter
$router
,
$routes
)
{
public
function
__construct
(
DIContainer
$container
,
IRouter
$router
,
$routes
)
{
...
@@ -234,7 +245,10 @@ class RouteConfig {
...
@@ -234,7 +245,10 @@ class RouteConfig {
*/
*/
private
function
buildControllerName
(
$controller
)
private
function
buildControllerName
(
$controller
)
{
{
return
$this
->
underScoreToCamelCase
(
ucfirst
(
$controller
))
.
'Controller'
;
if
(
!
isset
(
$this
->
controllerNameCache
[
$controller
]))
{
$this
->
controllerNameCache
[
$controller
]
=
$this
->
underScoreToCamelCase
(
ucfirst
(
$controller
))
.
'Controller'
;
}
return
$this
->
controllerNameCache
[
$controller
];
}
}
/**
/**
...
...
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