41 public static function record( $rc,
$auto =
false,
User $user =
null, $tags =
null ) {
51 if ( !is_object( $rc ) ) {
61 $action =
$auto ?
'autopatrol' :
'patrol';
64 $entry->setTarget( $rc->getTitle() );
65 $entry->setParameters( self::buildParams( $rc,
$auto ) );
66 $entry->setPerformer(
$user );
67 $entry->setTags( $tags );
68 $logid = $entry->insert();
70 $entry->publish( $logid,
'udp' );
85 '4::curid' => $change->getAttribute(
'rc_this_oldid' ),
86 '5::previd' => $change->getAttribute(
'rc_last_oldid' ),
87 '6::auto' => (int)
$auto
$wgLogAutopatrol
Log autopatrol actions to the log table.
Class for creating log entries manually, to inject them into the database.
Class containing static functions for working with logs of patrol events.
static buildParams( $change, $auto)
Prepare log parameters for a patrolled change.
static record( $rc, $auto=false, User $user=null, $tags=null)
Record a log event for a change being patrolled.
Utility class for creating new RC entries.
static newFromId( $rcid)
Obtain the recent change with a given rc_id value.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
when a variable name is used in a it is silently declared as a new local masking the global
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
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped true if there is text before this autocomment $auto
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