Use different query for SQLite databases.

- Fix: Avoid errors with SQLite database.

Closes #35.
This commit is contained in:
Daniel Kraus
2017-10-16 20:16:33 +02:00
parent f1df4e29f0
commit 9244518b26
2 changed files with 42 additions and 28 deletions

View File

@ -169,9 +169,24 @@ class Config {
*/
public $sameNamespace;
/**
* Caches the global $wgDBtype variable.
* @var string $dbType;
*/
private $dbType;
public $enableConsoleOutput;
public $enableDebugConsoleOutput;
/**
* Determines whether the MediaWiki database is SQLITE by inspecting the
* $wgDBtype variable (which is cached in $this->dbType).
* @return bool True if the database is SQLITE.
*/
public function sqliteDatabase() {
return $this->dbType === 'sqlite';
}
/**
* Constructs a new Config object.
*
@ -197,6 +212,7 @@ class Config {
global $wgLinkTitlesEnableNoTargetMagicWord;
global $wgLinkTitlesCheckRedirect;
global $wgLinkTitlesSpecialPageReloadAfter;
global $wgDBtype;
$this->parseOnEdit = $wgLinkTitlesParseOnEdit;
$this->parseOnRender = $wgLinkTitlesParseOnRender;
$this->preferShortTitles = $wgLinkTitlesPreferShortTitles;
@ -217,5 +233,6 @@ class Config {
$this->specialPageReloadAfter = $wgLinkTitlesSpecialPageReloadAfter;
$this->enableConsoleOutput = false;
$this->enableDebugConsoleOutput = false;
$this->dbType = $wgDBtype;
}
}