$this->keepUploads = !empty( $options['keep-uploads'] );
- $this->fileBackendName = isset( $options['file-backend'] ) ?
- $options['file-backend'] : false;
+ $this->fileBackendName = $options['file-backend'] ?? false;
$this->runDisabled = !empty( $options['run-disabled'] );
$this->runParsoid = !empty( $options['run-parsoid'] );
$setup['wgNoFollowLinks'] = true;
$setup['wgNoFollowDomainExceptions'] = [ 'no-nofollow.org' ];
$setup['wgExternalLinkTarget'] = false;
- $setup['wgExperimentalHtmlIds'] = false;
$setup['wgLocaltimezone'] = 'UTC';
$setup['wgHtml5'] = true;
$setup['wgDisableLangConversion'] = false;
if ( is_int( $name ) ) {
$value();
} else {
- $saved[$name] = isset( $GLOBALS[$name] ) ? $GLOBALS[$name] : null;
+ $saved[$name] = $GLOBALS[$name] ?? null;
$GLOBALS[$name] = $value;
}
}
* @return bool
*/
public function isSetupDone( $funcName ) {
- return isset( $this->setupDone[$funcName] ) ? $this->setupDone[$funcName] : false;
+ return $this->setupDone[$funcName] ?? false;
}
/**
$titleText = 'Parser test';
}
+ if ( isset( $opts['maxincludesize'] ) ) {
+ $options->setMaxIncludeSize( $opts['maxincludesize'] );
+ }
+ if ( isset( $opts['maxtemplatedepth'] ) ) {
+ $options->setMaxTemplateDepth( $opts['maxtemplatedepth'] );
+ }
+
$local = isset( $opts['local'] );
- $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
+ $preprocessor = $opts['preprocessor'] ?? null;
$parser = $this->getParser( $preprocessor );
$title = Title::newFromText( $titleText );
'wgFragmentMode' => [ 'legacy' ],
];
+ $nonIncludable = self::getOptionValue( 'wgNonincludableNamespaces', $opts, false );
+ if ( $nonIncludable !== false ) {
+ $setup['wgNonincludableNamespaces'] = [ $nonIncludable ];
+ }
+
if ( $config ) {
$configLines = explode( "\n", $config );
$teardown[] = $this->markSetupDone( 'setupDatabase' );
# CREATE TEMPORARY TABLE breaks if there is more than one server
- if ( wfGetLB()->getServerCount() != 1 ) {
+ if ( MediaWikiServices::getInstance()->getDBLoadBalancer()->getServerCount() != 1 ) {
$this->useTemporaryTables = false;
}