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
13cbd7f5
Commit
13cbd7f5
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
some filesystem fixes
parent
5608aaee
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/files.php
+1
-5
1 addition, 5 deletions
lib/files.php
lib/filestorage.php
+0
-3
0 additions, 3 deletions
lib/filestorage.php
lib/filestorage/local.php
+4
-34
4 additions, 34 deletions
lib/filestorage/local.php
with
5 additions
and
42 deletions
lib/files.php
+
1
−
5
View file @
13cbd7f5
...
...
@@ -222,11 +222,7 @@ class OC_Files {
public
static
function
delete
(
$dir
,
$file
){
if
(
OC_User
::
isLoggedIn
()){
$file
=
$dir
.
'/'
.
$file
;
if
(
OC_Filesystem
::
is_file
(
$file
)){
return
OC_Filesystem
::
unlink
(
$file
);
}
elseif
(
OC_Filesystem
::
is_dir
(
$file
)){
return
OC_Filesystem
::
delTree
(
$file
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/filestorage.php
+
0
−
3
View file @
13cbd7f5
...
...
@@ -50,9 +50,6 @@ class OC_Filestorage{
public
function
fromTmpFile
(
$tmpPath
,
$path
){}
//copy a file from a temporary file, used for cross-storage file actions
public
function
fromUploadedFile
(
$tmpPath
,
$path
){}
//copy a file from a temporary file, used for cross-storage file actions
public
function
getMimeType
(
$path
){}
public
function
delTree
(
$path
){}
public
function
find
(
$path
){}
public
function
getTree
(
$path
){}
public
function
hash
(
$type
,
$path
,
$raw
){}
public
function
free_space
(
$path
){}
public
function
search
(
$query
){}
...
...
This diff is collapsed.
Click to expand it.
lib/filestorage/local.php
+
4
−
34
View file @
13cbd7f5
...
...
@@ -79,9 +79,8 @@ class OC_Filestorage_Local extends OC_Filestorage{
}
}
public
function
unlink
(
$path
){
if
(
$return
=
unlink
(
$this
->
d
atadir
.
$path
)
){
$return
=
$this
->
d
elTree
(
$path
)
;
$this
->
clearFolderSizeCache
(
$path
);
}
return
$return
;
}
public
function
rename
(
$path1
,
$path2
){
...
...
@@ -195,7 +194,8 @@ class OC_Filestorage_Local extends OC_Filestorage{
}
}
public
function
delTree
(
$dir
)
{
private
function
delTree
(
$dir
)
{
error_log
(
'del'
.
$dir
);
$dirRelative
=
$dir
;
$dir
=
$this
->
datadir
.
$dir
;
if
(
!
file_exists
(
$dir
))
return
true
;
...
...
@@ -218,36 +218,6 @@ class OC_Filestorage_Local extends OC_Filestorage{
return
$return
;
}
public
function
find
(
$path
){
$return
=
System
::
find
(
$this
->
datadir
.
$path
);
foreach
(
$return
as
&
$file
){
$file
=
str_replace
(
$file
,
$this
->
datadir
,
''
);
}
return
$return
;
}
public
function
getTree
(
$dir
)
{
if
(
substr
(
$dir
,
-
1
,
1
)
==
'/'
){
$dir
=
substr
(
$dir
,
0
,
-
1
);
}
$tree
=
array
();
$tree
[]
=
$dir
;
$dirRelative
=
$dir
;
$dir
=
$this
->
datadir
.
$dir
;
if
(
!
file_exists
(
$dir
))
return
true
;
foreach
(
scandir
(
$dir
)
as
$item
)
{
if
(
$item
==
'.'
||
$item
==
'..'
)
continue
;
if
(
is_file
(
$dir
.
'/'
.
$item
)){
$tree
[]
=
$dirRelative
.
'/'
.
$item
;
}
elseif
(
is_dir
(
$dir
.
'/'
.
$item
)){
if
(
$subTree
=
$this
->
getTree
(
$dirRelative
.
"/"
.
$item
)){
$tree
=
array_merge
(
$tree
,
$subTree
);
}
}
}
return
$tree
;
}
public
function
hash
(
$type
,
$path
,
$raw
){
return
hash_file
(
$type
,
$this
->
datadir
.
$path
,
$raw
);
}
...
...
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