MediaWiki
REL1_23
|
Public Member Functions | |
__construct ($p=null) | |
Constructor. | |
addQuotes ($s) | |
affectedRows () | |
attachDatabase ($name, $file=false, $fname=__METHOD__) | |
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. | |
buildGroupConcatField ($delim, $table, $field, $conds= '', $join_conds=array()) | |
Build a GROUP_CONCAT or equivalent statement for a 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=__METHOD__) | |
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 () | |
getSoftwareLink () | |
getType () | |
implicitGroupby () | |
indexInfo ($table, $index, $fname=__METHOD__) | |
Returns information about an index Returns false if the index does not exist. | |
indexName ($index) | |
Index names have DB scope. | |
indexUnique ($table, $index, $fname=__METHOD__) | |
insert ($table, $a, $fname=__METHOD__, $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=__METHOD__) | |
List all tables on the database. | |
lock ($lockName, $method, $timeout=5) | |
Acquire a named lock. | |
makeInsertOptions ($options) | |
makeSelectOptions ($options) | |
Filter the options used in SELECT statements. | |
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=__METHOD__) | |
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 () | |
unlock ($lockName, $method) | |
Release a lock. | |
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. | |
Public Attributes | |
string | $mDatabaseFile |
File name for SQLite database file *. | |
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. | |
makeUpdateOptionsArray ($options) | |
replaceVars ($s) | |
Protected Attributes | |
FSLockManager | $lockMgr |
(hopefully on the same server as the DB) * | |
int | $mAffectedRows |
The number of rows affected as an integer *. | |
PDO | $mConn |
* | |
resource | $mLastResult |
* | |
Static Private Attributes | |
static | $fulltextEnabled = null |
Definition at line 28 of file DatabaseSqlite.php.
DatabaseSqlite::__construct | ( | $ | params = null | ) |
Constructor.
FIXME: It is possible to construct a Database object with no associated connection object, by specifying no parameters to __construct(). This feature is deprecated and should be removed.
DatabaseBase subclasses should not be constructed directly in external code. DatabaseBase::factory() should be used instead.
array | $params | Parameters passed from DatabaseBase::factory() |
Reimplemented from DatabaseBase.
Definition at line 42 of file DatabaseSqlite.php.
References array(), attachDatabase(), global, DatabaseBase\isOpen(), open(), and wfDeprecated().
DatabaseSqlite::addQuotes | ( | $ | s | ) |
Blob | string | $s |
Reimplemented from DatabaseBase.
Definition at line 768 of file DatabaseSqlite.php.
References $s.
Referenced by strencode().
DatabaseSqlite::attachDatabase | ( | $ | name, |
$ | file = false , |
||
$ | fname = __METHOD__ |
||
) |
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 |
bool | string | $file | Database file name. If omitted, will be generated using $name and $wgSQLiteDataDir |
string | $fname | Calling function name |
Definition at line 225 of file DatabaseSqlite.php.
Referenced by __construct().
DatabaseSqlite::buildConcat | ( | $ | stringList | ) |
Build a concatenation list to feed into a SQL query.
string[] | $stringList |
Reimplemented from DatabaseBase.
Definition at line 893 of file DatabaseSqlite.php.
DatabaseSqlite::buildGroupConcatField | ( | $ | delim, |
$ | table, | ||
$ | field, | ||
$ | conds = '' , |
||
$ | join_conds = array() |
||
) |
Build a GROUP_CONCAT or equivalent statement for a query.
This is useful for combining a field for several rows into a single string. NULL values will not appear in the output, duplicated values will appear, and the resulting delimiter-separated values have no defined sort order. Code using the results may need to use the PHP unique() or sort() methods.
string | $delim | Glue to bind the results together |
string | array | $table | Table name |
string | $field | Field name |
string | array | $conds | Conditions |
string | array | $join_conds | Join conditions |
Reimplemented from DatabaseBase.
Definition at line 897 of file DatabaseSqlite.php.
Check if the searchindext table is FTS enabled.
Definition at line 178 of file DatabaseSqlite.php.
References $fulltextEnabled, $res, DatabaseBase\query(), and tableName().
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 158 of file DatabaseSqlite.php.
DatabaseSqlite::dataSeek | ( | $ | res, |
$ | row | ||
) |
ResultWrapper | array | $res | |
int | $row |
Implements DatabaseType.
Definition at line 400 of file DatabaseSqlite.php.
References $res.
No-op version of deadlockLoop.
Reimplemented from DatabaseBase.
Definition at line 810 of file DatabaseSqlite.php.
DatabaseSqlite::decodeBlob | ( | $ | b | ) |
$b | Blob|string |
Reimplemented from DatabaseBase.
Definition at line 756 of file DatabaseSqlite.php.
DatabaseSqlite::doBegin | ( | $ | fname = '' | ) | [protected] |
Issues the BEGIN command to the database server.
string | $fname |
Reimplemented from DatabaseBase.
Definition at line 704 of file DatabaseSqlite.php.
DatabaseSqlite::doCommit | ( | $ | fname = '' | ) | [protected] |
Issues the COMMIT command to the database server.
string | $fname |
Reimplemented from DatabaseBase.
Definition at line 716 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.
string | $sql |
Reimplemented from DatabaseBase.
Definition at line 251 of file DatabaseSqlite.php.
DatabaseSqlite::doRollback | ( | $ | fname = '' | ) | [protected] |
Issues the ROLLBACK command to the database server.
string | $fname |
Reimplemented from DatabaseBase.
Definition at line 728 of file DatabaseSqlite.php.
DatabaseSqlite::duplicateTableStructure | ( | $ | oldName, |
$ | newName, | ||
$ | temporary = false , |
||
$ | fname = __METHOD__ |
||
) |
MWException |
string | $oldName | |
string | $newName | |
bool | $temporary | |
string | $fname |
Reimplemented from DatabaseBase.
Definition at line 913 of file DatabaseSqlite.php.
DatabaseSqlite::encodeBlob | ( | $ | b | ) |
$b |
Reimplemented from DatabaseBase.
Definition at line 748 of file DatabaseSqlite.php.
DatabaseSqlite::fetchObject | ( | $ | res | ) |
ResultWrapper | array | $res |
Implements DatabaseType.
Definition at line 279 of file DatabaseSqlite.php.
DatabaseSqlite::fetchRow | ( | $ | res | ) |
ResultWrapper | mixed | $res |
Implements DatabaseType.
Definition at line 306 of file DatabaseSqlite.php.
References $res.
DatabaseSqlite::fieldInfo | ( | $ | table, |
$ | field | ||
) |
Get information about a given field Returns false if the field does not exist.
string | $table | |
string | $field |
Implements DatabaseType.
Definition at line 691 of file DatabaseSqlite.php.
DatabaseSqlite::fieldName | ( | $ | res, |
$ | n | ||
) |
ResultWrapper | $res | |
$n |
Implements DatabaseType.
Definition at line 349 of file DatabaseSqlite.php.
static DatabaseSqlite::fixIgnore | ( | $ | options | ) | [static] |
array | $options |
Definition at line 531 of file DatabaseSqlite.php.
Referenced by makeInsertOptions(), and makeUpdateOptionsArray().
DatabaseSqlite::freeResult | ( | $ | res | ) |
ResultWrapper | mixed | $res |
Reimplemented from DatabaseBase.
Definition at line 267 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 170 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 196 of file DatabaseSqlite.php.
Referenced by RebuildTextIndex\execute(), and SqliteUpdater\sqliteSetupSearchindex().
Reimplemented from DatabaseBase.
Definition at line 677 of file DatabaseSqlite.php.
Implements DatabaseType.
Definition at line 668 of file DatabaseSqlite.php.
Implements DatabaseType.
Definition at line 661 of file DatabaseSqlite.php.
Reimplemented from DatabaseBase.
Definition at line 85 of file DatabaseSqlite.php.
DatabaseSqlite::indexInfo | ( | $ | table, |
$ | index, | ||
$ | fname = __METHOD__ |
||
) |
Returns information about an index Returns false if the index does not exist.
string | $table | |
string | $index | |
string | $fname |
Implements DatabaseType.
Definition at line 456 of file DatabaseSqlite.php.
DatabaseSqlite::indexName | ( | $ | index | ) |
Index names have DB scope.
string | $index |
Reimplemented from DatabaseBase.
Definition at line 382 of file DatabaseSqlite.php.
DatabaseSqlite::indexUnique | ( | $ | table, |
$ | index, | ||
$ | fname = __METHOD__ |
||
) |
string | $table | |
string | $index | |
string | $fname |
Definition at line 479 of file DatabaseSqlite.php.
DatabaseSqlite::insert | ( | $ | table, |
$ | a, | ||
$ | fname = __METHOD__ , |
||
$ | options = array() |
||
) |
Based on generic method (parent) with some prior SQLite-sepcific adjustments.
string | $table | |
array | $a | |
string | $fname | |
array | $options |
Reimplemented from DatabaseBase.
Definition at line 560 of file DatabaseSqlite.php.
This must be called after nextSequenceVal.
Implements DatabaseType.
Definition at line 391 of file DatabaseSqlite.php.
DatabaseSqlite::isWriteQuery | ( | $ | sql | ) |
$sql | string |
Reimplemented from DatabaseBase.
Definition at line 241 of file DatabaseSqlite.php.
DatabaseSqlite::listTables | ( | $ | prefix = null , |
$ | fname = __METHOD__ |
||
) |
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 946 of file DatabaseSqlite.php.
Referenced by DatabaseSqliteTest\getTables().
DatabaseSqlite::lock | ( | $ | lockName, |
$ | method, | ||
$ | timeout = 5 |
||
) |
Acquire a named lock.
Abstracted from Filestore::lock() so child classes can implement for their own needs.
string | $lockName | Name of lock to aquire |
string | $method | Name of method calling us |
int | $timeout |
Reimplemented from DatabaseBase.
Definition at line 871 of file DatabaseSqlite.php.
DatabaseSqlite::makeInsertOptions | ( | $ | options | ) |
array | $options |
Reimplemented from DatabaseBase.
Definition at line 546 of file DatabaseSqlite.php.
References $options, and fixIgnore().
DatabaseSqlite::makeSelectOptions | ( | $ | options | ) |
Filter the options used in SELECT statements.
array | $options |
Reimplemented from DatabaseBase.
Definition at line 506 of file DatabaseSqlite.php.
DatabaseSqlite::makeUpdateOptionsArray | ( | $ | options | ) | [protected] |
array | $options |
Reimplemented from DatabaseBase.
Definition at line 520 of file DatabaseSqlite.php.
References $options, and fixIgnore().
DatabaseSqlite::numFields | ( | $ | res | ) |
ResultWrapper | $res |
Implements DatabaseType.
Definition at line 338 of file DatabaseSqlite.php.
References $res.
DatabaseSqlite::numRows | ( | $ | res | ) |
The PDO::Statement class implements the array interface so count() will work.
ResultWrapper | array | $res |
Implements DatabaseType.
Definition at line 328 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 100 of file DatabaseSqlite.php.
Referenced by __construct().
DatabaseSqlite::openFile | ( | $ | fileName | ) |
Opens a database file.
string | $fileName |
DBConnectionError |
Definition at line 121 of file DatabaseSqlite.php.
DatabaseSqlite::replace | ( | $ | table, |
$ | uniqueIndexes, | ||
$ | rows, | ||
$ | fname = __METHOD__ |
||
) |
string | $table | |
array | $uniqueIndexes | Unused |
string | array | $rows | |
string | $fname |
Reimplemented from DatabaseBase.
Definition at line 587 of file DatabaseSqlite.php.
DatabaseSqlite::replaceVars | ( | $ | s | ) | [protected] |
string | $s |
Reimplemented from DatabaseBase.
Reimplemented in MockDatabaseSqlite.
Definition at line 821 of file DatabaseSqlite.php.
References $s.
DatabaseSqlite::strencode | ( | $ | s | ) |
string | $s |
Implements DatabaseType.
Definition at line 740 of file DatabaseSqlite.php.
References $s, and addQuotes().
DatabaseSqlite::tableName | ( | $ | name, |
$ | format = 'quoted' |
||
) |
Use MySQL's naming (accounts for prefix etc) but remove surrounding backticks.
string | $name | |
string | $format |
Reimplemented from DatabaseBase.
Definition at line 367 of file DatabaseSqlite.php.
Referenced by checkForEnabledSearch().
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.
string | $table | |
string | $field |
Reimplemented from DatabaseBase.
Definition at line 615 of file DatabaseSqlite.php.
DatabaseSqlite::unionQueries | ( | $ | sqls, |
$ | all | ||
) |
string | $sqls | |
bool | $all | Whether to "UNION ALL" or not |
Reimplemented from DatabaseBase.
Definition at line 631 of file DatabaseSqlite.php.
DatabaseSqlite::unlock | ( | $ | lockName, |
$ | method | ||
) |
Release a lock.
string | $lockName | Name of lock to release |
string | $method | Name of method calling us |
Reimplemented from DatabaseBase.
Definition at line 883 of file DatabaseSqlite.php.
DatabaseSqlite::$fulltextEnabled = null [static, private] |
Definition at line 30 of file DatabaseSqlite.php.
Referenced by checkForEnabledSearch().
FSLockManager DatabaseSqlite::$lockMgr [protected] |
(hopefully on the same server as the DB) *
Definition at line 40 of file DatabaseSqlite.php.
int DatabaseSqlite::$mAffectedRows [protected] |
The number of rows affected as an integer *.
Definition at line 34 of file DatabaseSqlite.php.
PDO DatabaseSqlite::$mConn [protected] |
string DatabaseSqlite::$mDatabaseFile |
File name for SQLite database file *.
Definition at line 32 of file DatabaseSqlite.php.
resource DatabaseSqlite::$mLastResult [protected] |
*
Definition at line 36 of file DatabaseSqlite.php.