Go to the documentation of this file.
210 if ( is_object(
$title ) ) {
212 } elseif ( is_null(
$title ) ) {
213 throw new MWException(
"WikiRevision given a null title in import. "
214 .
"You may need to adjust \$wgLegalTitleChars." );
216 throw new MWException(
"WikiRevision given non-object title in import." );
233 # 2003-08-05T18:30:02Z
242 $this->user_text =
$user;
250 $this->userObj =
$user;
258 $this->user_text = $ip;
290 $this->comment =
$text;
298 $this->minor = (bool)
$minor;
315 $this->fileSrc =
$src;
349 $this->size = intval(
$size );
381 $this->mNoUpdates = $noupdates;
437 if ( is_null( $this->contentHandler ) ) {
449 if ( is_null( $this->
content ) ) {
462 if ( is_null( $this->model ) ) {
463 $this->model = $this->
getTitle()->getContentModel();
474 if ( is_null( $this->
format ) ) {
510 if ( $this->sha1base36 ) {
511 return Wikimedia\base_convert( $this->sha1base36, 36, 16 );
521 if ( $this->sha1base36 ) {
597 if ( $this->mNoUpdates ) {
598 $importer = MediaWikiServices::getInstance()->getWikiRevisionOldRevisionImporterNoUpdates();
600 $importer = MediaWikiServices::getInstance()->getWikiRevisionOldRevisionImporter();
614 # @todo FIXME: This will not record autoblocks
616 wfDebug( __METHOD__ .
": skipping invalid {$this->type}/{$this->action} log time, timestamp " .
617 $this->timestamp .
"\n" );
620 # Check if it exists already
622 $prior = $dbw->selectField(
'logging',
'1',
623 [
'log_type' => $this->
getType(),
625 'log_timestamp' => $dbw->timestamp( $this->timestamp ),
626 'log_namespace' => $this->
getTitle()->getNamespace(),
627 'log_title' => $this->
getTitle()->getDBkey(),
634 .
": skipping existing item for Log:{$this->type}/{$this->action}, timestamp "
635 . $this->timestamp .
"\n" );
641 'log_timestamp' => $dbw->timestamp( $this->timestamp ),
642 'log_namespace' => $this->
getTitle()->getNamespace(),
643 'log_title' => $this->
getTitle()->getDBkey(),
647 $dbw->insert(
'logging', $data, __METHOD__ );
658 $importer = MediaWikiServices::getInstance()->getWikiRevisionUploadImporter();
659 $statusValue =
$importer->import( $this );
660 return $statusValue->isGood();
670 $this->config->get(
'EnableUploads' ),
671 LoggerFactory::getInstance(
'UploadRevisionImporter' )
673 return $importer->downloadSource( $this );
A content handler knows how do deal with a specific type of content on a wiki page.
static getForModelID( $modelId)
Returns the ContentHandler singleton for the given model ID.
per default it will return the text for text based content
setNoUpdates( $noupdates)
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
setSha1Base36( $sha1base36)
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
__construct(Config $config)
static newMigration()
Static constructor.
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
Interface for configuration instances.
ContentHandler $contentHandler
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
if the prop value should be in the metadata multi language array format
Base interface for content objects.
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
Represents a title within MediaWiki.
Represents a revision, log entry or upload during the import process.
setFileSrc( $src, $isTemp)
setArchiveName( $archiveName)
MediaWiki Logger LoggerFactory implements a PSR[0] compatible message logging system Named Psr Log LoggerInterface instances can be obtained from the MediaWiki Logger LoggerFactory::getInstance() static method. MediaWiki\Logger\LoggerFactory expects a class implementing the MediaWiki\Logger\Spi interface to act as a factory for new Psr\Log\LoggerInterface instances. The "Spi" in MediaWiki\Logger\Spi stands for "service provider interface". An SPI is an API intended to be implemented or extended by a third party. This software design pattern is intended to enable framework extension and replaceable components. It is specifically used in the MediaWiki\Logger\LoggerFactory service to allow alternate PSR-3 logging implementations to be easily integrated with MediaWiki. The service provider interface allows the backend logging library to be implemented in multiple ways. The $wgMWLoggerDefaultSpi global provides the classname of the default MediaWiki\Logger\Spi implementation to be loaded at runtime. This can either be the name of a class implementing the MediaWiki\Logger\Spi with a zero argument const ructor or a callable that will return an MediaWiki\Logger\Spi instance. Alternately the MediaWiki\Logger\LoggerFactory MediaWiki Logger LoggerFactory
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 MediaWikiServices
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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 as and are nearing end of 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