Go to the documentation of this file.
34 $logEntry->setPerformer(
$user );
39 if ( $parameters !==
null ) {
40 $logEntry->setParameters( $parameters );
43 return $logEntry->insert();
47 $this->tablesUsed[] =
'logging';
48 $this->tablesUsed[] =
'user';
52 $this->userId1 = $user1->getId();
53 if ( $this->userId1 === 0 ) {
54 $user1->addToDatabase();
55 $this->userId1 = $user1->getId();
57 $this->assertGreaterThan( 0, $this->userId1 );
60 $this->userId2 = $user2->getId();
61 if ( $this->userId2 === 0 ) {
62 $user2->addToDatabase();
63 $this->userId2 = $user2->getId();
65 $this->assertGreaterThan( 0, $this->userId2 );
67 $this->logId1 = $this->
addLogEntry(
'type',
'subtype',
69 $this->assertGreaterThan( 0, $this->logId1 );
71 $this->logId2 = $this->
addLogEntry(
'supress',
'delete',
72 $user2,
NS_TALK,
"PageB",
"SomeComment" );
73 $this->assertGreaterThan( 0, $this->logId2 );
75 $this->logId3 = $this->
addLogEntry(
'move',
'delete',
76 $user2,
NS_MAIN,
"PageA",
"SomeOtherComment",
77 array(
'key1' => 1, 3 =>
'value3' ) );
78 $this->assertGreaterThan( 0, $this->logId3 );
79 }
catch ( Exception
$e ) {
83 $this->exceptionFromAddDBData =
$e;
126 $parameters_xml = unserialize( $this->xml->value );
127 $this->assertEquals( $parameters, $parameters_xml );
128 $this->assertTrue( $this->xml->read(),
"Skipping past processed text of params" );
143 $dumper->endId = $this->logId3 + 1;
154 $this->userId1,
null,
"type",
"subtype",
"PageA" );
156 $this->assertNotNull(
$wgContLang,
"Content language object validation" );
158 $this->assertInternalType(
'string', $namespace );
159 $this->assertGreaterThan( 0, strlen( $namespace ) );
161 $this->userId2,
"SomeComment",
"supress",
"delete",
162 $namespace .
":PageB" );
165 $this->userId2,
"SomeOtherComment",
"move",
"delete",
166 "PageA",
array(
'key1' => 1, 3 =>
'value3' ) );
181 $dumper->endId = $this->logId3 + 1;
189 $dumper->stderr = fopen(
'php://output',
'a' );
190 if (
$dumper->stderr ===
false ) {
191 $this->
fail(
"Could not open stream for stderr" );
197 $this->assertTrue( fclose(
$dumper->stderr ),
"Closing stderr handle" );
205 $this->userId1,
null,
"type",
"subtype",
"PageA" );
207 $this->assertNotNull(
$wgContLang,
"Content language object validation" );
209 $this->assertInternalType(
'string', $namespace );
210 $this->assertGreaterThan( 0, strlen( $namespace ) );
212 $this->userId2,
"SomeComment",
"supress",
"delete",
213 $namespace .
":PageB" );
216 $this->userId2,
"SomeOtherComment",
"move",
"delete",
217 "PageA",
array(
'key1' => 1, 3 =>
'value3' ) );
225 $this->expectOutputString(
'' );
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
addLogEntry( $type, $subtype, User $user, $ns, $title, $comment=null, $parameters=null)
adds a log entry to the database.
Tests for log dumps of BackupDumper.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
assertTextNode( $name, $text, $skip_ws=true)
Asserts that the xml reader is at an element of given tag that contains a given text,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
as a message key or array as accepted by ApiBase::dieUsageMsg after processing request parameters Return false to let the request fail
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
assertDumpEnd( $name="mediawiki")
Asserts that the xml reader is at the final closing tag of an xml file and closes the reader.
assertNodeEnd( $name, $skip=true)
Asserts that the xml reader is at an closing element of given name, and optionally skips past it.
assertNodeStart( $name, $skip=true)
Asserts that the xml reader is at an element of given name, and optionally skips past it.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
assertLogItem( $id, $user_name, $user_id, $comment, $type, $subtype, $title, $parameters=array())
asserts that the xml reader is at the beginning of a log entry and skips over it while analyzing it.
testXmlDumpsBackupUseCaseLogging()
presenting them properly to the user as errors is done by the caller $title
assertDumpStart( $fname, $skip_siteinfo=true)
Opens an XML file to analyze and optionally skips past siteinfo.
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 account $user
gunzip( $fname)
gunzips the given file and stores the result in the original file name
Class for creating log entries manually, for example to inject them into the database.
skipWhitespace()
Steps the xml reader over white space.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...