Rev 1235 | Rev 1240 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1235 | Rev 1238 | ||
---|---|---|---|
Line 185... | Line 185... | ||
185 | } |
185 | } |
186 | 186 | ||
187 | $this->last_query = $sql; |
187 | $this->last_query = $sql; |
188 | $sql = str_replace('###', OIDplus::baseConfig()->getValue('TABLENAME_PREFIX', ''), $sql); |
188 | $sql = str_replace('###', OIDplus::baseConfig()->getValue('TABLENAME_PREFIX', ''), $sql); |
189 | 189 | ||
190 | if ($this->slangDetectionDone || OIDplus::baseConfig()->exists('FORCE_DBMS_SLANG')) { |
190 | if ($this->slangDetectionDone) { |
191 | $slang = $this->getSlang(); |
191 | $slang = $this->getSlang(); |
192 | if ($slang) { |
192 | if ($slang) { |
193 | $sql = $slang->filterQuery($sql); |
193 | $sql = $slang->filterQuery($sql); |
194 | } |
194 | } |
195 | } |
195 | } |
Line 255... | Line 255... | ||
255 | * @return void |
255 | * @return void |
256 | * @throws OIDplusConfigInitializationException |
256 | * @throws OIDplusConfigInitializationException |
257 | * @throws OIDplusException |
257 | * @throws OIDplusException |
258 | */ |
258 | */ |
259 | private function afterConnectMandatory()/*: void*/ { |
259 | private function afterConnectMandatory()/*: void*/ { |
- | 260 | // In case an auto-detection of the slang is required (for generic providers like PDO or ODBC), |
|
- | 261 | // we must not be inside a transaction, because the detection requires intentionally submitting |
|
- | 262 | // invalid queries to detect the correct DBMS. If we would be inside a transaction, providers like |
|
- | 263 | // PDO would automatically roll-back. Therefore, we detect the slang right at the beginning, |
|
- | 264 | // before any transaction is used. |
|
- | 265 | $this->getSlang(); |
|
- | 266 | ||
260 | // Check if the config table exists. This is important because the database version is stored in it |
267 | // Check if the config table exists. This is important because the database version is stored in it |
261 | $this->initRequireTables(array('config')); |
268 | $this->initRequireTables(array('config')); |
262 | 269 | ||
263 | // Do the database tables need an update? |
270 | // Do the database tables need an update? |
264 | // It is important that we do it immediately after connecting, |
271 | // It is important that we do it immediately after connecting, |
Line 267... | Line 274... | ||
267 | oidplus_dbupdate($this); |
274 | oidplus_dbupdate($this); |
268 | 275 | ||
269 | // Now that our database is up-to-date, we check if database tables are existing |
276 | // Now that our database is up-to-date, we check if database tables are existing |
270 | // without config table, because it was checked above |
277 | // without config table, because it was checked above |
271 | $this->initRequireTables(array('objects', 'asn1id', 'iri', 'ra'/*, 'config'*/)); |
278 | $this->initRequireTables(array('objects', 'asn1id', 'iri', 'ra'/*, 'config'*/)); |
272 | - | ||
273 | // In case an auto-detection of the slang is required (for generic providers like PDO or ODBC), |
- | |
274 | // we must not be inside a transaction, because the detection requires intentionally submitting |
- | |
275 | // invalid queries to detect the correct DBMS. If we would be inside a transaction, providers like |
- | |
276 | // PDO would automatically roll-back. Therefore, we detect the slang right at the beginning, |
- | |
277 | // before any transaction is used. |
- | |
278 | $this->getSlang(); |
- | |
279 | } |
279 | } |
280 | 280 | ||
281 | /** |
281 | /** |
282 | * @param string[] $tableNames |
282 | * @param string[] $tableNames |
283 | * @return void |
283 | * @return void |