1 | <?php |
||
9 | class ConfigBuilder |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $user = ''; |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $host = 'localhost'; |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $port = 3306; |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $password = ''; |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $dbName = ''; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $charset = 'utf8'; |
||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $gtid = ''; |
||
39 | /** |
||
40 | * @var int |
||
41 | */ |
||
42 | private $slaveId = 666; |
||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $binLogFileName = ''; |
||
47 | /** |
||
48 | * @var int |
||
49 | */ |
||
50 | private $binLogPosition = 0; |
||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | private $eventsOnly = []; |
||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | private $eventsIgnore = []; |
||
59 | /** |
||
60 | * @var array |
||
61 | */ |
||
62 | private $tablesOnly = []; |
||
63 | /** |
||
64 | * @var array |
||
65 | */ |
||
66 | private $databasesOnly = []; |
||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | private $mariaDbGtid; |
||
71 | /** |
||
72 | * @var int |
||
73 | */ |
||
74 | private $tableCacheSize = 128; |
||
75 | |||
76 | /** |
||
77 | * @param string $user |
||
78 | * @return ConfigBuilder |
||
79 | */ |
||
80 | public function withUser($user) |
||
86 | |||
87 | /** |
||
88 | * @param string $host |
||
89 | * @return ConfigBuilder |
||
90 | */ |
||
91 | public function withHost($host) |
||
97 | |||
98 | /** |
||
99 | * @param int $port |
||
100 | * @return ConfigBuilder |
||
101 | */ |
||
102 | public function withPort($port) |
||
108 | |||
109 | /** |
||
110 | * @param string $password |
||
111 | * @return ConfigBuilder |
||
112 | */ |
||
113 | public function withPassword($password) |
||
119 | |||
120 | /** |
||
121 | * @param string $dbName |
||
122 | * @return ConfigBuilder |
||
123 | */ |
||
124 | public function withDbName($dbName) |
||
130 | |||
131 | /** |
||
132 | * @param string $charset |
||
133 | * @return ConfigBuilder |
||
134 | */ |
||
135 | public function withCharset($charset) |
||
141 | |||
142 | /** |
||
143 | * @param string $gtid |
||
144 | * @return ConfigBuilder |
||
145 | */ |
||
146 | public function withGtid($gtid) |
||
152 | |||
153 | /** |
||
154 | * @param int $slaveId |
||
155 | * @return ConfigBuilder |
||
156 | */ |
||
157 | public function withSlaveId($slaveId) |
||
163 | |||
164 | /** |
||
165 | * @param string $binLogFileName |
||
166 | * @return ConfigBuilder |
||
167 | */ |
||
168 | public function withBinLogFileName($binLogFileName) |
||
174 | |||
175 | /** |
||
176 | * @param int $binLogPosition |
||
177 | * @return ConfigBuilder |
||
178 | */ |
||
179 | public function withBinLogPosition($binLogPosition) |
||
185 | |||
186 | /** |
||
187 | * @param array $eventsOnly |
||
188 | * @return ConfigBuilder |
||
189 | */ |
||
190 | public function withEventsOnly($eventsOnly) |
||
196 | |||
197 | /** |
||
198 | * @param array $eventsIgnore |
||
199 | * @return ConfigBuilder |
||
200 | */ |
||
201 | public function withEventsIgnore(array $eventsIgnore) |
||
207 | |||
208 | /** |
||
209 | * @param array $tablesOnly |
||
210 | * @return ConfigBuilder |
||
211 | */ |
||
212 | public function withTablesOnly(array $tablesOnly) |
||
218 | |||
219 | /** |
||
220 | * @param array $databasesOnly |
||
221 | * @return ConfigBuilder |
||
222 | */ |
||
223 | public function withDatabasesOnly(array $databasesOnly) |
||
229 | |||
230 | /** |
||
231 | * @param string $mariaDbGtid |
||
232 | * @return ConfigBuilder |
||
233 | */ |
||
234 | public function withMariaDbGtid($mariaDbGtid) |
||
240 | |||
241 | /** |
||
242 | * @param int $tableCacheSize |
||
243 | */ |
||
244 | public function withTableCacheSize($tableCacheSize) |
||
248 | |||
249 | /** |
||
250 | * @return Config |
||
251 | */ |
||
252 | public function build() |
||
273 | } |