Code style and doc fix
This commit is contained in:
parent
9999e05660
commit
6577bbe887
|
@ -429,7 +429,8 @@ class View {
|
|||
* @param int $from
|
||||
* @param int $to
|
||||
* @return bool|mixed
|
||||
* @throws \OCP\Files\InvalidPathException, \OCP\Files\UnseekableException
|
||||
* @throws \OCP\Files\InvalidPathException
|
||||
* @throws \OCP\Files\UnseekableException
|
||||
*/
|
||||
public function readfilePart($path, $from, $to) {
|
||||
$this->assertPathLength($path);
|
||||
|
@ -450,10 +451,9 @@ class View {
|
|||
$size = ftell($handle) - $from;
|
||||
return $size;
|
||||
}
|
||||
else {
|
||||
|
||||
throw new \OCP\Files\UnseekableException('fseek error');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,16 +51,16 @@ class OC_Files {
|
|||
const UPLOAD_MIN_LIMIT_BYTES = 1048576; // 1 MiB
|
||||
|
||||
|
||||
private static $MULTIPART_BOUNDARY = '';
|
||||
private static $multipartBoundary = '';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private static function getBoundary() {
|
||||
if (empty(self::$MULTIPART_BOUNDARY)) {
|
||||
self::$MULTIPART_BOUNDARY = md5(mt_rand());
|
||||
if (empty(self::$multipartBoundary)) {
|
||||
self::$multipartBoundary = md5(mt_rand());
|
||||
}
|
||||
return self::$MULTIPART_BOUNDARY;
|
||||
return self::$multipartBoundary;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,7 +101,7 @@ class OC_Files {
|
|||
* @param string $files ; separated list of files to download
|
||||
* @param array $params ; 'head' boolean to only send header of the request ; 'range' http range header
|
||||
*/
|
||||
public static function get($dir, $files, $params = array( 'head' => false )) {
|
||||
public static function get($dir, $files, $params = null) {
|
||||
|
||||
$view = \OC\Files\Filesystem::getView();
|
||||
$getType = self::FILE;
|
||||
|
@ -115,7 +115,7 @@ class OC_Files {
|
|||
if (!is_array($files)) {
|
||||
$filename = $dir . '/' . $files;
|
||||
if (!$view->is_dir($filename)) {
|
||||
self::getSingleFile($view, $dir, $files, $params);
|
||||
self::getSingleFile($view, $dir, $files, is_null($params) ? array() : $params);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,5 +30,6 @@ namespace OCP\Files;
|
|||
|
||||
/**
|
||||
* Exception for seek problem
|
||||
* @since 9.1.0
|
||||
*/
|
||||
class UnseekableException extends \Exception {}
|
||||
|
|
Loading…
Reference in New Issue