| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class Bzip extends OneFileFormat |
||
| 7 | { |
||
| 8 | const FORMAT_SUFFIX = 'bz2'; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Bzip constructor. |
||
| 12 | * |
||
| 13 | * @param $archiveFileName |
||
| 14 | * |
||
| 15 | * @throws \Exception |
||
| 16 | */ |
||
| 17 | public function __construct($archiveFileName) |
||
| 18 | { |
||
| 19 | parent::__construct($archiveFileName); |
||
| 20 | $this->modificationTime = filemtime($this->fileName); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $fileName |
||
| 25 | * |
||
| 26 | * @return string|false |
||
| 27 | */ |
||
| 28 | public function getFileContent($fileName = null) |
||
| 29 | { |
||
| 30 | return bzdecompress(file_get_contents($this->fileName)); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $fileName |
||
| 35 | * |
||
| 36 | * @return bool|resource|string |
||
| 37 | */ |
||
| 38 | public function getFileResource($fileName = null) |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param $data |
||
| 45 | * |
||
| 46 | * @return mixed|string |
||
| 47 | */ |
||
| 48 | protected static function compressData($data) |
||
| 51 | } |
||
| 52 | } |