| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | class MysqlProcessor extends DbProcessor |
||
| 11 | { |
||
| 12 | |||
| 13 | public $port = 3306; |
||
| 14 | |||
| 15 | public function backup(): void |
||
| 16 | { |
||
| 17 | $mysqldumpPath = $this->module->binaries['mysqldump']; |
||
| 18 | $gzipPath = $this->module->binaries['gzip']; |
||
| 19 | $ionicePath = $this->module->binaries['ionice']; |
||
| 20 | $this->checkBinary($mysqldumpPath); |
||
| 21 | $this->checkBinary($gzipPath); |
||
| 22 | $this->checkBinary($ionicePath); |
||
| 23 | $command = "{$ionicePath} -c{$this->io} {$mysqldumpPath} -h {$this->host} -P {$this->port} -u {$this->username} -p{$this->password} {$this->database} | {$gzipPath} -9 -c > {$this->backupFilePath}"; |
||
| 24 | (exec($command)); |
||
| 25 | if (!file_exists($this->backupFilePath) || filesize($this->backupFilePath) < 100) |
||
| 26 | throw new MysqlDumpException(); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function restore(array $tableNames = []): void |
||
| 39 | } |
||
| 40 | } |
||
| 41 |