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 ) ) {
438 $this->contentHandler = ContentHandler::getForModelID( $this->
getModel() );
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(),
628 'log_params' => $this->params ],
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(),
645 ] + CommentStore::getStore()->insert( $dbw,
'log_comment', $this->
getComment() )
646 + ActorMigration::newMigration()->getInsertValues( $dbw,
'log_user',
$user );
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 );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
A content handler knows how do deal with a specific type of content on a wiki page.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Represents a revision, log entry or upload during the import process.
__construct(Config $config)
setArchiveName( $archiveName)
setSha1Base36( $sha1base36)
ContentHandler $contentHandler
setFileSrc( $src, $isTemp)
setNoUpdates( $noupdates)
per default it will return the text for text based content
if the prop value should be in the metadata multi language array format
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
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.
Base interface for content objects.
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