@@ 131-134 (lines=4) @@ | ||
128 | */ |
|
129 | public function validate() |
|
130 | { |
|
131 | if (!empty($this->user) && false === is_string($this->user)) |
|
132 | { |
|
133 | throw new ConfigException(ConfigException::USER_ERROR_MESSAGE, ConfigException::USER_ERROR_CODE); |
|
134 | } |
|
135 | if (!empty($this->host)) |
|
136 | { |
|
137 | $ip = gethostbyname($this->host); |
|
@@ 151-154 (lines=4) @@ | ||
148 | { |
|
149 | throw new ConfigException(ConfigException::PASSWORD_ERROR_MESSAGE, ConfigException::PASSWORD_ERROR_CODE); |
|
150 | } |
|
151 | if (!empty($this->dbName) && false === is_string($this->dbName)) |
|
152 | { |
|
153 | throw new ConfigException(ConfigException::DB_NAME_ERROR_MESSAGE, ConfigException::DB_NAME_ERROR_CODE); |
|
154 | } |
|
155 | if (!empty($this->charset) && false === is_string($this->charset)) |
|
156 | { |
|
157 | throw new ConfigException(ConfigException::CHARSET_ERROR_MESSAGE, ConfigException::CHARSET_ERROR_CODE); |
|
@@ 155-158 (lines=4) @@ | ||
152 | { |
|
153 | throw new ConfigException(ConfigException::DB_NAME_ERROR_MESSAGE, ConfigException::DB_NAME_ERROR_CODE); |
|
154 | } |
|
155 | if (!empty($this->charset) && false === is_string($this->charset)) |
|
156 | { |
|
157 | throw new ConfigException(ConfigException::CHARSET_ERROR_MESSAGE, ConfigException::CHARSET_ERROR_CODE); |
|
158 | } |
|
159 | if (!empty($this->gtid) && false === is_string($this->gtid)) |
|
160 | { |
|
161 | foreach (explode(',', $this->gtid) as $gtid) |
|
@@ 173-176 (lines=4) @@ | ||
170 | { |
|
171 | throw new ConfigException(ConfigException::SLAVE_ID_ERROR_MESSAGE, ConfigException::SLAVE_ID_ERROR_CODE); |
|
172 | } |
|
173 | if (!empty($this->binLogFileName) && false === is_string($this->binLogFileName)) |
|
174 | { |
|
175 | throw new ConfigException(ConfigException::BIN_LOG_FILE_NAME_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_NAME_ERROR_CODE); |
|
176 | } |
|
177 | if (!empty($this->binLogPosition) && false === filter_var($this->binLogPosition, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) |
|
178 | { |
|
179 | throw new ConfigException(ConfigException::BIN_LOG_FILE_POSITION_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_POSITION_ERROR_CODE); |
|
@@ 181-184 (lines=4) @@ | ||
178 | { |
|
179 | throw new ConfigException(ConfigException::BIN_LOG_FILE_POSITION_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_POSITION_ERROR_CODE); |
|
180 | } |
|
181 | if (!empty($this->mariaDbGtid) && false === is_string($this->mariaDbGtid)) |
|
182 | { |
|
183 | throw new ConfigException(ConfigException::MARIADBGTID_ERROR_MESSAGE, ConfigException::MARIADBGTID_ERROR_CODE); |
|
184 | } |
|
185 | } |
|
186 | ||
187 | /** |