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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
b9f820d8
Commit
b9f820d8
authored
Oct 11, 2012
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
normalize paths for dir and statcache in smb stream wrapper
parent
92ddefe5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
3rdparty/smb4php/smb.php
+12
-0
12 additions, 0 deletions
3rdparty/smb4php/smb.php
with
12 additions
and
0 deletions
3rdparty/smb4php/smb.php
+
12
−
0
View file @
b9f820d8
...
@@ -229,6 +229,8 @@ class smb {
...
@@ -229,6 +229,8 @@ class smb {
}
}
function
addstatcache
(
$url
,
$info
)
{
function
addstatcache
(
$url
,
$info
)
{
$url
=
str_replace
(
'//'
,
'/'
,
$url
);
$url
=
rtrim
(
$url
,
'/'
);
global
$__smb_cache
;
global
$__smb_cache
;
$is_file
=
(
strpos
(
$info
[
'attr'
],
'D'
)
===
FALSE
);
$is_file
=
(
strpos
(
$info
[
'attr'
],
'D'
)
===
FALSE
);
$s
=
(
$is_file
)
?
stat
(
'/etc/passwd'
)
:
stat
(
'/tmp'
);
$s
=
(
$is_file
)
?
stat
(
'/etc/passwd'
)
:
stat
(
'/tmp'
);
...
@@ -238,11 +240,15 @@ class smb {
...
@@ -238,11 +240,15 @@ class smb {
}
}
function
getstatcache
(
$url
)
{
function
getstatcache
(
$url
)
{
$url
=
str_replace
(
'//'
,
'/'
,
$url
);
$url
=
rtrim
(
$url
,
'/'
);
global
$__smb_cache
;
global
$__smb_cache
;
return
isset
(
$__smb_cache
[
'stat'
][
$url
])
?
$__smb_cache
[
'stat'
][
$url
]
:
FALSE
;
return
isset
(
$__smb_cache
[
'stat'
][
$url
])
?
$__smb_cache
[
'stat'
][
$url
]
:
FALSE
;
}
}
function
clearstatcache
(
$url
=
''
)
{
function
clearstatcache
(
$url
=
''
)
{
$url
=
str_replace
(
'//'
,
'/'
,
$url
);
$url
=
rtrim
(
$url
,
'/'
);
global
$__smb_cache
;
global
$__smb_cache
;
if
(
$url
==
''
)
$__smb_cache
[
'stat'
]
=
array
();
else
unset
(
$__smb_cache
[
'stat'
][
$url
]);
if
(
$url
==
''
)
$__smb_cache
[
'stat'
]
=
array
();
else
unset
(
$__smb_cache
[
'stat'
][
$url
]);
}
}
...
@@ -358,16 +364,22 @@ class smb_stream_wrapper extends smb {
...
@@ -358,16 +364,22 @@ class smb_stream_wrapper extends smb {
# cache
# cache
function
adddircache
(
$url
,
$content
)
{
function
adddircache
(
$url
,
$content
)
{
$url
=
str_replace
(
'//'
,
'/'
,
$url
);
$url
=
rtrim
(
$url
,
'/'
);
global
$__smb_cache
;
global
$__smb_cache
;
return
$__smb_cache
[
'dir'
][
$url
]
=
$content
;
return
$__smb_cache
[
'dir'
][
$url
]
=
$content
;
}
}
function
getdircache
(
$url
)
{
function
getdircache
(
$url
)
{
$url
=
str_replace
(
'//'
,
'/'
,
$url
);
$url
=
rtrim
(
$url
,
'/'
);
global
$__smb_cache
;
global
$__smb_cache
;
return
isset
(
$__smb_cache
[
'dir'
][
$url
])
?
$__smb_cache
[
'dir'
][
$url
]
:
FALSE
;
return
isset
(
$__smb_cache
[
'dir'
][
$url
])
?
$__smb_cache
[
'dir'
][
$url
]
:
FALSE
;
}
}
function
cleardircache
(
$url
=
''
)
{
function
cleardircache
(
$url
=
''
)
{
$url
=
str_replace
(
'//'
,
'/'
,
$url
);
$url
=
rtrim
(
$url
,
'/'
);
global
$__smb_cache
;
global
$__smb_cache
;
if
(
$url
==
''
){
if
(
$url
==
''
){
$__smb_cache
[
'dir'
]
=
array
();
$__smb_cache
[
'dir'
]
=
array
();
...
...
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