@@ -114,8 +114,7 @@ discard block |
||
| 114 | 114 | public function append( $key, $value ) { |
| 115 | 115 | if( array_key_exists( $key, $this->vars )) { |
| 116 | 116 | $this->vars[$key][] = $value; |
| 117 | - } |
|
| 118 | - else{ |
|
| 117 | + } else{ |
|
| 119 | 118 | $this->vars[$key] = array( $value ); |
| 120 | 119 | } |
| 121 | 120 | } |
@@ -130,8 +129,7 @@ discard block |
||
| 130 | 129 | $data = $this->fetchPage(); |
| 131 | 130 | if( $data === false ) { |
| 132 | 131 | return false; |
| 133 | - } |
|
| 134 | - else{ |
|
| 132 | + } else{ |
|
| 135 | 133 | print $data; |
| 136 | 134 | return true; |
| 137 | 135 | } |
@@ -51,13 +51,11 @@ discard block |
||
| 51 | 51 | if ($cache_time > 0) { |
| 52 | 52 | self::setExpiresHeader('PT'.$cache_time.'S'); |
| 53 | 53 | header('Cache-Control: max-age='.$cache_time.', must-revalidate'); |
| 54 | - } |
|
| 55 | - else { |
|
| 54 | + } else { |
|
| 56 | 55 | self::setExpiresHeader(0); |
| 57 | 56 | header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); |
| 58 | 57 | } |
| 59 | - } |
|
| 60 | - else { |
|
| 58 | + } else { |
|
| 61 | 59 | header('Cache-Control: cache'); |
| 62 | 60 | header('Pragma: cache'); |
| 63 | 61 | } |
@@ -228,8 +226,7 @@ discard block |
||
| 228 | 226 | |
| 229 | 227 | self::setContentLengthHeader(filesize($filepath)); |
| 230 | 228 | fpassthru($fp); |
| 231 | - } |
|
| 232 | - else { |
|
| 229 | + } else { |
|
| 233 | 230 | self::setStatus(self::STATUS_NOT_FOUND); |
| 234 | 231 | } |
| 235 | 232 | } |
@@ -83,13 +83,11 @@ discard block |
||
| 83 | 83 | if (count($rangeArray) > 1) { |
| 84 | 84 | $type = 'multipart/byteranges; boundary='.self::getBoundary(); |
| 85 | 85 | // no Content-Length header here |
| 86 | - } |
|
| 87 | - else { |
|
| 86 | + } else { |
|
| 88 | 87 | header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true); |
| 89 | 88 | OC_Response::setContentLengthHeader($rangeArray[0]['to'] - $rangeArray[0]['from'] + 1); |
| 90 | 89 | } |
| 91 | - } |
|
| 92 | - else { |
|
| 90 | + } else { |
|
| 93 | 91 | OC_Response::setContentLengthHeader($fileSize); |
| 94 | 92 | } |
| 95 | 93 | } |
@@ -223,13 +221,11 @@ discard block |
||
| 223 | 221 | if ($minOffset >= $fileSize) { |
| 224 | 222 | break; |
| 225 | 223 | } |
| 226 | - } |
|
| 227 | - elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) { |
|
| 224 | + } elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) { |
|
| 228 | 225 | // case: x- |
| 229 | 226 | $rangeArray[$ind++] = array( 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize ); |
| 230 | 227 | break; |
| 231 | - } |
|
| 232 | - elseif (is_numeric($ranges[1])) { |
|
| 228 | + } elseif (is_numeric($ranges[1])) { |
|
| 233 | 229 | // case: -x |
| 234 | 230 | if ($ranges[1] > $fileSize) { |
| 235 | 231 | $ranges[1] = $fileSize; |
@@ -277,8 +273,7 @@ discard block |
||
| 277 | 273 | try { |
| 278 | 274 | if (count($rangeArray) == 1) { |
| 279 | 275 | $view->readfilePart($filename, $rangeArray[0]['from'], $rangeArray[0]['to']); |
| 280 | - } |
|
| 281 | - else { |
|
| 276 | + } else { |
|
| 282 | 277 | // check if file is seekable (if not throw UnseekableException) |
| 283 | 278 | // we have to check it before body contents |
| 284 | 279 | $view->readfilePart($filename, $rangeArray[0]['size'], $rangeArray[0]['size']); |
@@ -301,8 +296,7 @@ discard block |
||
| 301 | 296 | self::sendHeaders($filename, $name, array()); |
| 302 | 297 | $view->readfile($filename); |
| 303 | 298 | } |
| 304 | - } |
|
| 305 | - else { |
|
| 299 | + } else { |
|
| 306 | 300 | $view->readfile($filename); |
| 307 | 301 | } |
| 308 | 302 | } |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | $fn = $this->l10n->getPluralFormFunction(); |
| 62 | 62 | $id = $fn($this->count); |
| 63 | 63 | $text = $translations[$this->text][$id]; |
| 64 | - } |
|
| 65 | - else{ |
|
| 64 | + } else{ |
|
| 66 | 65 | $text = $translations[$this->text]; |
| 67 | 66 | } |
| 68 | 67 | } |
@@ -128,10 +128,10 @@ |
||
| 128 | 128 | if ($signalClass) { |
| 129 | 129 | if ($signalName) { |
| 130 | 130 | self::$registered[$signalClass][$signalName]=array(); |
| 131 | - }else{ |
|
| 131 | + } else{ |
|
| 132 | 132 | self::$registered[$signalClass]=array(); |
| 133 | 133 | } |
| 134 | - }else{ |
|
| 134 | + } else{ |
|
| 135 | 135 | self::$registered=array(); |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -271,8 +271,9 @@ |
||
| 271 | 271 | } |
| 272 | 272 | foreach ($dirs as $dir) { |
| 273 | 273 | foreach ($exts as $ext) { |
| 274 | - if ($check_fn("$dir/$name" . $ext)) |
|
| 275 | - return true; |
|
| 274 | + if ($check_fn("$dir/$name" . $ext)) { |
|
| 275 | + return true; |
|
| 276 | + } |
|
| 276 | 277 | } |
| 277 | 278 | } |
| 278 | 279 | return false; |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | $fh = \OC\Files\Filesystem::fopen($file, 'r'); |
| 81 | 81 | $this->addFileFromStream($fh, $internalDir . $filename, $filesize, $fileTime); |
| 82 | 82 | fclose($fh); |
| 83 | - }elseif(\OC\Files\Filesystem::is_dir($file)) { |
|
| 83 | + } elseif(\OC\Files\Filesystem::is_dir($file)) { |
|
| 84 | 84 | $this->addDirRecursive($file, $internalDir); |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -75,8 +75,7 @@ |
||
| 75 | 75 | $whence = SEEK_SET; |
| 76 | 76 | $offset = $this->stream_tell() + $offset; |
| 77 | 77 | $this->limit += $oldOffset - $offset; |
| 78 | - } |
|
| 79 | - else if ($whence === SEEK_SET) { |
|
| 78 | + } else if ($whence === SEEK_SET) { |
|
| 80 | 79 | $this->limit += $this->stream_tell() - $offset; |
| 81 | 80 | } else { |
| 82 | 81 | $this->limit -= $offset; |
@@ -90,8 +90,11 @@ |
||
| 90 | 90 | if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { |
| 91 | 91 | $host = $params['host']; |
| 92 | 92 | //remove leading http[s], will be generated in createBaseUri() |
| 93 | - if (substr($host, 0, 8) == "https://") $host = substr($host, 8); |
|
| 94 | - else if (substr($host, 0, 7) == "http://") $host = substr($host, 7); |
|
| 93 | + if (substr($host, 0, 8) == "https://") { |
|
| 94 | + $host = substr($host, 8); |
|
| 95 | + } else if (substr($host, 0, 7) == "http://") { |
|
| 96 | + $host = substr($host, 7); |
|
| 97 | + } |
|
| 95 | 98 | $this->host = $host; |
| 96 | 99 | $this->user = $params['user']; |
| 97 | 100 | $this->password = $params['password']; |