Go to the documentation of this file.
65 $pattern =
'', $conds = [], $year =
false, $month =
false, $tagFilter =
'',
68 parent::__construct( $list->getContext() );
69 $this->mConds = $conds;
71 $this->mLogEventsList = $list;
78 $this->mTagFilter = $tagFilter;
85 $query = parent::getDefaultQuery();
98 if (
count( $this->types ) ) {
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 );
129 $needReindex =
false;
138 if ( $needReindex ) {
146 $audience =
$types ?
'user' :
'public';
148 if ( $hideLogs !==
false ) {
149 $this->mConds[] = $hideLogs;
152 $this->mConds[
'log_type'] =
$types;
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;
207 if ( $page instanceof
Title ) {
211 if ( strlen( $page ) == 0 || !
$title instanceof
Title ) {
220 $doUserRightsLogLike =
false;
221 if ( $this->types == [
'rights' ] ) {
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 );
254 $this->mConds[] =
'log_title' . $db->buildLike(
$title->
getDBkey(), $db->anyString() );
261 if ( !
$user->isAllowed(
'deletedhistory' ) ) {
263 } elseif ( !
$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
278 if (
$type ===
'' ) {
283 if ( isset( $actions[
$type] ) ) {
285 $this->mLogEventsList->setAllowedActions( array_keys( $actions[
$type] ) );
302 $this->mConds[
'log_id'] = $logId;
314 $fields = $basic[
'fields'];
315 $conds = $basic[
'conds'];
317 $joins = $basic[
'join_conds'];
319 # Add log_search table if there are conditions on it.
320 # This filters the results to only include log rows that have
321 # log_search records with the specified ls_field and ls_value values.
322 if ( array_key_exists(
'ls_field', $this->mConds ) ) {
324 $options[
'IGNORE INDEX'] = [
'log_search' =>
'ls_log_id' ];
325 $options[
'USE INDEX'] = [
'logging' =>
'PRIMARY' ];
329 # Since (ls_field,ls_value,ls_logid) is unique, if the condition is
330 # to match a specific (ls_field,ls_value) tuple, then there will be
331 # no duplicate log rows. Otherwise, we need to remove the duplicates.
335 # Don't show duplicate rows when using log_search
336 $joins[
'log_search'] = [
'INNER JOIN',
'ls_log_id=log_id' ];
341 'conds' => array_merge( $conds, $this->mConds ),
343 'join_conds' => $joins,
345 # Add ChangeTags filter query
347 $info[
'join_conds'], $info[
'options'], $this->mTagFilter );
359 array_key_exists( $field, $this->mConds ) &&
360 ( !is_array( $this->mConds[$field] ) ||
count( $this->mConds[$field] ) == 1 )
365 return 'log_timestamp';
369 # Do a link batch query
372 foreach ( $this->mResult
as $row ) {
373 $lb->
add( $row->log_namespace, $row->log_title );
377 foreach ( $formatter->getPreloadTitles()
as $title ) {
382 $this->mResult->seek( 0 );
389 return $this->mLogEventsList->logLine( $row );
425 return $this->mTagFilter;
434 $this->mDb->setBigSelects();
436 $this->mDb->setBigSelects(
'default' );
$wgActionFilteredLogs
List of log types that can be filtered by action types.
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
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
getPrefixedText()
Get the prefixed title with spaces.
Allows to change the fields on the form that will be generated $name
getRequest()
Get the WebRequest object.
getUser()
Get the User object.
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
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
null for the 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
getDBkey()
Get the main part with underscores.
getNamespace()
Get the namespace index, i.e.
$wgFilterLogTypes
Show/hide links on Special:Log will be shown for these log types.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
$wgUserrightsInterwikiDelimiter
Character used as a delimiter when testing for interwiki userrights (In Special:UserRights,...
when a variable name is used in a it is silently declared as a new masking the global
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
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
$wgLogRestrictions
This restricts log access to those who have a certain right Users without this will not see it in the...
static getExcludeClause( $db, $audience='public', User $user=null)
SQL clause to skip forbidden log types for this user.
static sanitizeIP( $ip)
Convert an IP into a verbose, uppercase, normalized form.
Represents a title within MediaWiki.
$wgMiserMode
Disable database-intensive features.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
static idFromName( $name, $flags=self::READ_NORMAL)
Get database id given a user name.
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
the array() calling protocol came about after MediaWiki 1.4rc1.