| 1 | <?php |
||
| 8 | abstract class AbstractCompressor |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param string $type |
||
| 12 | * @return AbstractCompressor |
||
| 13 | * @throws InvalidArgumentException |
||
| 14 | */ |
||
| 15 | public static function create($type) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Returns the command line for compressing the dump file. |
||
| 33 | * |
||
| 34 | * @param string $command |
||
| 35 | * @param bool $pipe |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | abstract public function getCompressingCommand($command, $pipe = true); |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Returns the command line for decompressing the dump file. |
||
| 42 | * |
||
| 43 | * @param string $command MySQL client tool connection string |
||
| 44 | * @param string $fileName Filename (shell argument escaped) |
||
| 45 | * @param bool $pipe |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | abstract public function getDecompressingCommand($command, $fileName, $pipe = true); |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Returns the file name for the compressed dump file. |
||
| 52 | * |
||
| 53 | * @param string $fileName |
||
| 54 | * @param bool $pipe |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | abstract public function getFileName($fileName, $pipe = true); |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Check whether pv is installed |
||
| 61 | * |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | protected function hasPipeViewer() |
||
| 68 | } |
||
| 69 |