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
74d1a9ea
Commit
74d1a9ea
authored
10 years ago
by
Morris Jobke
Browse files
Options
Downloads
Plain Diff
Merge pull request #13235 from owncloud/cache-normalize-path
Cache results of `normalizePath`
parents
49ed2ebb
7e11ca06
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/private/files/filesystem.php
+12
-1
12 additions, 1 deletion
lib/private/files/filesystem.php
with
12 additions
and
1 deletion
lib/private/files/filesystem.php
+
12
−
1
View file @
74d1a9ea
...
...
@@ -47,6 +47,8 @@ class Filesystem {
static
private
$usersSetup
=
array
();
static
private
$normalizedPathCache
=
array
();
/**
* classname which used for hooks handling
* used as signalclass in OC_Hooks::emit()
...
...
@@ -713,6 +715,12 @@ class Filesystem {
* @return string
*/
public
static
function
normalizePath
(
$path
,
$stripTrailingSlash
=
true
,
$isAbsolutePath
=
false
)
{
$cacheKey
=
$path
.
'-'
.
-
$stripTrailingSlash
.
'-'
.
$isAbsolutePath
;
if
(
isset
(
self
::
$normalizedPathCache
[
$cacheKey
]))
{
return
self
::
$normalizedPathCache
[
$cacheKey
];
}
if
(
$path
==
''
)
{
return
'/'
;
}
...
...
@@ -756,7 +764,10 @@ class Filesystem {
//normalize unicode if possible
$path
=
\OC_Util
::
normalizeUnicode
(
$path
);
return
$windows_drive_letter
.
$path
;
$normalizedPath
=
$windows_drive_letter
.
$path
;
self
::
$normalizedPathCache
[
$cacheKey
]
=
$normalizedPath
;
return
$normalizedPath
;
}
/**
...
...
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