Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure you want to rename?
SAFE MODE
/
modules
/
backup
/
vendor
/
backup-manager
/
backup-manager
/
src
/
Compressors
:
GzipCompressor.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace BackupManager\Compressors; /** * Class GzipCompressor * @package BackupManager\Compressors */ class GzipCompressor extends Compressor { /** * @param $type * @return bool */ public function handles($type) { return strtolower($type) == 'gzip'; } /** * @param $inputPath * @return string */ public function getCompressCommandLine($inputPath) { return 'gzip ' . escapeshellarg($inputPath); } /** * @param $outputPath * @return string */ public function getDecompressCommandLine($outputPath) { return 'gzip -d ' . escapeshellarg($outputPath); } /** * @param $inputPath * @return string */ public function getCompressedPath($inputPath) { return $inputPath . '.gz'; } /** * @param $inputPath * @return string */ public function getDecompressedPath($inputPath) { return preg_replace('/.gz$/', '', $inputPath); } }