66 $pattern =
'', $conds = [], $year =
false, $month =
false, $tagFilter =
'',
69 parent::__construct( $list->getContext() );
70 $this->mConds = $conds;
72 $this->mLogEventsList = $list;
79 $this->mTagFilter = $tagFilter;
85 $query = parent::getDefaultQuery();
98 if ( count( $this->types ) ) {
101 foreach ( $wgFilterLogTypes
as $type => $default ) {
103 if (
$type !==
'patrol' || $this->
getUser()->useNPPatrol() ) {
104 $hide = $this->
getRequest()->getInt(
"hide_{$type}_log", $default );
105 $filters[
$type] = $hide;
107 $this->mConds[] =
'log_type != ' . $this->mDb->addQuotes(
$type );
123 global $wgLogRestrictions;
129 $needReindex =
false;
131 if ( isset( $wgLogRestrictions[$type] )
132 && !
$user->isAllowed( $wgLogRestrictions[$type] )
138 if ( $needReindex ) {
146 $audience =
$types ?
'user' :
'public';
148 if ( $hideLogs !==
false ) {
149 $this->mConds[] = $hideLogs;
152 $this->mConds[
'log_type'] =
$types;
154 if ( count(
$types ) == 1 ) {
155 $this->typeCGI =
$types[0];
171 if ( is_null( $usertitle ) ) {
176 $name = $usertitle->getText();
182 $this->mConds[
'log_user'] = $userid;
186 if ( !
$user->isAllowed(
'deletedhistory' ) ) {
188 } elseif ( !
$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
193 $this->performer =
$name;
211 if ( strlen(
$page ) == 0 || !
$title instanceof Title ) {
220 $doUserRightsLogLike =
false;
221 if ( $this->types == [
'rights' ] ) {
222 $parts = explode( $wgUserrightsInterwikiDelimiter,
$title->
getDBkey() );
223 if ( count( $parts ) == 2 ) {
224 list(
$name, $database ) = array_map(
'trim', $parts );
225 if ( strstr( $database,
'*' ) ) {
226 $doUserRightsLogLike =
true;
244 $this->mConds[
'log_namespace'] = $ns;
245 if ( $doUserRightsLogLike ) {
247 foreach ( explode(
'*', $database )
as $databasepart ) {
252 $this->mConds[] =
'log_title' . $db->buildLike(
$params );
253 } elseif (
$pattern && !$wgMiserMode ) {
254 $this->mConds[] =
'log_title' . $db->buildLike(
$title->
getDBkey(), $db->anyString() );
261 if ( !
$user->isAllowed(
'deletedhistory' ) ) {
263 } elseif ( !
$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
275 global $wgActionFilteredLogs;
278 if (
$type ===
'' ) {
282 $actions = $wgActionFilteredLogs;
283 if ( isset( $actions[
$type] ) ) {
285 $this->mLogEventsList->setAllowedActions( array_keys( $actions[$type] ) );
303 $fields = $basic[
'fields'];
304 $conds = $basic[
'conds'];
306 $joins = $basic[
'join_conds'];
309 # Add log_search table if there are conditions on it.
310 # This filters the results to only include log rows that have
311 # log_search records with the specified ls_field and ls_value values.
312 if ( array_key_exists(
'ls_field', $this->mConds ) ) {
314 $index[
'log_search'] =
'ls_field_val';
315 $index[
'logging'] =
'PRIMARY';
319 # Since (ls_field,ls_value,ls_logid) is unique, if the condition is
320 # to match a specific (ls_field,ls_value) tuple, then there will be
321 # no duplicate log rows. Otherwise, we need to remove the duplicates.
325 if ( count( $index ) ) {
328 # Don't show duplicate rows when using log_search
329 $joins[
'log_search'] = [
'INNER JOIN',
'ls_log_id=log_id' ];
334 'conds' => array_merge( $conds, $this->mConds ),
336 'join_conds' => $joins,
338 # Add ChangeTags filter query
340 $info[
'join_conds'], $info[
'options'], $this->mTagFilter );
352 array_key_exists( $field, $this->mConds ) &&
353 ( !is_array( $this->mConds[$field] ) || count( $this->mConds[$field] ) == 1 )
358 return 'log_timestamp';
362 # Do a link batch query
365 foreach ( $this->mResult
as $row ) {
366 $lb->
add( $row->log_namespace, $row->log_title );
370 foreach ( $formatter->getPreloadTitles()
as $title ) {
375 $this->mResult->seek( 0 );
382 return $this->mLogEventsList->logLine( $row );
418 return $this->mTagFilter;
427 $this->mDb->setBigSelects();
429 $this->mDb->setBigSelects(
'default' );
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
the array() calling protocol came about after MediaWiki 1.4rc1.
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
static sanitizeIP($ip)
Convert an IP into a verbose, uppercase, normalized form.
getPrefixedText()
Get the prefixed title with spaces.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
when a variable name is used in a it is silently declared as a new local masking the global
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
Class representing a list of titles The execute() method checks them all for existence and adds them ...
getRequest()
Get the WebRequest object.
getDBkey()
Get the main part with underscores.
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
$wgMiserMode
Disable database-intensive features.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
getNamespace()
Get the namespace index, i.e.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
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
static idFromName($name, $flags=self::READ_NORMAL)
Get database id given a user name.
getUser()
Get the User object.
static getExcludeClause($db, $audience= 'public', User $user=null)
SQL clause to skip forbidden log types for this user.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
Allows to change the fields on the form that will be generated $name