diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2015-09-24 18:23:10 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-28 11:46:54 +0200 |
commit | 027fb4e3fe44f3ca075c96258afe55438f98dd6c (patch) | |
tree | f09ab1ce63d5893e212fe27be2014207d5498fc9 | |
parent | 28df7be3192560b1b3616b98a5a1f057410ebab0 (diff) | |
download | nextcloud-server-027fb4e3fe44f3ca075c96258afe55438f98dd6c.tar.gz nextcloud-server-027fb4e3fe44f3ca075c96258afe55438f98dd6c.zip |
More corrections
-rw-r--r-- | lib/private/files.php | 4 | ||||
-rw-r--r-- | lib/private/streamer.php | 14 |
2 files changed, 7 insertions, 11 deletions
diff --git a/lib/private/files.php b/lib/private/files.php index 21b3cd1d409..86ebf40cc57 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -151,12 +151,12 @@ class OC_Files { $streamer->addFileFromStream($fh, basename($file), $fileSize); fclose($fh); } elseif (\OC\Files\Filesystem::is_dir($file)) { - $streamer->addDirRecoursive($file); + $streamer->addDirRecursive($file); } } } elseif ($getType === self::ZIP_DIR) { $file = $dir . '/' . $files; - $streamer->addDirRecoursive($file); + $streamer->addDirRecursive($file); } $streamer->finalize(); set_time_limit($executionTime); diff --git a/lib/private/streamer.php b/lib/private/streamer.php index b530961afd2..2502807330b 100644 --- a/lib/private/streamer.php +++ b/lib/private/streamer.php @@ -31,9 +31,6 @@ class Streamer { // streamer instance private $streamerInstance; - /** @var string*/ - private $extension; - public function __construct(){ /** @var \OCP\IRequest */ $request = \OC::$server->getRequest(); @@ -47,12 +44,11 @@ class Streamer { /** * Send HTTP headers - * @param string name - * @return bool + * @param string $name */ public function sendHeaders($name){ $extension = $this->streamerInstance instanceof ZipStreamer ? '.zip' : '.tar'; - return $this->streamerInstance->sendHeaders($name . $extension); + $this->streamerInstance->sendHeaders($name . $extension); } /** @@ -60,13 +56,13 @@ class Streamer { * @param string $dir * @param string $internalDir */ - public function addDirRecoursive($dir, $internalDir='') { + public function addDirRecursive($dir, $internalDir='') { $dirname = basename($dir); $rootDir = $internalDir . $dirname; if (!empty($rootDir)) { $this->streamerInstance->addEmptyDir($rootDir); } - $internalDir.= $dirname .= '/'; + $internalDir .= $dirname . '/'; // prevent absolute dirs $internalDir = ltrim($internalDir, '/'); @@ -80,7 +76,7 @@ class Streamer { $this->addFileFromStream($fh, $internalDir . $filename, $filesize); fclose($fh); }elseif(\OC\Files\Filesystem::is_dir($file)) { - $this->addDirRecoursive($file, $internalDir); + $this->addDirRecursive($file, $internalDir); } } } |