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
8e28bf01
Commit
8e28bf01
authored
10 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Move constants from GET_TYPE to OC\Files so they can be autoloaded
parent
a2457b5f
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.php
+9
-12
9 additions, 12 deletions
lib/private/files.php
with
9 additions
and
12 deletions
lib/private/files.php
+
9
−
12
View file @
8e28bf01
...
...
@@ -24,17 +24,14 @@
// TODO: get rid of this using proper composer packages
require_once
'mcnetic/phpzipstreamer/ZipStreamer.php'
;
class
GET_TYPE
{
const
FILE
=
1
;
const
ZIP_FILES
=
2
;
const
ZIP_DIR
=
3
;
}
/**
* Class for file server access
*
*/
class
OC_Files
{
const
FILE
=
1
;
const
ZIP_FILES
=
2
;
const
ZIP_DIR
=
3
;
/**
* @param string $filename
...
...
@@ -76,7 +73,7 @@ class OC_Files {
}
if
(
is_array
(
$files
))
{
$get_type
=
GET_TYPE
::
ZIP_FILES
;
$get_type
=
self
::
ZIP_FILES
;
$basename
=
basename
(
$dir
);
if
(
$basename
)
{
$name
=
$basename
.
'.zip'
;
...
...
@@ -88,7 +85,7 @@ class OC_Files {
}
else
{
$filename
=
$dir
.
'/'
.
$files
;
if
(
\OC\Files\Filesystem
::
is_dir
(
$dir
.
'/'
.
$files
))
{
$get_type
=
GET_TYPE
::
ZIP_DIR
;
$get_type
=
self
::
ZIP_DIR
;
// downloading root ?
if
(
$files
===
''
)
{
$name
=
'download.zip'
;
...
...
@@ -97,12 +94,12 @@ class OC_Files {
}
}
else
{
$get_type
=
GET_TYPE
::
FILE
;
$get_type
=
self
::
FILE
;
$name
=
$files
;
}
}
if
(
$get_type
===
GET_TYPE
::
FILE
)
{
if
(
$get_type
===
self
::
FILE
)
{
$zip
=
false
;
if
(
$xsendfile
&&
OC_App
::
isEnabled
(
'files_encryption'
))
{
$xsendfile
=
false
;
...
...
@@ -127,7 +124,7 @@ class OC_Files {
if
(
$zip
)
{
$executionTime
=
intval
(
ini_get
(
'max_execution_time'
));
set_time_limit
(
0
);
if
(
$get_type
===
GET_TYPE
::
ZIP_FILES
)
{
if
(
$get_type
===
self
::
ZIP_FILES
)
{
foreach
(
$files
as
$file
)
{
$file
=
$dir
.
'/'
.
$file
;
if
(
\OC\Files\Filesystem
::
is_file
(
$file
))
{
...
...
@@ -138,7 +135,7 @@ class OC_Files {
self
::
zipAddDir
(
$file
,
$zip
);
}
}
}
elseif
(
$get_type
===
GET_TYPE
::
ZIP_DIR
)
{
}
elseif
(
$get_type
===
self
::
ZIP_DIR
)
{
$file
=
$dir
.
'/'
.
$files
;
self
::
zipAddDir
(
$file
,
$zip
);
}
...
...
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