208 if ( is_object(
$title ) ) {
210 } elseif ( is_null(
$title ) ) {
211 throw new MWException(
"WikiRevision given a null title in import. "
212 .
"You may need to adjust \$wgLegalTitleChars." );
214 throw new MWException(
"WikiRevision given non-object title in import." );
231 # 2003-08-05T18:30:02Z
240 $this->user_text = $user;
248 $this->userObj = $user;
256 $this->user_text = $ip;
288 $this->comment =
$text;
296 $this->minor = (bool)
$minor;
313 $this->fileSrc =
$src;
355 $this->size = intval(
$size );
387 $this->mNoUpdates = $noupdates;
443 if ( is_null( $this->contentHandler ) ) {
455 if ( is_null( $this->content ) ) {
457 $this->content = $handler->unserializeContent( $this->text, $this->
getFormat() );
468 if ( is_null( $this->model ) ) {
469 $this->model = $this->
getTitle()->getContentModel();
480 if ( is_null( $this->format ) ) {
516 if ( $this->sha1base36 ) {
517 return Wikimedia\base_convert( $this->sha1base36, 36, 16 );
527 if ( $this->sha1base36 ) {
611 if ( $this->mNoUpdates ) {
612 $importer = MediaWikiServices::getInstance()->getWikiRevisionOldRevisionImporterNoUpdates();
614 $importer = MediaWikiServices::getInstance()->getWikiRevisionOldRevisionImporter();
616 return $importer->import( $this );
628 # @todo FIXME: This will not record autoblocks
630 wfDebug( __METHOD__ .
": skipping invalid {$this->type}/{$this->action} log time, timestamp " .
631 $this->timestamp .
"\n" );
634 # Check if it exists already
636 $prior = $dbw->selectField(
'logging',
'1',
637 [
'log_type' => $this->
getType(),
639 'log_timestamp' => $dbw->timestamp( $this->timestamp ),
640 'log_namespace' => $this->getTitle()->getNamespace(),
641 'log_title' => $this->getTitle()->getDBkey(),
642 'log_params' => $this->params ],
648 .
": skipping existing item for Log:{$this->type}/{$this->action}, timestamp "
649 . $this->timestamp .
"\n" );
655 'log_timestamp' => $dbw->timestamp( $this->timestamp ),
656 'log_namespace' => $this->
getTitle()->getNamespace(),
657 'log_title' => $this->
getTitle()->getDBkey(),
661 $dbw->insert(
'logging', $data, __METHOD__ );
672 $importer = MediaWikiServices::getInstance()->getWikiRevisionUploadImporter();
673 $statusValue = $importer->import( $this );
674 return $statusValue->isGood();
684 $this->config->get(
'EnableUploads' ),
685 LoggerFactory::getInstance(
'UploadRevisionImporter' )
687 return $importer->downloadSource( $this );