1 | <?php |
||
8 | abstract class DbDumper |
||
9 | { |
||
10 | protected $dbName; |
||
11 | protected $userName; |
||
12 | protected $password; |
||
13 | protected $host = 'localhost'; |
||
14 | protected $port = 0; |
||
15 | protected $dumpBinaryPath = ''; |
||
16 | |||
17 | public static function create() |
||
21 | |||
22 | /** |
||
23 | * Dump the contents of the database to the given file. |
||
24 | * |
||
25 | * @param string $dumpFile |
||
26 | */ |
||
27 | abstract public function dumpToFile($dumpFile); |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | public function getDbName() |
||
36 | |||
37 | /** |
||
38 | * @param string $dbName |
||
39 | */ |
||
40 | public function setDbName($dbName) |
||
46 | |||
47 | /** |
||
48 | * @param string $userName |
||
49 | * |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function setUserName($userName) |
||
58 | |||
59 | /** |
||
60 | * @param string $password |
||
61 | * |
||
62 | * @return $this |
||
63 | */ |
||
64 | public function setPassword($password) |
||
70 | |||
71 | /** |
||
72 | * @param string $host |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function setHost($host) |
||
82 | |||
83 | /** |
||
84 | * @param int $port |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function setPort($port) |
||
94 | |||
95 | /** |
||
96 | * @param string $dumpBinaryPath |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function setDumpBinaryPath($dumpBinaryPath) |
||
110 | |||
111 | /** |
||
112 | * @param \Symfony\Component\Process\Process $process |
||
113 | * @param string $outputFile |
||
114 | * |
||
115 | * @return bool |
||
116 | * |
||
117 | * @throws \Spatie\DbDumper\Exceptions\DumpFailed |
||
118 | */ |
||
119 | protected function checkIfDumpWasSuccessFul(Process $process, $outputFile) |
||
135 | } |
||
136 |