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
4f1bbc4f
Commit
4f1bbc4f
authored
10 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused 2nd parameter of buildPath() and rename to getSourcePath()
parent
20237fba
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/files/storage/mappedlocal.php
+33
-32
33 additions, 32 deletions
lib/private/files/storage/mappedlocal.php
with
33 additions
and
32 deletions
lib/private/files/storage/mappedlocal.php
+
33
−
32
View file @
4f1bbc4f
...
...
@@ -31,7 +31,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public
function
mkdir
(
$path
)
{
return
@
mkdir
(
$this
->
build
Path
(
$path
),
0777
,
true
);
return
@
mkdir
(
$this
->
getSource
Path
(
$path
),
0777
,
true
);
}
public
function
rmdir
(
$path
)
{
...
...
@@ -40,7 +40,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
try
{
$it
=
new
\RecursiveIteratorIterator
(
new
\RecursiveDirectoryIterator
(
$this
->
build
Path
(
$path
)),
new
\RecursiveDirectoryIterator
(
$this
->
getSource
Path
(
$path
)),
\RecursiveIteratorIterator
::
CHILD_FIRST
);
/**
...
...
@@ -64,7 +64,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
$it
->
next
();
}
if
(
$result
=
@
rmdir
(
$this
->
build
Path
(
$path
)))
{
if
(
$result
=
@
rmdir
(
$this
->
getSource
Path
(
$path
)))
{
$this
->
cleanMapper
(
$path
);
}
return
$result
;
...
...
@@ -75,7 +75,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
public
function
opendir
(
$path
)
{
$files
=
array
(
'.'
,
'..'
);
$physicalPath
=
$this
->
build
Path
(
$path
);
$physicalPath
=
$this
->
getSource
Path
(
$path
);
$logicalPath
=
$this
->
mapper
->
physicalToLogic
(
$physicalPath
);
$dh
=
opendir
(
$physicalPath
);
...
...
@@ -101,15 +101,15 @@ class MappedLocal extends \OC\Files\Storage\Common {
if
(
substr
(
$path
,
-
1
)
==
'/'
)
{
$path
=
substr
(
$path
,
0
,
-
1
);
}
return
is_dir
(
$this
->
build
Path
(
$path
));
return
is_dir
(
$this
->
getSource
Path
(
$path
));
}
public
function
is_file
(
$path
)
{
return
is_file
(
$this
->
build
Path
(
$path
));
return
is_file
(
$this
->
getSource
Path
(
$path
));
}
public
function
stat
(
$path
)
{
$fullPath
=
$this
->
build
Path
(
$path
);
$fullPath
=
$this
->
getSource
Path
(
$path
);
$statResult
=
stat
(
$fullPath
);
if
(
PHP_INT_SIZE
===
4
&&
!
$this
->
is_dir
(
$path
))
{
$filesize
=
$this
->
filesize
(
$path
);
...
...
@@ -120,9 +120,9 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public
function
filetype
(
$path
)
{
$filetype
=
filetype
(
$this
->
build
Path
(
$path
));
$filetype
=
filetype
(
$this
->
getSource
Path
(
$path
));
if
(
$filetype
==
'link'
)
{
$filetype
=
filetype
(
realpath
(
$this
->
build
Path
(
$path
)));
$filetype
=
filetype
(
realpath
(
$this
->
getSource
Path
(
$path
)));
}
return
$filetype
;
}
...
...
@@ -131,7 +131,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
if
(
$this
->
is_dir
(
$path
))
{
return
0
;
}
$fullPath
=
$this
->
build
Path
(
$path
);
$fullPath
=
$this
->
getSource
Path
(
$path
);
if
(
PHP_INT_SIZE
===
4
)
{
$helper
=
new
\OC\LargeFileHelper
;
return
$helper
->
getFilesize
(
$fullPath
);
...
...
@@ -140,19 +140,19 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public
function
isReadable
(
$path
)
{
return
is_readable
(
$this
->
build
Path
(
$path
));
return
is_readable
(
$this
->
getSource
Path
(
$path
));
}
public
function
isUpdatable
(
$path
)
{
return
is_writable
(
$this
->
build
Path
(
$path
));
return
is_writable
(
$this
->
getSource
Path
(
$path
));
}
public
function
file_exists
(
$path
)
{
return
file_exists
(
$this
->
build
Path
(
$path
));
return
file_exists
(
$this
->
getSource
Path
(
$path
));
}
public
function
filemtime
(
$path
)
{
return
filemtime
(
$this
->
build
Path
(
$path
));
return
filemtime
(
$this
->
getSource
Path
(
$path
));
}
public
function
touch
(
$path
,
$mtime
=
null
)
{
...
...
@@ -160,23 +160,23 @@ class MappedLocal extends \OC\Files\Storage\Common {
// If mtime is nil the current time is set.
// note that the access time of the file always changes to the current time.
if
(
!
is_null
(
$mtime
))
{
$result
=
touch
(
$this
->
build
Path
(
$path
),
$mtime
);
$result
=
touch
(
$this
->
getSource
Path
(
$path
),
$mtime
);
}
else
{
$result
=
touch
(
$this
->
build
Path
(
$path
));
$result
=
touch
(
$this
->
getSource
Path
(
$path
));
}
if
(
$result
)
{
clearstatcache
(
true
,
$this
->
build
Path
(
$path
));
clearstatcache
(
true
,
$this
->
getSource
Path
(
$path
));
}
return
$result
;
}
public
function
file_get_contents
(
$path
)
{
return
file_get_contents
(
$this
->
build
Path
(
$path
));
return
file_get_contents
(
$this
->
getSource
Path
(
$path
));
}
public
function
file_put_contents
(
$path
,
$data
)
{
return
file_put_contents
(
$this
->
build
Path
(
$path
),
$data
);
return
file_put_contents
(
$this
->
getSource
Path
(
$path
),
$data
);
}
public
function
unlink
(
$path
)
{
...
...
@@ -208,8 +208,8 @@ class MappedLocal extends \OC\Files\Storage\Common {
$this
->
unlink
(
$path2
);
}
$physicPath1
=
$this
->
build
Path
(
$path1
);
$physicPath2
=
$this
->
build
Path
(
$path2
);
$physicPath1
=
$this
->
getSource
Path
(
$path1
);
$physicPath2
=
$this
->
getSource
Path
(
$path2
);
if
(
$return
=
rename
(
$physicPath1
,
$physicPath2
))
{
// mapper needs to create copies or all children
$this
->
copyMapping
(
$path1
,
$path2
);
...
...
@@ -237,7 +237,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
closedir
(
$dir
);
return
true
;
}
else
{
if
(
$return
=
copy
(
$this
->
build
Path
(
$path1
),
$this
->
build
Path
(
$path2
)))
{
if
(
$return
=
copy
(
$this
->
getSource
Path
(
$path1
),
$this
->
getSource
Path
(
$path2
)))
{
$this
->
copyMapping
(
$path1
,
$path2
);
}
return
$return
;
...
...
@@ -245,7 +245,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public
function
fopen
(
$path
,
$mode
)
{
return
fopen
(
$this
->
build
Path
(
$path
),
$mode
);
return
fopen
(
$this
->
getSource
Path
(
$path
),
$mode
);
}
/**
...
...
@@ -256,7 +256,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
private
function
delTree
(
$dir
,
$isLogicPath
=
true
)
{
$dirRelative
=
$dir
;
if
(
$isLogicPath
)
{
$dir
=
$this
->
build
Path
(
$dir
);
$dir
=
$this
->
getSource
Path
(
$dir
);
}
if
(
!
file_exists
(
$dir
))
{
return
true
;
...
...
@@ -288,11 +288,11 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public
function
hash
(
$type
,
$path
,
$raw
=
false
)
{
return
hash_file
(
$type
,
$this
->
build
Path
(
$path
),
$raw
);
return
hash_file
(
$type
,
$this
->
getSource
Path
(
$path
),
$raw
);
}
public
function
free_space
(
$path
)
{
return
@
disk_free_space
(
$this
->
build
Path
(
$path
));
return
@
disk_free_space
(
$this
->
getSource
Path
(
$path
));
}
public
function
search
(
$query
)
{
...
...
@@ -300,11 +300,11 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public
function
getLocalFile
(
$path
)
{
return
$this
->
build
Path
(
$path
);
return
$this
->
getSource
Path
(
$path
);
}
public
function
getLocalFolder
(
$path
)
{
return
$this
->
build
Path
(
$path
);
return
$this
->
getSource
Path
(
$path
);
}
/**
...
...
@@ -312,7 +312,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
*/
protected
function
searchInDir
(
$query
,
$dir
=
''
)
{
$files
=
array
();
$physicalDir
=
$this
->
build
Path
(
$dir
);
$physicalDir
=
$this
->
getSource
Path
(
$dir
);
foreach
(
scandir
(
$physicalDir
)
as
$item
)
{
if
(
$item
==
'.'
||
$item
==
'..'
)
continue
;
...
...
@@ -341,14 +341,15 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
/**
* Get the source path (on disk) of a given path
*
* @param string $path
* @param bool $create
* @return string
*/
pr
ivate
function
build
Path
(
$path
,
$create
=
true
)
{
pr
otected
function
getSource
Path
(
$path
)
{
$path
=
$this
->
stripLeading
(
$path
);
$fullPath
=
$this
->
datadir
.
$path
;
return
$this
->
mapper
->
logicToPhysical
(
$fullPath
,
$creat
e
);
return
$this
->
mapper
->
logicToPhysical
(
$fullPath
,
tru
e
);
}
/**
...
...
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