MediaWiki
REL1_21
|
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. | |
buildConcat ($stringList) | |
Build a concatenation list to feed into a SQL query. | |
buildLike () | |
checkForEnabledSearch () | |
Check if the searchindext table is FTS enabled. | |
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 () | |
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') | |
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 | |
closeConnection () | |
Does not actually close the connection, just destroys the reference for GC to do its work. | |
doBegin ($fname= '') | |
Issues the BEGIN command to the database server. | |
doCommit ($fname= '') | |
Issues the COMMIT command to the database server. | |
doQuery ($sql) | |
SQLite doesn't allow buffered results or data seeking etc, so we'll use fetchAll as the result. | |
doRollback ($fname= '') | |
Issues the ROLLBACK command to the database server. | |
replaceVars ($s) | |
Protected Attributes | |
PDO | $mConn |
Static Private Attributes | |
static | $fulltextEnabled = null |
Definition at line 28 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 50 of file DatabaseSqlite.php.
DatabaseSqlite::addQuotes | ( | $ | s | ) |
$s | Blob|string |
Reimplemented from DatabaseBase.
Definition at line 706 of file DatabaseSqlite.php.
DatabaseSqlite::attachDatabase | ( | $ | name, |
$ | file = false , |
||
$ | fname = 'DatabaseSqlite::attachDatabase' |
||
) |
Attaches external database to our connection, see http://sqlite.org/lang_attach.html for details.
string | $name | database name to be used in queries like SELECT foo FROM dbname.table |
string | $file | database file name. If omitted, will be generated using $name and $wgSQLiteDataDir |
string | $fname | calling function name |
Definition at line 202 of file DatabaseSqlite.php.
DatabaseSqlite::buildConcat | ( | $ | stringList | ) |
Build a concatenation list to feed into a SQL query.
$stringList | array |
Reimplemented from DatabaseBase.
Definition at line 803 of file DatabaseSqlite.php.
Check if the searchindext table is FTS enabled.
Definition at line 158 of file DatabaseSqlite.php.
DatabaseSqlite::closeConnection | ( | ) | [protected] |
Does not actually close the connection, just destroys the reference for GC to do its work.
Reimplemented from DatabaseBase.
Definition at line 139 of file DatabaseSqlite.php.
DatabaseSqlite::dataSeek | ( | $ | res, |
$ | row | ||
) |
$res | ResultWrapper |
$row |
Implements DatabaseType.
Definition at line 371 of file DatabaseSqlite.php.
No-op version of deadlockLoop.
Reimplemented from DatabaseBase.
Definition at line 744 of file DatabaseSqlite.php.
DatabaseSqlite::decodeBlob | ( | $ | b | ) |
$b | Blob|string |
Reimplemented from DatabaseBase.
Definition at line 695 of file DatabaseSqlite.php.
DatabaseSqlite::doBegin | ( | $ | fname = '' | ) | [protected] |
Issues the BEGIN command to the database server.
type | $fname |
Reimplemented from DatabaseBase.
Definition at line 651 of file DatabaseSqlite.php.
References DatabaseBase\commit().
DatabaseSqlite::doCommit | ( | $ | fname = '' | ) | [protected] |
Issues the COMMIT command to the database server.
type | $fname |
Reimplemented from DatabaseBase.
Definition at line 659 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 229 of file DatabaseSqlite.php.
DatabaseSqlite::doRollback | ( | $ | fname = '' | ) | [protected] |
Issues the ROLLBACK command to the database server.
type | $fname |
Reimplemented from DatabaseBase.
Definition at line 667 of file DatabaseSqlite.php.
DatabaseSqlite::duplicateTableStructure | ( | $ | oldName, |
$ | newName, | ||
$ | temporary = false , |
||
$ | fname = 'DatabaseSqlite::duplicateTableStructure' |
||
) |
MWException |
$oldName | |
$newName | |
$temporary | bool |
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 815 of file DatabaseSqlite.php.
DatabaseSqlite::encodeBlob | ( | $ | b | ) |
$b |
Reimplemented from DatabaseBase.
Definition at line 687 of file DatabaseSqlite.php.
DatabaseSqlite::fetchObject | ( | $ | res | ) |
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 256 of file DatabaseSqlite.php.
DatabaseSqlite::fetchRow | ( | $ | res | ) |
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 282 of file DatabaseSqlite.php.
DatabaseSqlite::fieldInfo | ( | $ | table, |
$ | field | ||
) |
Get information about a given field Returns false if the field does not exist.
$table | string |
$field | string |
Implements DatabaseType.
Definition at line 639 of file DatabaseSqlite.php.
DatabaseSqlite::fieldName | ( | $ | res, |
$ | n | ||
) |
$res | ResultWrapper |
$n |
Implements DatabaseType.
Definition at line 322 of file DatabaseSqlite.php.
static DatabaseSqlite::fixIgnore | ( | $ | options | ) | [static] |
DatabaseSqlite::freeResult | ( | $ | res | ) |
$res | ResultWrapper |
Reimplemented from DatabaseBase.
Definition at line 244 of file DatabaseSqlite.php.
static DatabaseSqlite::generateFileName | ( | $ | dir, |
$ | dbName | ||
) | [static] |
Generates a database file name.
Explicitly public for installer.
string | $dir | Directory where database resides |
string | $dbName | Database name |
Definition at line 150 of file DatabaseSqlite.php.
static DatabaseSqlite::getFulltextSearchModule | ( | ) | [static] |
Returns version of currently supported SQLite fulltext search module or false if none present.
Definition at line 175 of file DatabaseSqlite.php.
Referenced by RebuildTextIndex\execute(), and SqliteUpdater\sqliteSetupSearchindex().
Reimplemented from DatabaseBase.
Definition at line 627 of file DatabaseSqlite.php.
Implements DatabaseType.
Definition at line 619 of file DatabaseSqlite.php.
static DatabaseSqlite::getSoftwareLink | ( | ) | [static] |
Implements DatabaseType.
Definition at line 612 of file DatabaseSqlite.php.
Reimplemented from DatabaseBase.
Definition at line 74 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 422 of file DatabaseSqlite.php.
DatabaseSqlite::indexName | ( | $ | index | ) |
Index names have DB scope.
$index | string |
Reimplemented from DatabaseBase.
Definition at line 353 of file DatabaseSqlite.php.
DatabaseSqlite::indexUnique | ( | $ | table, |
$ | index, | ||
$ | fname = 'DatabaseSqlite::indexUnique' |
||
) |
$table | |
$index | |
$fname | string |
Definition at line 444 of file DatabaseSqlite.php.
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 516 of file DatabaseSqlite.php.
This must be called after nextSequenceVal.
Implements DatabaseType.
Definition at line 362 of file DatabaseSqlite.php.
DatabaseSqlite::isWriteQuery | ( | $ | sql | ) |
$sql | string |
Reimplemented from DatabaseBase.
Definition at line 218 of file DatabaseSqlite.php.
DatabaseSqlite::listTables | ( | $ | prefix = null , |
$ | fname = 'DatabaseSqlite::listTables' |
||
) |
List all tables on the database.
string | $prefix | Only show tables with this prefix, e.g. mw_ |
string | $fname | calling function name |
Reimplemented from DatabaseBase.
Definition at line 841 of file DatabaseSqlite.php.
DatabaseSqlite::makeInsertOptions | ( | $ | options | ) |
$options | array |
Reimplemented from DatabaseBase.
Definition at line 507 of file DatabaseSqlite.php.
DatabaseSqlite::makeSelectOptions | ( | $ | options | ) |
Filter the options used in SELECT statements.
$options | array |
Reimplemented from DatabaseBase.
Definition at line 471 of file DatabaseSqlite.php.
DatabaseSqlite::makeUpdateOptions | ( | $ | options | ) |
$options | array |
Reimplemented from DatabaseBase.
Definition at line 484 of file DatabaseSqlite.php.
DatabaseSqlite::numFields | ( | $ | res | ) |
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 312 of file DatabaseSqlite.php.
DatabaseSqlite::numRows | ( | $ | res | ) |
The PDO::Statement class implements the array interface so count() will work.
$res | ResultWrapper |
Implements DatabaseType.
Definition at line 303 of file DatabaseSqlite.php.
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.
string | $server | |
string | $user | |
string | $pass | |
string | $dbName |
DBConnectionError |
Implements DatabaseType.
Definition at line 89 of file DatabaseSqlite.php.
DatabaseSqlite::openFile | ( | $ | fileName | ) |
Opens a database file.
$fileName | string |
DBConnectionError |
Definition at line 109 of file DatabaseSqlite.php.
Referenced by DatabaseSqliteStandalone\__construct().
DatabaseSqlite::replace | ( | $ | table, |
$ | uniqueIndexes, | ||
$ | rows, | ||
$ | fname = 'DatabaseSqlite::replace' |
||
) |
$table | |
$uniqueIndexes | |
$rows | |
$fname | string |
Reimplemented from DatabaseBase.
Definition at line 543 of file DatabaseSqlite.php.
DatabaseSqlite::replaceVars | ( | $ | s | ) | [protected] |
$s | string |
Reimplemented from DatabaseBase.
Reimplemented in MockDatabaseSqlite.
Definition at line 754 of file DatabaseSqlite.php.
DatabaseSqlite::strencode | ( | $ | s | ) |
$s | string |
Implements DatabaseType.
Definition at line 679 of file DatabaseSqlite.php.
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 338 of file DatabaseSqlite.php.
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 567 of file DatabaseSqlite.php.
DatabaseSqlite::unionQueries | ( | $ | sqls, |
$ | all | ||
) |
$sqls | |
$all |
Reimplemented from DatabaseBase.
Definition at line 583 of file DatabaseSqlite.php.
DatabaseSqlite::$fulltextEnabled = null [static, private] |
Definition at line 30 of file DatabaseSqlite.php.
DatabaseSqlite::$mAffectedRows |
Definition at line 32 of file DatabaseSqlite.php.
PDO DatabaseSqlite::$mConn [protected] |
Reimplemented from DatabaseBase.
Definition at line 39 of file DatabaseSqlite.php.
DatabaseSqlite::$mDatabaseFile |
Definition at line 34 of file DatabaseSqlite.php.
DatabaseSqlite::$mLastResult |
Definition at line 33 of file DatabaseSqlite.php.
DatabaseSqlite::$mName |
Definition at line 35 of file DatabaseSqlite.php.