8 $dbu->setAppliedUpdates(
"test", [] );
9 $expected =
"updatelist-test-" . time() .
"0";
10 $actual =
$db->lastInsertData[
'ul_key'];
11 $this->assertEquals( $expected, $actual, var_export(
$db->lastInsertData,
true ) );
12 $dbu->setAppliedUpdates(
"test", [] );
13 $expected =
"updatelist-test-" . time() .
"1";
14 $actual =
$db->lastInsertData[
'ul_key'];
15 $this->assertEquals( $expected, $actual, var_export(
$db->lastInsertData,
true ) );
24 $this->cliMode =
true;
25 $this->connLogger = new \Psr\Log\NullLogger();
26 $this->queryLogger = new \Psr\Log\NullLogger();
28 wfWarn( get_class(
$e ) .
": {$e->getMessage()}" );
33 function clearFlag( $arg, $remember = self::REMEMBER_NOTHING ) {
36 function setFlag( $arg, $remember = self::REMEMBER_NOTHING ) {
40 $this->lastInsertTable = $table;
41 $this->lastInsertData = $a;
63 function open( $server,
$user, $password, $dbName ) {
264 self::$updateCounter = 0;
284 parent::setAppliedUpdates( $version,
$updates );
indexInfo($table, $index, $fname=__METHOD__)
Get information about an index into an object.
numRows($res)
Get the number of rows in a result object.
insertId()
Get the inserted value of an auto-increment row.
getServerVersion()
A string describing the current software version, like from mysql_get_server_info().
fetchRow($res)
Fetch the next row from the given result object, in associative array form.
setAppliedUpdates($version, $updates=[])
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
clearFlag($arg, $remember=self::REMEMBER_NOTHING)
Clear a flag for this connection.
Class for handling database updates.
fetchObject($res)
Fetch the next row from the given result object, in object form.
fieldInfo($table, $field)
mysql_fetch_field() wrapper Returns false if the field doesn't exist
strencode($s)
Wrapper for addslashes()
open($server, $user, $password, $dbName)
Open a connection to the database.
getSoftwareLink()
Returns a wikitext link to the DB's website, e.g., return "[http://www.mysql.com/ MySQL]"; Should at ...
getType()
Get the type of the DBMS, as it appears in $wgDBtype.
doQuery($sql)
The DBMS-dependent part of query()
Database $db
Handle to the database subclass.
wfWarn($msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
array $updates
Array of updates to perform on the database.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
fieldName($res, $n)
Get a field name in a result object.
lastErrno()
Get the last error number.
dataSeek($res, $row)
Change the position of the cursor in a result object.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
insert($table, $a, $fname=__METHOD__, $options=[])
INSERT wrapper, inserts an array into a table.
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined...
numFields($res)
Get the number of fields in a result object.
affectedRows()
Get the number of rows affected by the last write query.
setFlag($arg, $remember=self::REMEMBER_NOTHING)
Set a flag for this connection.
lastError()
Get a description of the last error.
getCoreUpdateList()
Get an array of updates to perform on the database.
closeConnection()
Closes underlying database connection.