@@ -1458,39 +1458,39 @@ |
||
| 1458 | 1458 | |
| 1459 | 1459 | class CompressGzipstream extends CompressManagerFactory |
| 1460 | 1460 | { |
| 1461 | - private $fileHandler = null; |
|
| 1461 | + private $fileHandler = null; |
|
| 1462 | 1462 | |
| 1463 | - private $compressContext; |
|
| 1463 | + private $compressContext; |
|
| 1464 | 1464 | |
| 1465 | - /** |
|
| 1466 | - * @param string $filename |
|
| 1467 | - */ |
|
| 1468 | - public function open($filename) |
|
| 1469 | - { |
|
| 1465 | + /** |
|
| 1466 | + * @param string $filename |
|
| 1467 | + */ |
|
| 1468 | + public function open($filename) |
|
| 1469 | + { |
|
| 1470 | 1470 | $this->fileHandler = fopen($filename, "wb"); |
| 1471 | 1471 | if (false === $this->fileHandler) { |
| 1472 | - throw new Exception("Output file is not writable"); |
|
| 1472 | + throw new Exception("Output file is not writable"); |
|
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | $this->compressContext = deflate_init(ZLIB_ENCODING_GZIP, array('level' => 9)); |
| 1476 | 1476 | return true; |
| 1477 | - } |
|
| 1477 | + } |
|
| 1478 | 1478 | |
| 1479 | - public function write($str) |
|
| 1480 | - { |
|
| 1479 | + public function write($str) |
|
| 1480 | + { |
|
| 1481 | 1481 | |
| 1482 | 1482 | $bytesWritten = fwrite($this->fileHandler, deflate_add($this->compressContext, $str, ZLIB_NO_FLUSH)); |
| 1483 | 1483 | if (false === $bytesWritten) { |
| 1484 | - throw new Exception("Writting to file failed! Probably, there is no more free space left?"); |
|
| 1484 | + throw new Exception("Writting to file failed! Probably, there is no more free space left?"); |
|
| 1485 | 1485 | } |
| 1486 | 1486 | return $bytesWritten; |
| 1487 | - } |
|
| 1487 | + } |
|
| 1488 | 1488 | |
| 1489 | - public function close() |
|
| 1490 | - { |
|
| 1489 | + public function close() |
|
| 1490 | + { |
|
| 1491 | 1491 | fwrite($this->fileHandler, deflate_add($this->compressContext, '', ZLIB_FINISH)); |
| 1492 | 1492 | return fclose($this->fileHandler); |
| 1493 | - } |
|
| 1493 | + } |
|
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | 1496 | /** |