MediaWiki REL1_31
LogEntry.php
Go to the documentation of this file.
1<?php
32
38interface LogEntry {
39
45 public function getType();
46
52 public function getSubtype();
53
59 public function getFullType();
60
66 public function getParameters();
67
73 public function getPerformer();
74
80 public function getTarget();
81
87 public function getTimestamp();
88
94 public function getComment();
95
101 public function getDeleted();
102
107 public function isDeleted( $field );
108}
109
115abstract class LogEntryBase implements LogEntry {
116
117 public function getFullType() {
118 return $this->getType() . '/' . $this->getSubtype();
119 }
120
121 public function isDeleted( $field ) {
122 return ( $this->getDeleted() & $field ) === $field;
123 }
124
131 public function isLegacy() {
132 return false;
133 }
134
142 public static function makeParamBlob( $params ) {
143 return serialize( (array)$params );
144 }
145
153 public static function extractParams( $blob ) {
154 return unserialize( $blob );
155 }
156}
157
164
172 public static function getSelectQueryData() {
173 $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' );
174 $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
175
176 $tables = array_merge(
177 [ 'logging' ], $commentQuery['tables'], $actorQuery['tables'], [ 'user' ]
178 );
179 $fields = [
180 'log_id', 'log_type', 'log_action', 'log_timestamp',
181 'log_namespace', 'log_title', // unused log_page
182 'log_params', 'log_deleted',
183 'user_id', 'user_name', 'user_editcount',
184 ] + $commentQuery['fields'] + $actorQuery['fields'];
185
186 $joins = [
187 // IPs don't have an entry in user table
188 'user' => [ 'LEFT JOIN', 'user_id=' . $actorQuery['fields']['log_user'] ],
189 ] + $commentQuery['joins'] + $actorQuery['joins'];
190
191 return [
192 'tables' => $tables,
193 'fields' => $fields,
194 'conds' => [],
195 'options' => [],
196 'join_conds' => $joins,
197 ];
198 }
199
207 public static function newFromRow( $row ) {
208 $row = (object)$row;
209 if ( isset( $row->rc_logid ) ) {
210 return new RCDatabaseLogEntry( $row );
211 } else {
212 return new self( $row );
213 }
214 }
215
223 public static function newFromId( $id, IDatabase $db ) {
224 $queryInfo = self::getSelectQueryData();
225 $queryInfo['conds'] += [ 'log_id' => $id ];
226 $row = $db->selectRow(
227 $queryInfo['tables'],
228 $queryInfo['fields'],
229 $queryInfo['conds'],
230 __METHOD__,
231 $queryInfo['options'],
232 $queryInfo['join_conds']
233 );
234 if ( !$row ) {
235 return null;
236 }
237 return self::newFromRow( $row );
238 }
239
241 protected $row;
242
244 protected $performer;
245
247 protected $params;
248
250 protected $revId = null;
251
253 protected $legacy;
254
255 protected function __construct( $row ) {
256 $this->row = $row;
257 }
258
264 public function getId() {
265 return (int)$this->row->log_id;
266 }
267
273 protected function getRawParameters() {
274 return $this->row->log_params;
275 }
276
277 public function isLegacy() {
278 // This extracts the property
279 $this->getParameters();
280 return $this->legacy;
281 }
282
283 public function getType() {
284 return $this->row->log_type;
285 }
286
287 public function getSubtype() {
288 return $this->row->log_action;
289 }
290
291 public function getParameters() {
292 if ( !isset( $this->params ) ) {
293 $blob = $this->getRawParameters();
294 Wikimedia\suppressWarnings();
296 Wikimedia\restoreWarnings();
297 if ( $params !== false ) {
298 $this->params = $params;
299 $this->legacy = false;
300 } else {
301 $this->params = LogPage::extractParams( $blob );
302 $this->legacy = true;
303 }
304
305 if ( isset( $this->params['associated_rev_id'] ) ) {
306 $this->revId = $this->params['associated_rev_id'];
307 unset( $this->params['associated_rev_id'] );
308 }
309 }
310
311 return $this->params;
312 }
313
314 public function getAssociatedRevId() {
315 // This extracts the property
316 $this->getParameters();
317 return $this->revId;
318 }
319
320 public function getPerformer() {
321 if ( !$this->performer ) {
322 $actorId = isset( $this->row->log_actor ) ? (int)$this->row->log_actor : 0;
323 $userId = (int)$this->row->log_user;
324 if ( $userId !== 0 || $actorId !== 0 ) {
325 // logged-in users
326 if ( isset( $this->row->user_name ) ) {
327 $this->performer = User::newFromRow( $this->row );
328 } elseif ( $actorId !== 0 ) {
329 $this->performer = User::newFromActorId( $actorId );
330 } else {
331 $this->performer = User::newFromId( $userId );
332 }
333 } else {
334 // IP users
335 $userText = $this->row->log_user_text;
336 $this->performer = User::newFromName( $userText, false );
337 }
338 }
339
340 return $this->performer;
341 }
342
343 public function getTarget() {
344 $namespace = $this->row->log_namespace;
345 $page = $this->row->log_title;
346 $title = Title::makeTitle( $namespace, $page );
347
348 return $title;
349 }
350
351 public function getTimestamp() {
352 return wfTimestamp( TS_MW, $this->row->log_timestamp );
353 }
354
355 public function getComment() {
356 return CommentStore::getStore()->getComment( 'log_comment', $this->row )->text;
357 }
358
359 public function getDeleted() {
360 return $this->row->log_deleted;
361 }
362}
363
365
366 public function getId() {
367 return $this->row->rc_logid;
368 }
369
370 protected function getRawParameters() {
371 return $this->row->rc_params;
372 }
373
374 public function getAssociatedRevId() {
375 return $this->row->rc_this_oldid;
376 }
377
378 public function getType() {
379 return $this->row->rc_log_type;
380 }
381
382 public function getSubtype() {
383 return $this->row->rc_log_action;
384 }
385
386 public function getPerformer() {
387 if ( !$this->performer ) {
388 $actorId = isset( $this->row->rc_actor ) ? (int)$this->row->rc_actor : 0;
389 $userId = (int)$this->row->rc_user;
390 if ( $actorId !== 0 ) {
391 $this->performer = User::newFromActorId( $actorId );
392 } elseif ( $userId !== 0 ) {
393 $this->performer = User::newFromId( $userId );
394 } else {
395 $userText = $this->row->rc_user_text;
396 // Might be an IP, don't validate the username
397 $this->performer = User::newFromName( $userText, false );
398 }
399 }
400
401 return $this->performer;
402 }
403
404 public function getTarget() {
405 $namespace = $this->row->rc_namespace;
406 $page = $this->row->rc_title;
407 $title = Title::makeTitle( $namespace, $page );
408
409 return $title;
410 }
411
412 public function getTimestamp() {
413 return wfTimestamp( TS_MW, $this->row->rc_timestamp );
414 }
415
416 public function getComment() {
417 return CommentStore::getStore()
418 // Legacy because the row may have used RecentChange::selectFields()
419 ->getCommentLegacy( wfGetDB( DB_REPLICA ), 'rc_comment', $this->row )->text;
420 }
421
422 public function getDeleted() {
423 return $this->row->rc_deleted;
424 }
425}
426
434 protected $type;
435
437 protected $subtype;
438
440 protected $parameters = [];
441
443 protected $relations = [];
444
446 protected $performer;
447
449 protected $target;
450
452 protected $timestamp;
453
455 protected $comment = '';
456
458 protected $revId = 0;
459
461 protected $tags = null;
462
464 protected $deleted;
465
467 protected $id;
468
470 protected $isPatrollable = false;
471
473 protected $legacy = false;
474
480 public function __construct( $type, $subtype ) {
481 $this->type = $type;
482 $this->subtype = $subtype;
483 }
484
506 public function setParameters( $parameters ) {
507 $this->parameters = $parameters;
508 }
509
517 public function setRelations( array $relations ) {
518 $this->relations = $relations;
519 }
520
527 public function setPerformer( User $performer ) {
528 $this->performer = $performer;
529 }
530
537 public function setTarget( Title $target ) {
538 $this->target = $target;
539 }
540
547 public function setTimestamp( $timestamp ) {
548 $this->timestamp = $timestamp;
549 }
550
557 public function setComment( $comment ) {
558 $this->comment = $comment;
559 }
560
570 public function setAssociatedRevId( $revId ) {
571 $this->revId = $revId;
572 }
573
580 public function setTags( $tags ) {
581 if ( is_string( $tags ) ) {
582 $tags = [ $tags ];
583 }
584 $this->tags = $tags;
585 }
586
596 public function setIsPatrollable( $patrollable ) {
597 $this->isPatrollable = (bool)$patrollable;
598 }
599
606 public function setLegacy( $legacy ) {
607 $this->legacy = $legacy;
608 }
609
616 public function setDeleted( $deleted ) {
617 $this->deleted = $deleted;
618 }
619
627 public function insert( IDatabase $dbw = null ) {
629
630 $dbw = $dbw ?: wfGetDB( DB_MASTER );
631
632 if ( $this->timestamp === null ) {
633 $this->timestamp = wfTimestampNow();
634 }
635
636 // Trim spaces on user supplied text
637 $comment = trim( $this->getComment() );
638
639 $params = $this->getParameters();
640 $relations = $this->relations;
641
642 // Ensure actor relations are set
644 empty( $relations['target_author_actor'] )
645 ) {
646 $actorIds = [];
647 if ( !empty( $relations['target_author_id'] ) ) {
648 foreach ( $relations['target_author_id'] as $id ) {
649 $actorIds[] = User::newFromId( $id )->getActorId( $dbw );
650 }
651 }
652 if ( !empty( $relations['target_author_ip'] ) ) {
653 foreach ( $relations['target_author_ip'] as $ip ) {
654 $actorIds[] = User::newFromName( $ip, false )->getActorId( $dbw );
655 }
656 }
657 if ( $actorIds ) {
658 $relations['target_author_actor'] = $actorIds;
659 $params['authorActors'] = $actorIds;
660 }
661 }
663 unset( $relations['target_author_id'], $relations['target_author_ip'] );
664 unset( $params['authorIds'], $params['authorIPs'] );
665 }
666
667 // Additional fields for which there's no space in the database table schema
668 $revId = $this->getAssociatedRevId();
669 if ( $revId ) {
670 $params['associated_rev_id'] = $revId;
671 $relations['associated_rev_id'] = $revId;
672 }
673
674 $data = [
675 'log_type' => $this->getType(),
676 'log_action' => $this->getSubtype(),
677 'log_timestamp' => $dbw->timestamp( $this->getTimestamp() ),
678 'log_namespace' => $this->getTarget()->getNamespace(),
679 'log_title' => $this->getTarget()->getDBkey(),
680 'log_page' => $this->getTarget()->getArticleID(),
681 'log_params' => LogEntryBase::makeParamBlob( $params ),
682 ];
683 if ( isset( $this->deleted ) ) {
684 $data['log_deleted'] = $this->deleted;
685 }
686 $data += CommentStore::getStore()->insert( $dbw, 'log_comment', $comment );
687 $data += ActorMigration::newMigration()
688 ->getInsertValues( $dbw, 'log_user', $this->getPerformer() );
689
690 $dbw->insert( 'logging', $data, __METHOD__ );
691 $this->id = $dbw->insertId();
692
693 $rows = [];
694 foreach ( $relations as $tag => $values ) {
695 if ( !strlen( $tag ) ) {
696 throw new MWException( "Got empty log search tag." );
697 }
698
699 if ( !is_array( $values ) ) {
700 $values = [ $values ];
701 }
702
703 foreach ( $values as $value ) {
704 $rows[] = [
705 'ls_field' => $tag,
706 'ls_value' => $value,
707 'ls_log_id' => $this->id
708 ];
709 }
710 }
711 if ( count( $rows ) ) {
712 $dbw->insert( 'log_search', $rows, __METHOD__, 'IGNORE' );
713 }
714
715 return $this->id;
716 }
717
725 public function getRecentChange( $newId = 0 ) {
726 $formatter = LogFormatter::newFromEntry( $this );
728 $formatter->setContext( $context );
729
730 $logpage = SpecialPage::getTitleFor( 'Log', $this->getType() );
731 $user = $this->getPerformer();
732 $ip = "";
733 if ( $user->isAnon() ) {
734 // "MediaWiki default" and friends may have
735 // no IP address in their name
736 if ( IP::isIPAddress( $user->getName() ) ) {
737 $ip = $user->getName();
738 }
739 }
740
741 return RecentChange::newLogEntry(
742 $this->getTimestamp(),
743 $logpage,
744 $user,
745 $formatter->getPlainActionText(),
746 $ip,
747 $this->getType(),
748 $this->getSubtype(),
749 $this->getTarget(),
750 $this->getComment(),
751 LogEntryBase::makeParamBlob( $this->getParameters() ),
752 $newId,
753 $formatter->getIRCActionComment(), // Used for IRC feeds
754 $this->getAssociatedRevId(), // Used for e.g. moves and uploads
755 $this->getIsPatrollable()
756 );
757 }
758
765 public function publish( $newId, $to = 'rcandudp' ) {
766 DeferredUpdates::addCallableUpdate(
767 function () use ( $newId, $to ) {
768 $log = new LogPage( $this->getType() );
769 if ( !$log->isRestricted() ) {
770 $rc = $this->getRecentChange( $newId );
771
772 if ( $to === 'rc' || $to === 'rcandudp' ) {
773 // save RC, passing tags so they are applied there
774 $tags = $this->getTags();
775 if ( is_null( $tags ) ) {
776 $tags = [];
777 }
778 $rc->addTags( $tags );
779 $rc->save( 'pleasedontudp' );
780 }
781
782 if ( $to === 'udp' || $to === 'rcandudp' ) {
783 $rc->notifyRCFeeds();
784 }
785 }
786 },
787 DeferredUpdates::POSTSEND,
789 );
790 }
791
792 public function getType() {
793 return $this->type;
794 }
795
796 public function getSubtype() {
797 return $this->subtype;
798 }
799
800 public function getParameters() {
801 return $this->parameters;
802 }
803
807 public function getPerformer() {
808 return $this->performer;
809 }
810
814 public function getTarget() {
815 return $this->target;
816 }
817
818 public function getTimestamp() {
819 $ts = $this->timestamp !== null ? $this->timestamp : wfTimestampNow();
820
821 return wfTimestamp( TS_MW, $ts );
822 }
823
824 public function getComment() {
825 return $this->comment;
826 }
827
832 public function getAssociatedRevId() {
833 return $this->revId;
834 }
835
840 public function getTags() {
841 return $this->tags;
842 }
843
850 public function getIsPatrollable() {
851 return $this->isPatrollable;
852 }
853
858 public function isLegacy() {
859 return $this->legacy;
860 }
861
862 public function getDeleted() {
863 return (int)$this->deleted;
864 }
865}
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
serialize()
unserialize( $serialized)
int $wgActorTableSchemaMigrationStage
Actor table schema migration stage.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
This class wraps around database result row.
Definition LogEntry.php:163
getParameters()
Get the extra parameters stored for this message.
Definition LogEntry.php:291
isLegacy()
Whether the parameters for this log are stored in new or old format.
Definition LogEntry.php:277
array $params
Parameters for log entry.
Definition LogEntry.php:247
getSubtype()
The log subtype.
Definition LogEntry.php:287
getDeleted()
Get the access restriction.
Definition LogEntry.php:359
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition LogEntry.php:207
getComment()
Get the user provided comment.
Definition LogEntry.php:355
bool $legacy
Whether the parameters for this log entry are stored in new or old format.
Definition LogEntry.php:253
int $revId
A rev id associated to the log entry.
Definition LogEntry.php:250
getRawParameters()
Returns whatever is stored in the database field.
Definition LogEntry.php:273
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Definition LogEntry.php:172
stdClass $row
Database result row.
Definition LogEntry.php:241
getId()
Returns the unique database id.
Definition LogEntry.php:264
getPerformer()
Get the user for performed this action.
Definition LogEntry.php:320
getTarget()
Get the target page of this action.
Definition LogEntry.php:343
getType()
The main log type.
Definition LogEntry.php:283
static newFromId( $id, IDatabase $db)
Loads a LogEntry with the given id from database.
Definition LogEntry.php:223
getTimestamp()
Get the timestamp when the action was executed.
Definition LogEntry.php:351
Extends the LogEntryInterface with some basic functionality.
Definition LogEntry.php:115
isDeleted( $field)
Definition LogEntry.php:121
isLegacy()
Whether the parameters for this log are stored in new or old format.
Definition LogEntry.php:131
static extractParams( $blob)
Extract a parameter array from a blob.
Definition LogEntry.php:153
static makeParamBlob( $params)
Create a blob from a parameter array.
Definition LogEntry.php:142
getFullType()
The full logtype in format maintype/subtype.
Definition LogEntry.php:117
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Class to simplify the use of log pages.
Definition LogPage.php:31
static extractParams( $blob)
Extract a parameter array from a blob.
Definition LogPage.php:418
MediaWiki exception.
Class for creating log entries manually, to inject them into the database.
Definition LogEntry.php:432
getDeleted()
Get the access restriction.
Definition LogEntry.php:862
getIsPatrollable()
Whether this log entry is patrollable.
Definition LogEntry.php:850
setDeleted( $deleted)
Set the 'deleted' flag.
Definition LogEntry.php:616
string $subtype
Sub type of log entry.
Definition LogEntry.php:437
int $id
ID of the log entry.
Definition LogEntry.php:467
string $type
Type of log entry.
Definition LogEntry.php:434
setTarget(Title $target)
Set the title of the object changed.
Definition LogEntry.php:537
setAssociatedRevId( $revId)
Set an associated revision id.
Definition LogEntry.php:570
insert(IDatabase $dbw=null)
Insert the entry into the logging table.
Definition LogEntry.php:627
string $comment
Comment for the log entry.
Definition LogEntry.php:455
setTimestamp( $timestamp)
Set the timestamp of when the logged action took place.
Definition LogEntry.php:547
array $parameters
Parameters for log entry.
Definition LogEntry.php:440
getTimestamp()
Get the timestamp when the action was executed.
Definition LogEntry.php:818
int $revId
A rev id associated to the log entry.
Definition LogEntry.php:458
setComment( $comment)
Set a comment associated with the action being logged.
Definition LogEntry.php:557
setParameters( $parameters)
Set extra log parameters.
Definition LogEntry.php:506
getComment()
Get the user provided comment.
Definition LogEntry.php:824
bool $isPatrollable
Can this log entry be patrolled?
Definition LogEntry.php:470
getType()
The main log type.
Definition LogEntry.php:792
Title $target
Target title for the log entry.
Definition LogEntry.php:449
int $deleted
Deletion state of the log entry.
Definition LogEntry.php:464
setLegacy( $legacy)
Set the 'legacy' flag.
Definition LogEntry.php:606
setIsPatrollable( $patrollable)
Set whether this log entry should be made patrollable This shouldn't depend on config,...
Definition LogEntry.php:596
getParameters()
Get the extra parameters stored for this message.
Definition LogEntry.php:800
bool $legacy
Whether this is a legacy log entry.
Definition LogEntry.php:473
string $timestamp
Timestamp of creation of the log entry.
Definition LogEntry.php:452
getRecentChange( $newId=0)
Get a RecentChanges object for the log entry.
Definition LogEntry.php:725
User $performer
Performer of the action for the log entry.
Definition LogEntry.php:446
setRelations(array $relations)
Declare arbitrary tag/value relations to this log entry.
Definition LogEntry.php:517
setPerformer(User $performer)
Set the user that performed the action being logged.
Definition LogEntry.php:527
__construct( $type, $subtype)
Definition LogEntry.php:480
setTags( $tags)
Set change tags for the log entry.
Definition LogEntry.php:580
array $tags
Change tags add to the log entry.
Definition LogEntry.php:461
publish( $newId, $to='rcandudp')
Publish the log entry.
Definition LogEntry.php:765
getSubtype()
The log subtype.
Definition LogEntry.php:796
getTimestamp()
Get the timestamp when the action was executed.
Definition LogEntry.php:412
getTarget()
Get the target page of this action.
Definition LogEntry.php:404
getSubtype()
The log subtype.
Definition LogEntry.php:382
getComment()
Get the user provided comment.
Definition LogEntry.php:416
getDeleted()
Get the access restriction.
Definition LogEntry.php:422
getRawParameters()
Returns whatever is stored in the database field.
Definition LogEntry.php:370
getId()
Returns the unique database id.
Definition LogEntry.php:366
getPerformer()
Get the user for performed this action.
Definition LogEntry.php:386
getType()
The main log type.
Definition LogEntry.php:378
static newExtraneousContext(Title $title, $request=[])
Create a new extraneous context.
Represents a title within MediaWiki.
Definition Title.php:39
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition User.php:53
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition User.php:591
static newFromRow( $row, $data=null)
Create a new user object from a user row.
Definition User.php:750
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition User.php:614
static newFromActorId( $id)
Static factory method for creation from a given actor ID.
Definition User.php:629
when a variable name is used in a it is silently declared as a new local masking the global
Definition design.txt:95
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
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest object
Definition globals.txt:64
const MIGRATION_WRITE_NEW
Definition Defines.php:304
const MIGRATION_WRITE_BOTH
Definition Defines.php:303
the array() calling protocol came about after MediaWiki 1.4rc1.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
Definition hooks.txt:2783
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
Definition hooks.txt:1015
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2811
namespace and then decline to actually register it file or subcat img or subcat $title
Definition hooks.txt:964
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
Definition hooks.txt:247
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
Definition injection.txt:37
Interface for log entries.
Definition LogEntry.php:38
isDeleted( $field)
getParameters()
Get the extra parameters stored for this message.
getTimestamp()
Get the timestamp when the action was executed.
getTarget()
Get the target page of this action.
getSubtype()
The log subtype.
getDeleted()
Get the access restriction.
getComment()
Get the user provided comment.
getFullType()
The full logtype in format maintype/subtype.
getPerformer()
Get the user for performed this action.
getType()
The main log type.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38
selectRow( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
Single row SELECT wrapper.
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
Definition postgres.txt:30
const DB_REPLICA
Definition defines.php:25
const DB_MASTER
Definition defines.php:29
$params