if ( !ContentHandler::getForModelID( $params['contentmodel'] )
->isSupportedFormat( $params['contentformat'] )
) {
if ( !ContentHandler::getForModelID( $params['contentmodel'] )
->isSupportedFormat( $params['contentformat'] )
) {
}
if ( $currentRev->getId() == $baseRev->getId() ) {
// Base revision was still the latest; nothing to merge
}
if ( $currentRev->getId() == $baseRev->getId() ) {
// Base revision was still the latest; nothing to merge
if ( !$content ) { // merge3() failed
$this->getResult()->addValue( null,
if ( !$content ) { // merge3() failed
$this->getResult()->addValue( null,
$key = self::getStashKey( $page->getTitle(), $content, $user );
// Let extensions add ParserOutput metadata or warm other caches
$key = self::getStashKey( $page->getTitle(), $content, $user );
// Let extensions add ParserOutput metadata or warm other caches
- Hooks::run( 'ParserOutputStashForEdit', array( $page, $content, $editInfo->output ) );
+ Hooks::run( 'ParserOutputStashForEdit', [ $page, $content, $editInfo->output ] );
list( $stashInfo, $ttl ) = self::buildStashValue(
$editInfo->pstContent, $editInfo->output, $editInfo->timestamp
list( $stashInfo, $ttl ) = self::buildStashValue(
$editInfo->pstContent, $editInfo->output, $editInfo->timestamp
$templateUses = 0; // expected existing templates
foreach ( $editInfo->output->getTemplateIds() as $ns => $stuff ) {
foreach ( $stuff as $dbkey => $revId ) {
$templateUses = 0; // expected existing templates
foreach ( $editInfo->output->getTemplateIds() as $ns => $stuff ) {
foreach ( $stuff as $dbkey => $revId ) {
- array( 'ns' => 'page_namespace', 'dbk' => 'page_title', 'page_latest' ),
+ [ 'ns' => 'page_namespace', 'dbk' => 'page_title', 'page_latest' ],
$dbr->makeWhereFrom2d( $templates, 'page_namespace', 'page_title' ),
__METHOD__
);
$dbr->makeWhereFrom2d( $templates, 'page_namespace', 'page_title' ),
__METHOD__
);
foreach ( $editInfo->output->getFileSearchOptions() as $name => $options ) {
$files[$name] = (string)$options['sha1'];
}
foreach ( $editInfo->output->getFileSearchOptions() as $name => $options ) {
$files[$name] = (string)$options['sha1'];
}
- array( 'name' => 'img_name', 'img_sha1' ),
- array( 'img_name' => array_keys( $files ) ),
+ [ 'name' => 'img_name', 'img_sha1' ],
+ [ 'img_name' => array_keys( $files ) ],
$content->getModel(),
$content->getDefaultFormat(),
sha1( $content->serialize( $content->getDefaultFormat() ) ),
$user->getId() ?: md5( $user->getName() ), // account for user parser options
$user->getId() ? $user->getDBTouched() : '-' // handle preference change races
$content->getModel(),
$content->getDefaultFormat(),
sha1( $content->serialize( $content->getDefaultFormat() ) ),
$user->getId() ?: md5( $user->getName() ), // account for user parser options
$user->getId() ? $user->getDBTouched() : '-' // handle preference change races
if ( $ttl > 0 && !$parserOutput->getFlag( 'vary-revision' ) ) {
// Only store what is actually needed
if ( $ttl > 0 && !$parserOutput->getFlag( 'vary-revision' ) ) {
// Only store what is actually needed
'pstContent' => $pstContent,
'output' => $parserOutput,
'timestamp' => $timestamp
'pstContent' => $pstContent,
'output' => $parserOutput,
'timestamp' => $timestamp
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => 'text',
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => 'text',
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => 'integer',
ApiBase::PARAM_REQUIRED => true
ApiBase::PARAM_TYPE => 'integer',
ApiBase::PARAM_REQUIRED => true