MediaWiki
REL1_19
|
Public Member Functions | |
__construct ($server=false, $user=false, $password=false, $dbName=false, $flags=0) | |
Constructor. | |
addQuotes ($s) | |
affectedRows () | |
attachDatabase ($name, $file=false, $fname= 'DatabaseSqlite::attachDatabase') | |
Attaches external database to our connection, see http://sqlite.org/lang_attach.html for details. | |
begin ($fname= '') | |
Begin a transaction, committing any previously open transaction. | |
buildConcat ($stringList) | |
Build a concatenation list to feed into a SQL query. | |
buildLike () | |
checkForEnabledSearch () | |
Check if the searchindext table is FTS enabled. | |
close () | |
Close an SQLite database. | |
commit ($fname= '') | |
End a transaction. | |
dataSeek ($res, $row) | |
deadlockLoop () | |
No-op version of deadlockLoop. | |
decodeBlob ($b) | |
duplicateTableStructure ($oldName, $newName, $temporary=false, $fname= 'DatabaseSqlite::duplicateTableStructure') | |
encodeBlob ($b) | |
fetchObject ($res) | |
fetchRow ($res) | |
fieldInfo ($table, $field) | |
Get information about a given field Returns false if the field does not exist. | |
fieldName ($res, $n) | |
freeResult ($res) | |
getSearchEngine () | |
getServerInfo () | |
getServerVersion () | |
getType () | |
implicitGroupby () | |
indexInfo ($table, $index, $fname= 'DatabaseSqlite::indexExists') | |
Returns information about an index Returns false if the index does not exist. | |
indexName ($index) | |
Index names have DB scope. | |
indexUnique ($table, $index, $fname= 'DatabaseSqlite::indexUnique') | |
insert ($table, $a, $fname= 'DatabaseSqlite::insert', $options=array()) | |
Based on generic method (parent) with some prior SQLite-sepcific adjustments. | |
insertId () | |
This must be called after nextSequenceVal. | |
isWriteQuery ($sql) | |
lastErrno () | |
lastError () | |
limitResultForUpdate ($sql, $num) | |
listTables ($prefix=null, $fname= 'DatabaseSqlite::listTables') | |
List all tables on the database. | |
makeInsertOptions ($options) | |
makeSelectOptions ($options) | |
Filter the options used in SELECT statements. | |
makeUpdateOptions ($options) | |
numFields ($res) | |
numRows ($res) | |
The PDO::Statement class implements the array interface so count() will work. | |
open ($server, $user, $pass, $dbName) | |
Open an SQLite database and return a resource handle to it NOTE: only $dbName is used, the other parameters are irrelevant for SQLite databases. | |
openFile ($fileName) | |
Opens a database file. | |
replace ($table, $uniqueIndexes, $rows, $fname= 'DatabaseSqlite::replace') | |
rollback ($fname= '') | |
Rollback a transaction. | |
strencode ($s) | |
tableName ($name, $format= 'quoted') | |
Use MySQL's naming (accounts for prefix etc) but remove surrounding backticks. | |
textFieldSize ($table, $field) | |
Returns the size of a text field, or -1 for "unlimited" In SQLite this is SQLITE_MAX_LENGTH, by default 1GB. | |
unionQueries ($sqls, $all) | |
unionSupportsOrderAndLimit () | |
wasDeadlock () | |
wasErrorReissuable () | |
wasReadOnlyError () | |
Static Public Member Functions | |
static | fixIgnore ($options) |
static | generateFileName ($dir, $dbName) |
Generates a database file name. | |
static | getFulltextSearchModule () |
Returns version of currently supported SQLite fulltext search module or false if none present. | |
static | getSoftwareLink () |
Public Attributes | |
$mAffectedRows | |
$mDatabaseFile | |
$mLastResult | |
$mName | |
Protected Member Functions | |
doQuery ($sql) | |
SQLite doesn't allow buffered results or data seeking etc, so we'll use fetchAll as the result. | |
replaceVars ($s) | |
Protected Attributes | |
$mConn | |
Static Private Attributes | |
static | $fulltextEnabled = null |
Definition at line 13 of file DatabaseSqlite.php.
DatabaseSqlite::__construct | ( | $ | server = false , |
$ | user = false , |
||
$ | password = false , |
||
$ | dbName = false , |
||
$ | flags = 0 |
||
) |
Constructor.
Parameters $server, $user and $password are not used.
$server | string |
$user | string |
$password | string |
$dbName | string |
$flags | int |
Definition at line 36 of file DatabaseSqlite.php.
References $user, $wgSharedDB, attachDatabase(), and open().
DatabaseSqlite::addQuotes | ( | $ | s | ) |
$s | Blob|string |
Reimplemented from DatabaseBase.
Definition at line 698 of file DatabaseSqlite.php.
Referenced by attachDatabase(), duplicateTableStructure(), fieldInfo(), indexInfo(), and strencode().
DatabaseSqlite::attachDatabase | ( | $ | name, |
$ | file = false , |
||
$ | fname = 'DatabaseSqlite::attachDatabase' |
||
) |
Attaches external database to our connection, see http://sqlite.org/lang_attach.html for details.
$name | String: database name to be used in queries like SELECT foo FROM dbname.table |
$file | String: database file name. If omitted, will be generated using $name and $wgSQLiteDataDir |
$fname | String: calling function name |
Definition at line 189 of file DatabaseSqlite.php.
References $file, $fname, $wgSQLiteDataDir, addQuotes(), generateFileName(), and DatabaseBase\query().
Referenced by __construct().
DatabaseSqlite::begin | ( | $ | fname = '' | ) |
Begin a transaction, committing any previously open transaction.
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 634 of file DatabaseSqlite.php.
References commit().
DatabaseSqlite::buildConcat | ( | $ | stringList | ) |
Build a concatenation list to feed into a SQL query.
$stringList | array |
Reimplemented from DatabaseBase.
Definition at line 786 of file DatabaseSqlite.php.
Check if the searchindext table is FTS enabled.
Definition at line 145 of file DatabaseSqlite.php.
References $fulltextEnabled, $res, DatabaseBase\query(), and tableName().
Close an SQLite database.
Reimplemented from DatabaseBase.
Definition at line 122 of file DatabaseSqlite.php.
References commit(), and DatabaseBase\trxLevel().
DatabaseSqlite::commit | ( | $ | fname = '' | ) |
End a transaction.
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 642 of file DatabaseSqlite.php.
Referenced by begin(), and close().
DatabaseSqlite::dataSeek | ( | $ | res, |
$ | row | ||
) |
$res | ResultWrapper |
$row |
Implements DatabaseType.
Definition at line 357 of file DatabaseSqlite.php.
References $res.
No-op version of deadlockLoop.
Reimplemented from DatabaseBase.
Definition at line 727 of file DatabaseSqlite.php.
DatabaseSqlite::decodeBlob | ( | $ | b | ) |
$b | Blob|string |
Reimplemented from DatabaseBase.
Definition at line 687 of file DatabaseSqlite.php.
DatabaseSqlite::doQuery | ( | $ | sql | ) | [protected] |
SQLite doesn't allow buffered results or data seeking etc, so we'll use fetchAll as the result.
$sql | string |
Reimplemented from DatabaseBase.
Definition at line 216 of file DatabaseSqlite.php.
References $res.
DatabaseSqlite::duplicateTableStructure | ( | $ | oldName, |
$ | newName, | ||
$ | temporary = false , |
||
$ | fname = 'DatabaseSqlite::duplicateTableStructure' |
||
) |
MWException |
$oldName | |
$newName | |
$temporary | bool |
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 798 of file DatabaseSqlite.php.
References $fname, $res, DatabaseBase\addIdentifierQuotes(), addQuotes(), fetchObject(), DatabaseBase\query(), and wfDebug().
DatabaseSqlite::encodeBlob | ( | $ | b | ) |
$b |
Reimplemented from DatabaseBase.
Definition at line 679 of file DatabaseSqlite.php.
DatabaseSqlite::fetchObject | ( | $ | res | ) |
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 243 of file DatabaseSqlite.php.
References $res.
Referenced by duplicateTableStructure().
DatabaseSqlite::fetchRow | ( | $ | res | ) |
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 269 of file DatabaseSqlite.php.
References $res.
DatabaseSqlite::fieldInfo | ( | $ | table, |
$ | field | ||
) |
Get information about a given field Returns false if the field does not exist.
Implements DatabaseType.
Definition at line 622 of file DatabaseSqlite.php.
References $res, addQuotes(), DatabaseBase\query(), and tableName().
DatabaseSqlite::fieldName | ( | $ | res, |
$ | n | ||
) |
$res | ResultWrapper |
$n |
Implements DatabaseType.
Definition at line 309 of file DatabaseSqlite.php.
static DatabaseSqlite::fixIgnore | ( | $ | options | ) | [static] |
$options | array |
Definition at line 479 of file DatabaseSqlite.php.
References $options.
Referenced by makeInsertOptions(), and makeUpdateOptions().
DatabaseSqlite::freeResult | ( | $ | res | ) |
$res | ResultWrapper |
Reimplemented from DatabaseBase.
Definition at line 231 of file DatabaseSqlite.php.
References $res.
static DatabaseSqlite::generateFileName | ( | $ | dir, |
$ | dbName | ||
) | [static] |
Generates a database file name.
Explicitly public for installer.
$dir | String: Directory where database resides |
$dbName | String: Database name |
Definition at line 137 of file DatabaseSqlite.php.
Referenced by attachDatabase(), SqliteInstaller\needsUpgrade(), open(), and SqliteInstaller\setupDatabase().
static DatabaseSqlite::getFulltextSearchModule | ( | ) | [static] |
Returns version of currently supported SQLite fulltext search module or false if none present.
Definition at line 162 of file DatabaseSqlite.php.
Referenced by SqliteInstaller\checkPrerequisites(), RebuildTextIndex\execute(), SqliteInstaller\setupSearchIndex(), and SqliteUpdater\sqliteSetupSearchindex().
Reimplemented from DatabaseBase.
Definition at line 612 of file DatabaseSqlite.php.
References getServerVersion(), and wfMsg().
Implements DatabaseType.
Definition at line 604 of file DatabaseSqlite.php.
Referenced by getServerInfo().
static DatabaseSqlite::getSoftwareLink | ( | ) | [static] |
Implements DatabaseType.
Definition at line 597 of file DatabaseSqlite.php.
Reimplemented from DatabaseBase.
Definition at line 60 of file DatabaseSqlite.php.
DatabaseSqlite::indexInfo | ( | $ | table, |
$ | index, | ||
$ | fname = 'DatabaseSqlite::indexExists' |
||
) |
Returns information about an index Returns false if the index does not exist.
Implements DatabaseType.
Definition at line 408 of file DatabaseSqlite.php.
References $fname, $res, addQuotes(), indexName(), and DatabaseBase\query().
DatabaseSqlite::indexName | ( | $ | index | ) |
Index names have DB scope.
$index | string |
Reimplemented from DatabaseBase.
Definition at line 340 of file DatabaseSqlite.php.
Referenced by indexInfo(), and indexUnique().
DatabaseSqlite::indexUnique | ( | $ | table, |
$ | index, | ||
$ | fname = 'DatabaseSqlite::indexUnique' |
||
) |
$table | |
$index | |
$fname | string |
Definition at line 430 of file DatabaseSqlite.php.
References $fname, $options, indexName(), and DatabaseBase\selectRow().
DatabaseSqlite::insert | ( | $ | table, |
$ | a, | ||
$ | fname = 'DatabaseSqlite::insert' , |
||
$ | options = array() |
||
) |
Based on generic method (parent) with some prior SQLite-sepcific adjustments.
Reimplemented from DatabaseBase.
Definition at line 501 of file DatabaseSqlite.php.
References $options.
This must be called after nextSequenceVal.
Implements DatabaseType.
Definition at line 349 of file DatabaseSqlite.php.
DatabaseSqlite::isWriteQuery | ( | $ | sql | ) |
$sql | string |
Reimplemented from DatabaseBase.
Definition at line 205 of file DatabaseSqlite.php.
Implements DatabaseType.
Definition at line 385 of file DatabaseSqlite.php.
Referenced by wasDeadlock(), wasErrorReissuable(), and wasReadOnlyError().
DatabaseSqlite::limitResultForUpdate | ( | $ | sql, |
$ | num | ||
) |
$sql | |
$num |
Reimplemented from DatabaseBase.
Definition at line 663 of file DatabaseSqlite.php.
References DatabaseBase\limitResult().
DatabaseSqlite::listTables | ( | $ | prefix = null , |
$ | fname = 'DatabaseSqlite::listTables' |
||
) |
List all tables on the database.
$prefix | Only show tables with this prefix, e.g. mw_ |
$fname | String: calling function name |
Reimplemented from DatabaseBase.
Definition at line 825 of file DatabaseSqlite.php.
References $result, and DatabaseBase\select().
DatabaseSqlite::makeInsertOptions | ( | $ | options | ) |
$options | array |
Reimplemented from DatabaseBase.
Definition at line 493 of file DatabaseSqlite.php.
References $options, and fixIgnore().
DatabaseSqlite::makeSelectOptions | ( | $ | options | ) |
Filter the options used in SELECT statements.
$options | array |
Reimplemented from DatabaseBase.
Definition at line 457 of file DatabaseSqlite.php.
References $options.
DatabaseSqlite::makeUpdateOptions | ( | $ | options | ) |
$options | array |
Reimplemented from DatabaseBase.
Definition at line 470 of file DatabaseSqlite.php.
References $options, and fixIgnore().
DatabaseSqlite::numFields | ( | $ | res | ) |
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 299 of file DatabaseSqlite.php.
References $res.
DatabaseSqlite::numRows | ( | $ | res | ) |
The PDO::Statement class implements the array interface so count() will work.
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 290 of file DatabaseSqlite.php.
References $res.
DatabaseSqlite::open | ( | $ | server, |
$ | user, | ||
$ | pass, | ||
$ | dbName | ||
) |
Open an SQLite database and return a resource handle to it NOTE: only $dbName is used, the other parameters are irrelevant for SQLite databases.
$server | |
$user | |
$pass | |
$dbName |
Implements DatabaseType.
Definition at line 74 of file DatabaseSqlite.php.
References $wgSQLiteDataDir, generateFileName(), and openFile().
Referenced by __construct().
DatabaseSqlite::openFile | ( | $ | fileName | ) |
Opens a database file.
$fileName | string |
Definition at line 93 of file DatabaseSqlite.php.
References wfDebug().
Referenced by DatabaseSqliteStandalone\__construct(), and open().
DatabaseSqlite::replace | ( | $ | table, |
$ | uniqueIndexes, | ||
$ | rows, | ||
$ | fname = 'DatabaseSqlite::replace' |
||
) |
$table | |
$uniqueIndexes | |
$rows | |
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 528 of file DatabaseSqlite.php.
References $rows, and DatabaseBase\nativeReplace().
DatabaseSqlite::replaceVars | ( | $ | s | ) | [protected] |
$s | string |
Reimplemented from DatabaseBase.
Reimplemented in MockDatabaseSqlite.
Definition at line 737 of file DatabaseSqlite.php.
DatabaseSqlite::rollback | ( | $ | fname = '' | ) |
Rollback a transaction.
No-op on non-transactional databases.
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 650 of file DatabaseSqlite.php.
DatabaseSqlite::strencode | ( | $ | s | ) |
$s | string |
Implements DatabaseType.
Definition at line 671 of file DatabaseSqlite.php.
References addQuotes().
DatabaseSqlite::tableName | ( | $ | name, |
$ | format = 'quoted' |
||
) |
Use MySQL's naming (accounts for prefix etc) but remove surrounding backticks.
$name | |
$format | String |
Reimplemented from DatabaseBase.
Definition at line 325 of file DatabaseSqlite.php.
Referenced by checkForEnabledSearch(), and fieldInfo().
DatabaseSqlite::textFieldSize | ( | $ | table, |
$ | field | ||
) |
Returns the size of a text field, or -1 for "unlimited" In SQLite this is SQLITE_MAX_LENGTH, by default 1GB.
No way to query it though.
Reimplemented from DatabaseBase.
Definition at line 552 of file DatabaseSqlite.php.
DatabaseSqlite::unionQueries | ( | $ | sqls, |
$ | all | ||
) |
$sqls | |
$all |
Reimplemented from DatabaseBase.
Definition at line 568 of file DatabaseSqlite.php.
Reimplemented from DatabaseBase.
Definition at line 576 of file DatabaseSqlite.php.
References lastErrno().
Reimplemented from DatabaseBase.
Definition at line 583 of file DatabaseSqlite.php.
References lastErrno().
Reimplemented from DatabaseBase.
Definition at line 590 of file DatabaseSqlite.php.
References lastErrno().
DatabaseSqlite::$fulltextEnabled = null [static, private] |
Definition at line 15 of file DatabaseSqlite.php.
Referenced by checkForEnabledSearch().
DatabaseSqlite::$mAffectedRows |
Definition at line 17 of file DatabaseSqlite.php.
DatabaseSqlite::$mConn [protected] |
Reimplemented from DatabaseBase.
Definition at line 25 of file DatabaseSqlite.php.
DatabaseSqlite::$mDatabaseFile |
Definition at line 19 of file DatabaseSqlite.php.
DatabaseSqlite::$mLastResult |
Definition at line 18 of file DatabaseSqlite.php.
DatabaseSqlite::$mName |
Definition at line 20 of file DatabaseSqlite.php.