1 | <?php |
||
21 | class Innobackupex extends Abstraction implements Executable |
||
22 | { |
||
23 | /** |
||
24 | * MySQL data directory |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $dataDir; |
||
29 | |||
30 | /** |
||
31 | * Dump directory |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $dumpDir; |
||
36 | |||
37 | /** |
||
38 | * Host to connect to |
||
39 | * --host <hostname> |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $host; |
||
44 | |||
45 | /** |
||
46 | * User to connect with |
||
47 | * --user <username> |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $user; |
||
52 | |||
53 | /** |
||
54 | * Password to authenticate with |
||
55 | * --password <password> |
||
56 | * |
||
57 | * @var string |
||
58 | */ |
||
59 | private $password; |
||
60 | |||
61 | /** |
||
62 | * Regular expression matching the tables to be backed up. |
||
63 | * The regex should match the full qualified name: myDatabase.myTable |
||
64 | * --tables string |
||
65 | * |
||
66 | * @var string |
||
67 | */ |
||
68 | private $include; |
||
69 | |||
70 | /** |
||
71 | * List of databases and/or tables to backup |
||
72 | * Tables must e fully qualified: myDatabase.myTable |
||
73 | * --databases array of strings |
||
74 | * |
||
75 | * @var array |
||
76 | */ |
||
77 | 10 | private $databases; |
|
78 | |||
79 | 10 | /** |
|
80 | 10 | * Constructor. |
|
81 | 10 | * |
|
82 | * @param string $path |
||
83 | */ |
||
84 | public function __construct($path = null) |
||
89 | 9 | ||
90 | /** |
||
91 | 9 | * Set MySQL data dir. |
|
92 | 9 | * |
|
93 | * @param string $path |
||
94 | * @return \phpbu\App\Cli\Executable\Innobackupex |
||
95 | */ |
||
96 | public function dumpFrom($path) |
||
101 | 3 | ||
102 | /** |
||
103 | 3 | * Set target dump dir. |
|
104 | 3 | * |
|
105 | * @param string $path |
||
106 | * @return \phpbu\App\Cli\Executable\Innobackupex |
||
107 | */ |
||
108 | public function dumpTo($path) |
||
113 | |||
114 | 4 | /** |
|
115 | * Set host du connect to. |
||
116 | 4 | * |
|
117 | 4 | * @param string $host |
|
118 | 4 | * @return \phpbu\App\Cli\Executable\Innobackupex |
|
119 | */ |
||
120 | public function useHost($host) |
||
125 | |||
126 | /** |
||
127 | 3 | * Set mysql credentials. |
|
128 | * |
||
129 | 3 | * @param string $user |
|
130 | 3 | * @param string $password |
|
131 | * @return \phpbu\App\Cli\Executable\Innobackupex |
||
132 | */ |
||
133 | public function credentials($user = null, $password = null) |
||
139 | 3 | ||
140 | /** |
||
141 | 3 | * Set include option |
|
142 | 3 | * |
|
143 | * @param string $include |
||
144 | * @return \phpbu\App\Cli\Executable\Innobackupex |
||
145 | */ |
||
146 | public function including($include) |
||
151 | 10 | ||
152 | /** |
||
153 | 10 | * Set databases to dump. |
|
154 | 1 | * |
|
155 | * @param array $databases |
||
156 | 9 | * @return \phpbu\App\Cli\Executable\Innobackupex |
|
157 | 9 | */ |
|
158 | 9 | public function dumpDatabases(array $databases) |
|
163 | 9 | ||
164 | 8 | /** |
|
165 | 8 | * Subclass Process generator. |
|
166 | * |
||
167 | 8 | * @return \phpbu\App\Cli\Process |
|
168 | * @throws \phpbu\App\Exception |
||
169 | 9 | */ |
|
170 | 9 | public function createProcess() |
|
207 | } |
||
208 |