@@ 138-141 (lines=4) @@ | ||
135 | */ |
|
136 | public function validate() |
|
137 | { |
|
138 | if (!empty($this->user) && false === is_string($this->user)) |
|
139 | { |
|
140 | throw new ConfigException(ConfigException::USER_ERROR_MESSAGE, ConfigException::USER_ERROR_CODE); |
|
141 | } |
|
142 | if (!empty($this->host)) |
|
143 | { |
|
144 | $ip = gethostbyname($this->host); |
|
@@ 158-161 (lines=4) @@ | ||
155 | { |
|
156 | throw new ConfigException(ConfigException::PASSWORD_ERROR_MESSAGE, ConfigException::PASSWORD_ERROR_CODE); |
|
157 | } |
|
158 | if (!empty($this->dbName) && false === is_string($this->dbName)) |
|
159 | { |
|
160 | throw new ConfigException(ConfigException::DB_NAME_ERROR_MESSAGE, ConfigException::DB_NAME_ERROR_CODE); |
|
161 | } |
|
162 | if (!empty($this->charset) && false === is_string($this->charset)) |
|
163 | { |
|
164 | throw new ConfigException(ConfigException::CHARSET_ERROR_MESSAGE, ConfigException::CHARSET_ERROR_CODE); |
|
@@ 162-165 (lines=4) @@ | ||
159 | { |
|
160 | throw new ConfigException(ConfigException::DB_NAME_ERROR_MESSAGE, ConfigException::DB_NAME_ERROR_CODE); |
|
161 | } |
|
162 | if (!empty($this->charset) && false === is_string($this->charset)) |
|
163 | { |
|
164 | throw new ConfigException(ConfigException::CHARSET_ERROR_MESSAGE, ConfigException::CHARSET_ERROR_CODE); |
|
165 | } |
|
166 | if (!empty($this->gtid) && false === is_string($this->gtid)) |
|
167 | { |
|
168 | foreach (explode(',', $this->gtid) as $gtid) |
|
@@ 180-183 (lines=4) @@ | ||
177 | { |
|
178 | throw new ConfigException(ConfigException::SLAVE_ID_ERROR_MESSAGE, ConfigException::SLAVE_ID_ERROR_CODE); |
|
179 | } |
|
180 | if (!empty($this->binLogFileName) && false === is_string($this->binLogFileName)) |
|
181 | { |
|
182 | throw new ConfigException(ConfigException::BIN_LOG_FILE_NAME_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_NAME_ERROR_CODE); |
|
183 | } |
|
184 | if (!empty($this->binLogPosition) && false === filter_var($this->binLogPosition, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) |
|
185 | { |
|
186 | throw new ConfigException(ConfigException::BIN_LOG_FILE_POSITION_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_POSITION_ERROR_CODE); |
|
@@ 188-191 (lines=4) @@ | ||
185 | { |
|
186 | throw new ConfigException(ConfigException::BIN_LOG_FILE_POSITION_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_POSITION_ERROR_CODE); |
|
187 | } |
|
188 | if (!empty($this->mariaDbGtid) && false === is_string($this->mariaDbGtid)) |
|
189 | { |
|
190 | throw new ConfigException(ConfigException::MARIADBGTID_ERROR_MESSAGE, ConfigException::MARIADBGTID_ERROR_CODE); |
|
191 | } |
|
192 | if (false === filter_var($this->tableCacheSize, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) |
|
193 | { |
|
194 | throw new ConfigException(ConfigException::TABLE_CACHE_SIZE_ERROR_MESSAGE, ConfigException::TABLE_CACHE_SIZE_ERROR_CODE); |