Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
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 | } |
||
41 |