diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-26 12:56:54 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-26 12:56:54 +0100 |
commit | 8e28bf012cf1aca75cc1d48fe5f5e3c121fe5b7c (patch) | |
tree | 58ef17f53d64d75cf8815d64c14853bdf45ec467 /lib/private/files.php | |
parent | a2457b5fb9f1ef9fda82afc4cf7dc712d14488c9 (diff) | |
download | nextcloud-server-8e28bf012cf1aca75cc1d48fe5f5e3c121fe5b7c.tar.gz nextcloud-server-8e28bf012cf1aca75cc1d48fe5f5e3c121fe5b7c.zip |
Move constants from GET_TYPE to OC\Files so they can be autoloaded
Diffstat (limited to 'lib/private/files.php')
-rw-r--r-- | lib/private/files.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/private/files.php b/lib/private/files.php index 571d3215caa..98f3c52d6c6 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -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); } |