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 $charset = 'utf8'; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $gtid = ''; |
||
35 | /** |
||
36 | * @var int |
||
37 | */ |
||
38 | private $slaveId = 666; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $binLogFileName = ''; |
||
43 | /** |
||
44 | * @var int |
||
45 | */ |
||
46 | private $binLogPosition = 0; |
||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | private $eventsOnly = []; |
||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | private $eventsIgnore = []; |
||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | private $tablesOnly = []; |
||
59 | /** |
||
60 | * @var array |
||
61 | */ |
||
62 | private $databasesOnly = []; |
||
63 | /** |
||
64 | * @var string |
||
65 | */ |
||
66 | private $mariaDbGtid; |
||
67 | /** |
||
68 | * @var int |
||
69 | */ |
||
70 | private $tableCacheSize = 128; |
||
71 | |||
72 | /** |
||
73 | * @param string $user |
||
74 | * @return ConfigBuilder |
||
75 | */ |
||
76 | public function withUser($user) |
||
82 | |||
83 | /** |
||
84 | * @param string $host |
||
85 | * @return ConfigBuilder |
||
86 | */ |
||
87 | public function withHost($host) |
||
93 | |||
94 | /** |
||
95 | * @param int $port |
||
96 | * @return ConfigBuilder |
||
97 | */ |
||
98 | public function withPort($port) |
||
104 | |||
105 | /** |
||
106 | * @param string $password |
||
107 | * @return ConfigBuilder |
||
108 | */ |
||
109 | public function withPassword($password) |
||
115 | |||
116 | /** |
||
117 | * @param string $charset |
||
118 | * @return ConfigBuilder |
||
119 | */ |
||
120 | public function withCharset($charset) |
||
126 | |||
127 | /** |
||
128 | * @param string $gtid |
||
129 | * @return ConfigBuilder |
||
130 | */ |
||
131 | public function withGtid($gtid) |
||
137 | |||
138 | /** |
||
139 | * @param int $slaveId |
||
140 | * @return ConfigBuilder |
||
141 | */ |
||
142 | public function withSlaveId($slaveId) |
||
148 | |||
149 | /** |
||
150 | * @param string $binLogFileName |
||
151 | * @return ConfigBuilder |
||
152 | */ |
||
153 | public function withBinLogFileName($binLogFileName) |
||
159 | |||
160 | /** |
||
161 | * @param int $binLogPosition |
||
162 | * @return ConfigBuilder |
||
163 | */ |
||
164 | public function withBinLogPosition($binLogPosition) |
||
170 | |||
171 | /** |
||
172 | * @param array $eventsOnly |
||
173 | * @return ConfigBuilder |
||
174 | */ |
||
175 | public function withEventsOnly(array $eventsOnly) |
||
181 | |||
182 | /** |
||
183 | * @param array $eventsIgnore |
||
184 | * @return ConfigBuilder |
||
185 | */ |
||
186 | public function withEventsIgnore(array $eventsIgnore) |
||
192 | |||
193 | /** |
||
194 | * @param array $tablesOnly |
||
195 | * @return ConfigBuilder |
||
196 | */ |
||
197 | public function withTablesOnly(array $tablesOnly) |
||
203 | |||
204 | /** |
||
205 | * @param array $databasesOnly |
||
206 | * @return ConfigBuilder |
||
207 | */ |
||
208 | public function withDatabasesOnly(array $databasesOnly) |
||
214 | |||
215 | /** |
||
216 | * @param string $mariaDbGtid |
||
217 | * @return ConfigBuilder |
||
218 | */ |
||
219 | public function withMariaDbGtid($mariaDbGtid) |
||
225 | |||
226 | /** |
||
227 | * @param int $tableCacheSize |
||
228 | */ |
||
229 | public function withTableCacheSize($tableCacheSize) |
||
233 | |||
234 | /** |
||
235 | * @return Config |
||
236 | */ |
||
237 | public function build() |
||
257 | } |