| Conditions | 3 |
| Paths | 4 |
| Total Lines | 29 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 3 | public function __construct( |
|
| 28 | array $options, |
||
| 29 | $timeout = 60, |
||
| 30 | $executable = null, |
||
| 31 | ProcessBuilder $processBuilder = null |
||
| 32 | ) { |
||
| 33 | 3 | if (! $executable) { |
|
| 34 | 3 | $executable = '/usr/bin/mysqldump'; |
|
| 35 | } |
||
| 36 | |||
| 37 | 3 | $this->executable = $executable; |
|
| 38 | |||
| 39 | 3 | if (! $processBuilder) { |
|
| 40 | 3 | $processBuilder = new ProcessBuilder(); |
|
| 41 | } |
||
| 42 | |||
| 43 | $processBuilder |
||
| 44 | 3 | ->setTimeout($timeout) |
|
| 45 | 3 | ->setPrefix($this->executable) |
|
| 46 | 3 | ->setArguments(array( |
|
| 47 | 3 | '--user=' . $options['user'], |
|
| 48 | 3 | '--password=' . $options['password'], |
|
| 49 | 3 | '--host=' . $options['host'], |
|
| 50 | 3 | $options['dbname'], |
|
| 51 | )); |
||
| 52 | |||
| 53 | 3 | $this->processBuilder = $processBuilder; |
|
| 54 | |||
| 55 | 3 | } |
|
| 56 | |||
| 75 |