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
f9bfd48e
Unverified
Commit
f9bfd48e
authored
5 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
switch to Files Node API for zip generation
Signed-off-by:
Arthur Schiwon
<
blizzz@arthur-schiwon.de
>
parent
64bfd4bb
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/legacy/files.php
+15
-4
15 additions, 4 deletions
lib/private/legacy/files.php
with
15 additions
and
4 deletions
lib/private/legacy/files.php
+
15
−
4
View file @
f9bfd48e
...
...
@@ -177,10 +177,21 @@ class OC_Files {
foreach
(
$files
as
$file
)
{
$file
=
$dir
.
'/'
.
$file
;
if
(
\OC\Files\Filesystem
::
is_file
(
$file
))
{
$fileSize
=
\OC\Files\Filesystem
::
filesize
(
$file
);
$fileTime
=
\OC\Files\Filesystem
::
filemtime
(
$file
);
$fh
=
\OC\Files\Filesystem
::
fopen
(
$file
,
'r'
);
$streamer
->
addFileFromStream
(
$fh
,
basename
(
$file
),
$fileSize
,
$fileTime
);
$userFolder
=
\OC
::
$server
->
getRootFolder
()
->
get
(
\OC\Files\Filesystem
::
getRoot
());
$file
=
$userFolder
->
get
(
$file
);
if
(
$file
instanceof
\OC\Files\Node\File
)
{
$fh
=
$file
->
fopen
(
'r'
);
$fileSize
=
$file
->
getSize
();
$fileTime
=
$file
->
getMTime
();
}
else
{
// File is not a file? …
\OC
::
$server
->
getLogger
()
->
debug
(
'File given, but no Node available. Name {file}'
,
[
'app'
=>
'files'
,
'file'
=>
$file
]
);
continue
;
}
$streamer
->
addFileFromStream
(
$fh
,
$file
->
getName
(),
$fileSize
,
$fileTime
);
fclose
(
$fh
);
}
elseif
(
\OC\Files\Filesystem
::
is_dir
(
$file
))
{
$streamer
->
addDirRecursive
(
$file
);
...
...
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