a redirect and its target.
* (bug 43849) ApiQueryImageInfo no longer throws exceptions with ForeignDBRepo
redirects.
+* On error, any warnings generated before that error will be shown in the result.
=== API internal changes in 1.21 ===
* For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
# includes/site
'MediaWikiSite' => 'includes/site/MediaWikiSite.php',
'Site' => 'includes/site/Site.php',
- 'SiteArray' => 'includes/site/SiteArray.php',
+ 'SiteObject' => 'includes/site/Site.php',
+ 'SiteArray' => 'includes/site/SiteList.php',
'SiteList' => 'includes/site/SiteList.php',
- 'SiteObject' => 'includes/site/SiteObject.php',
- 'Sites' => 'includes/site/Sites.php',
- 'SitesTable' => 'includes/site/SitesTable.php',
+ 'SiteSQLStore' => 'includes/site/SiteSQLStore.php',
+ 'Sites' => 'includes/site/SiteSQLStore.php',
+ 'SiteStore' => 'includes/site/SiteStore.php',
# includes/specials
'ActiveUsersPager' => 'includes/specials/SpecialActiveusers.php',
$height_orig = $this->displayImg->getHeight( $page );
$height = $height_orig;
- $longDesc = wfMessage( 'parentheses', $this->displayImg->getLongDesc() )->text();
+ $filename = wfEscapeWikiText( $this->displayImg->getName() );
+ $linktext = $filename;
wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$out ) );
# Note that $height <= $maxHeight now, but might not be identical
# because of rounding.
}
- $msgbig = wfMessage( 'show-big-image' )->escaped();
+ $linktext = wfMessage( 'show-big-image' )->escaped();
if ( $this->displayImg->getRepo()->canTransformVia404() ) {
$thumbSizes = $wgImageLimits;
} else {
$params['height'] = $height;
$thumbnail = $this->displayImg->transform( $params );
- $showLink = true;
$anchorclose = Html::rawElement( 'div', array( 'class' => 'mw-filepage-resolutioninfo' ), $msgsmall );
$isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1;
"<hr />$thumb1\n$thumb2<br style=\"clear: both\" /></div></td></tr></table>"
);
}
- } else {
+ } elseif ( $this->displayImg->isSafeFile() ) {
# if direct link is allowed but it's not a renderable image, show an icon.
- if ( $this->displayImg->isSafeFile() ) {
- $icon = $this->displayImg->iconThumb();
-
- $out->addHTML( '<div class="fullImageLink" id="file">' .
- $icon->toHtml( array( 'file-link' => true ) ) .
- "</div>\n" );
- }
+ $icon = $this->displayImg->iconThumb();
- $showLink = true;
+ $out->addHTML( '<div class="fullImageLink" id="file">' .
+ $icon->toHtml( array( 'file-link' => true ) ) .
+ "</div>\n" );
}
- if ( $showLink ) {
- $filename = wfEscapeWikiText( $this->displayImg->getName() );
- $linktext = $filename;
- if ( isset( $msgbig ) ) {
- $linktext = wfEscapeWikiText( $msgbig );
- }
- $medialink = "[[Media:$filename|$linktext]]";
-
- if ( !$this->displayImg->isSafeFile() ) {
- $warning = wfMessage( 'mediawarning' )->plain();
- // dirmark is needed here to separate the file name, which
- // most likely ends in Latin characters, from the description,
- // which may begin with the file type. In RTL environment
- // this will get messy.
- // The dirmark, however, must not be immediately adjacent
- // to the filename, because it can get copied with it.
- // See bug 25277.
- $out->addWikiText( <<<EOT
+ $longDesc = wfMessage( 'parentheses', $this->displayImg->getLongDesc() )->text();
+
+ $medialink = "[[Media:$filename|$linktext]]";
+
+ if ( !$this->displayImg->isSafeFile() ) {
+ $warning = wfMessage( 'mediawarning' )->plain();
+ // dirmark is needed here to separate the file name, which
+ // most likely ends in Latin characters, from the description,
+ // which may begin with the file type. In RTL environment
+ // this will get messy.
+ // The dirmark, however, must not be immediately adjacent
+ // to the filename, because it can get copied with it.
+ // See bug 25277.
+ $out->addWikiText( <<<EOT
<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span></div>
<div class="mediaWarning">$warning</div>
EOT
- );
- } else {
- $out->addWikiText( <<<EOT
+ );
+ } else {
+ $out->addWikiText( <<<EOT
<div class="fullMedia">{$medialink} {$dirmark}<span class="fileInfo">$longDesc</span>
</div>
EOT
- );
- }
+ );
}
// Add cannot animate thumbnail warning
}
}
- // Handle any kind of exception by outputing properly formatted error message.
+ // Handle any kind of exception by outputting properly formatted error message.
// If this fails, an unhandled exception should be thrown so that global error
// handler will process and log it.
if ( $this->mPrinter->getWantsHelp() || $this->mAction == 'help' ) {
ApiResult::setContent( $errMessage, $this->makeHelpMsg() );
}
-
} else {
global $wgShowSQLErrors, $wgShowExceptionDetails;
// Something is seriously wrong
ApiResult::setContent( $errMessage, $wgShowExceptionDetails ? "\n\n{$e->getTraceAsString()}\n\n" : '' );
}
+ // Remember all the warnings to re-add them later
+ $oldResult = $result->getData();
+ $warnings = isset( $oldResult['warnings'] ) ? $oldResult['warnings'] : null;
+
$result->reset();
$result->disableSizeCheck();
// Re-add the id
if ( !is_null( $requestid ) ) {
$result->addValue( null, 'requestid', $requestid );
}
-
if ( $wgShowHostnames ) {
// servedby is especially useful when debugging errors
$result->addValue( null, 'servedby', wfHostName() );
}
+ if ( $warnings !== null ) {
+ $result->addValue( null, 'warnings', $warnings );
+ }
$result->addValue( null, 'error', $errMessage );
$request = $this->getMain()->getRequest();
// Check if async mode is actually supported
$this->mParams['async'] = ( $this->mParams['async'] && !wfIsWindows() );
+ $this->mParams['async'] = false; // XXX: disabled per bug 44080
// Add the uploaded file to the params array
$this->mParams['file'] = $request->getFileName( 'file' );
$this->mParams['chunk'] = $request->getFileName( 'chunk' );
# Split database and table into proper variables.
# We reverse the explode so that database.table and table both output
# the correct table.
- $dbDetails = array_reverse( explode( '.', $name, 2 ) );
- if ( isset( $dbDetails[1] ) ) {
- list( $table, $database ) = $dbDetails;
+ $dbDetails = explode( '.', $name, 2 );
+ if ( count( $dbDetails ) == 2 ) {
+ list( $database, $table ) = $dbDetails;
+ # We don't want any prefix added in this case
+ $prefix = '';
} else {
list( $table ) = $dbDetails;
- }
- $prefix = $this->mTablePrefix; # Default prefix
-
- # A database name has been specified in input. We don't want any
- # prefixes added.
- if ( isset( $database ) ) {
- $prefix = '';
+ if ( $wgSharedDB !== null # We have a shared database
+ && !$this->isQuotedIdentifier( $table ) # Paranoia check to prevent shared tables listing '`table`'
+ && in_array( $table, $wgSharedTables ) # A shared table is selected
+ ) {
+ $database = $wgSharedDB;
+ $prefix = $wgSharedPrefix === null ? $this->mTablePrefix : $wgSharedPrefix;
+ } else {
+ $database = null;
+ $prefix = $this->mTablePrefix; # Default prefix
+ }
}
- # Note that we use the long format because php will complain in in_array if
- # the input is not an array, and will complain in is_array if it is not set.
- if ( !isset( $database ) # Don't use shared database if pre selected.
- && isset( $wgSharedDB ) # We have a shared database
- && !$this->isQuotedIdentifier( $table ) # Paranoia check to prevent shared tables listing '`table`'
- && isset( $wgSharedTables )
- && is_array( $wgSharedTables )
- && in_array( $table, $wgSharedTables ) ) { # A shared table is selected
- $database = $wgSharedDB;
- $prefix = isset( $wgSharedPrefix ) ? $wgSharedPrefix : $prefix;
+ # Quote $table and apply the prefix if not quoted.
+ $tableName = "{$prefix}{$table}";
+ if ( $format == 'quoted' && !$this->isQuotedIdentifier( $tableName ) ) {
+ $tableName = $this->addIdentifierQuotes( $tableName );
}
- # Quote the $database and $table and apply the prefix if not quoted.
- if ( isset( $database ) ) {
+ # Quote $database and merge it with the table name if needed
+ if ( $database !== null ) {
if ( $format == 'quoted' && !$this->isQuotedIdentifier( $database ) ) {
$database = $this->addIdentifierQuotes( $database );
}
+ $tableName = $database . '.' . $tableName;
}
- $table = "{$prefix}{$table}";
- if ( $format == 'quoted' && !$this->isQuotedIdentifier( $table ) ) {
- $table = $this->addIdentifierQuotes( "{$table}" );
- }
-
- # Merge our database and table into our final table name.
- $tableName = ( isset( $database ) ? "{$database}.{$table}" : "{$table}" );
-
return $tableName;
}
$objects = $container->list_objects( $limit, $after, $prefix );
foreach ( $objects as $object ) { // files
$objectDir = $this->getParentDir( $object ); // directory of object
- if ( $objectDir !== false ) { // file has a parent dir
+ if ( $objectDir !== false && $objectDir !== $dir ) {
// Swift stores paths in UTF-8, using binary sorting.
// See function "create_container_table" in common/db.py.
// If a directory is not "greater" than the last one,
'config-optional-continue' => '多问我一些问题吧。',
'config-optional-skip' => '我已经不耐烦了,赶紧安装我的wiki。',
'config-profile' => '用户权限配置:',
- 'config-profile-wiki' => '传统wiki',
+ 'config-profile-wiki' => '开放的wiki',
'config-profile-no-anon' => '需要注册帐号',
'config-profile-fishbowl' => '编辑受限',
'config-profile-private' => '非公开wiki',
您可能要对它们进行额外的配置,但您现在可以启用它们。',
'config-install-alreadydone' => "'''警告:'''您似乎已经安装了MediaWiki,并试图重新安装它。请前往下一个页面。",
- 'config-install-begin' => '点击“{{int:config-continue}}”后,您将开始安装MediaWiki。如果您还想对配置作一些修改,请点击后退。',
+ 'config-install-begin' => '点击“{{int:config-continue}}”后,您将开始安装MediaWiki。如果您还想对配置作一些修改,请点击“{{int:config-back}}”。',
'config-install-step-done' => '完成',
'config-install-step-failed' => '失败',
'config-install-extensions' => '正在启用扩展',
== 入门 ==
* [//www.mediawiki.org/wiki/Manual:Configuration_settings MediaWiki配置设置列表]
* [//www.mediawiki.org/wiki/Manual:FAQ/zh-hans MediaWiki常见问题]
-* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki发布邮件列表]', # Fuzzy
+* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki发布邮件列表]
+* [//www.mediawiki.org/wiki/Localisation#Translation_resources 本地化MediaWiki到您的语言]',
);
/** Traditional Chinese (中文(繁體))
if ( $paramString != '' ) {
$paramString .= ' ';
}
+
+ if ( is_array( $value ) ) {
+ $value = "array(" . count( $value ) . ")";
+ } else if ( is_object( $value ) && !method_exists( $value, '__toString' ) ) {
+ $value = "object(" . get_class( $value ) . ")";
+ }
+
$paramString .= "$key=$value";
}
}
'lookahead_not_open_brace' => null,
'lookahead_not_closing_paren' => null,
'lookahead_for_closing_paren' => null,
+ 'lookahead_not_letter' => '(?![a-zA-Z])',
'lookbehind_not_letter' => '(?<![a-zA-Z])',
'chars_within_selector' => '[^\}]*?',
'noflip_annotation' => '\/\*\s*@noflip\s*\*\/',
$patterns['noflip_class'] = "/({$patterns['noflip_annotation']}{$patterns['chars_within_selector']}})/i";
$patterns['direction_ltr'] = "/({$patterns['direction']})ltr/i";
$patterns['direction_rtl'] = "/({$patterns['direction']})rtl/i";
- $patterns['left'] = "/{$patterns['lookbehind_not_letter']}(left){$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
- $patterns['right'] = "/{$patterns['lookbehind_not_letter']}(right){$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
+ $patterns['left'] = "/{$patterns['lookbehind_not_letter']}(left){$patterns['lookahead_not_letter']}{$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
+ $patterns['right'] = "/{$patterns['lookbehind_not_letter']}(right){$patterns['lookahead_not_letter']}{$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
$patterns['left_in_url'] = "/{$patterns['lookbehind_not_letter']}(left){$patterns['lookahead_for_closing_paren']}/i";
$patterns['right_in_url'] = "/{$patterns['lookbehind_not_letter']}(right){$patterns['lookahead_for_closing_paren']}/i";
$patterns['ltr_in_url'] = "/{$patterns['lookbehind_not_letter']}(ltr){$patterns['lookahead_for_closing_paren']}/i";
*
* @ingroup Site
*/
-class MediaWikiSite extends SiteObject {
+class MediaWikiSite extends Site {
const PATH_FILE = 'file_path';
const PATH_PAGE = 'page_path';
/**
* @since 1.21
+ * @deprecated Just use the constructor or the factory Site::newForType
*
* @param integer $globalId
*
* @return MediaWikiSite
*/
public static function newFromGlobalId( $globalId ) {
- return SitesTable::singleton()->newRow( array(
- 'type' => Site::TYPE_MEDIAWIKI,
- 'global_key' => $globalId,
- ), true );
+ $site = new static();
+ $site->setGlobalId( $globalId );
+ return $site;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @since 1.21
+ *
+ * @param string $type
+ */
+ public function __construct( $type = self::TYPE_MEDIAWIKI ) {
+ parent::__construct( $type );
}
/**
* @param array $externalData A reply from the API on a external server.
* @param string $pageTitle Identifies the page at the external site, needing normalization.
*
- * @return array|false a 'page' structure representing the page identified by $pageTitle.
+ * @return array|boolean a 'page' structure representing the page identified by $pageTitle.
*/
private static function extractPageRecord( $externalData, $pageTitle ) {
// If there is a special case with only one returned page
}
/**
- * @see Site::getPagePath
+ * @see Site::getPageUrl
*
* This implementation returns a URL constructed using the path returned by getLinkPath().
- * In addition to the default behaviour implemented by SiteObject::getPageUrl(), this
+ * In addition to the default behaviour implemented by Site::getPageUrl(), this
* method converts the $pageName to DBKey-format by replacing spaces with underscores
* before using it in the URL.
*
* @since 1.21
*
- * @param $pagename string: Page name (default: false)
+ * @param string|boolean $pageName Page name or false (default: false)
*
* @return string
*/
*
* @since 1.21
*
- * @param string|false $path
+ * @param string|boolean $path
*
* @return string
*/
<?php
/**
- * Interface for site objects.
+ * Represents a single site.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @license GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-interface Site {
+class Site {
const TYPE_UNKNOWN = 'unknown';
const TYPE_MEDIAWIKI = 'mediawiki';
const SOURCE_LOCAL = 'local';
+ const PATH_LINK = 'link';
+
/**
- * Returns the global site identifier (ie enwiktionary).
+ * @since 1.21
*
+ * @var string|null
+ */
+ protected $globalId = null;
+
+ /**
* @since 1.21
*
- * @return string
+ * @var string
*/
- public function getGlobalId();
+ protected $type = self::TYPE_UNKNOWN;
/**
- * Sets the global site identifier (ie enwiktionary).
+ * @since 1.21
*
+ * @var string
+ */
+ protected $group = self::GROUP_NONE;
+
+ /**
* @since 1.21
*
- * @param string $globalId
+ * @var string
*/
- public function setGlobalId( $globalId );
+ protected $source = self::SOURCE_LOCAL;
/**
- * Returns the type of the site (ie mediawiki).
+ * @since 1.21
+ *
+ * @var string|null
+ */
+ protected $languageCode = null;
+
+ /**
+ * Holds the local ids for this site.
+ * local id type => [ ids for this type (strings) ]
*
* @since 1.21
*
- * @return string
+ * @var array[]
*/
- public function getType();
+ protected $localIds = array();
/**
- * Sets the type of the site (ie mediawiki).
- * TODO: remove, we cannot change this after instantiation
+ * @since 1.21
+ *
+ * @var array
+ */
+ protected $extraData = array();
+
+ /**
+ * @since 1.21
+ *
+ * @var array
+ */
+ protected $extraConfig = array();
+
+ /**
+ * @since 1.21
+ *
+ * @var bool
+ */
+ protected $forward = false;
+
+ /**
+ * @since 1.21
+ *
+ * @var int|null
+ */
+ protected $internalId = null;
+
+ /**
+ * Constructor.
*
* @since 1.21
*
* @param string $type
*/
- public function setType( $type );
+ public function __construct( $type = self::TYPE_UNKNOWN ) {
+ $this->type = $type;
+ }
+
+ /**
+ * Returns the global site identifier (ie enwiktionary).
+ *
+ * @since 1.21
+ *
+ * @return string|null
+ */
+ public function getGlobalId() {
+ return $this->globalId;
+ }
+
+ /**
+ * Sets the global site identifier (ie enwiktionary).
+ *
+ * @since 1.21
+ *
+ * @param string|null $globalId
+ *
+ * @throws MWException
+ */
+ public function setGlobalId( $globalId ) {
+ if ( $globalId !== null && !is_string( $globalId ) ) {
+ throw new MWException( '$globalId needs to be string or null' );
+ }
+
+ $this->globalId = $globalId;
+ }
+
+ /**
+ * Returns the type of the site (ie mediawiki).
+ *
+ * @since 1.21
+ *
+ * @return string
+ */
+ public function getType() {
+ return $this->type;
+ }
/**
* Gets the type of the site (ie wikipedia).
*
* @return string
*/
- public function getGroup();
+ public function getGroup() {
+ return $this->group;
+ }
/**
* Sets the type of the site (ie wikipedia).
* @since 1.21
*
* @param string $group
+ *
+ * @throws MWException
*/
- public function setGroup( $group );
+ public function setGroup( $group ) {
+ if ( !is_string( $group ) ) {
+ throw new MWException( '$group needs to be a string' );
+ }
+
+ $this->group = $group;
+ }
/**
* Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
*
* @return string
*/
- public function getSource();
+ public function getSource() {
+ return $this->source;
+ }
/**
* Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
* @since 1.21
*
* @param string $source
+ *
+ * @throws MWException
*/
- public function setSource( $source );
+ public function setSource( $source ) {
+ if ( !is_string( $source ) ) {
+ throw new MWException( '$source needs to be a string' );
+ }
+
+ $this->source = $source;
+ }
/**
- * Returns the protocol of the site, ie 'http://', 'irc://', '//'
- * Or false if it's not known.
+ * Gets if site.tld/path/key:pageTitle should forward users to the page on
+ * the actual site, where "key" is the local identifier.
*
* @since 1.21
*
- * @return string|false
+ * @return boolean
*/
- public function getProtocol();
+ public function shouldForward() {
+ return $this->forward;
+ }
+
+ /**
+ * Sets if site.tld/path/key:pageTitle should forward users to the page on
+ * the actual site, where "key" is the local identifier.
+ *
+ * @since 1.21
+ *
+ * @param boolean $shouldForward
+ *
+ * @throws MWException
+ */
+ public function setForward( $shouldForward ) {
+ if ( !is_bool( $shouldForward ) ) {
+ throw new MWException( '$shouldForward needs to be a boolean' );
+ }
+
+ $this->forward = $shouldForward;
+ }
/**
* Returns the domain of the site, ie en.wikipedia.org
*
* @since 1.21
*
- * @return string|false
+ * @return string|null
+ */
+ public function getDomain() {
+ $path = $this->getLinkPath();
+
+ if ( $path === null ) {
+ return null;
+ }
+
+ return parse_url( $path, PHP_URL_HOST );
+ }
+
+ /**
+ * Returns the protocol of the site.
+ *
+ * @since 1.21
+ *
+ * @throws MWException
+ * @return string
*/
- public function getDomain();
+ public function getProtocol() {
+ $path = $this->getLinkPath();
+
+ if ( $path === null ) {
+ return '';
+ }
+
+ $protocol = parse_url( $path, PHP_URL_SCHEME );
+
+ // Malformed URL
+ if ( $protocol === false ) {
+ throw new MWException( "failed to parse URL '$path'" );
+ }
+
+ // No schema
+ if ( $protocol === null ) {
+ // Used for protocol relative URLs
+ $protocol = '';
+ }
+
+ return $protocol;
+ }
+
+ /**
+ * Sets the path used to construct links with.
+ * Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
+ *
+ * @param string $fullUrl
+ *
+ * @since 1.21
+ *
+ * @throws MWException
+ */
+ public function setLinkPath( $fullUrl ) {
+ $type = $this->getLinkPathType();
+
+ if ( $type === null ) {
+ throw new MWException( "This Site does not support link paths." );
+ }
+
+ $this->setPath( $type, $fullUrl );
+ }
+
+ /**
+ * Returns the path used to construct links with or false if there is no such path.
+ *
+ * Shall be equivalent to getPath( getLinkPathType() ).
+ *
+ * @return string|null
+ */
+ public function getLinkPath() {
+ $type = $this->getLinkPathType();
+ return $type === null ? null: $this->getPath( $type );
+ }
+
+ /**
+ * Returns the main path type, that is the type of the path that should generally be used to construct links
+ * to the target site.
+ *
+ * This default implementation returns Site::PATH_LINK as the default path type. Subclasses can override this
+ * to define a different default path type, or return false to disable site links.
+ *
+ * @since 1.21
+ *
+ * @return string|null
+ */
+ public function getLinkPathType() {
+ return self::PATH_LINK;
+ }
/**
* Returns the full URL for the given page on the site.
* This generated URL is usually based upon the path returned by getLinkPath(),
* but this is not a requirement.
*
+ * This implementation returns a URL constructed using the path returned by getLinkPath().
+ *
* @since 1.21
- * @see Site::getLinkPath()
*
- * @param bool|String $page
+ * @param bool|String $pageName
*
- * @return string|false
+ * @return string|boolean false
*/
- public function getPageUrl( $page = false );
+ public function getPageUrl( $pageName = false ) {
+ $url = $this->getLinkPath();
+
+ if ( $url === false ) {
+ return false;
+ }
+
+ if ( $pageName !== false ) {
+ $url = str_replace( '$1', rawurlencode( $pageName ), $url ) ;
+ }
+
+ return $url;
+ }
/**
- * Returns language code of the sites primary language.
- * Or false if it's not known.
+ * Returns $pageName without changes.
+ * Subclasses may override this to apply some kind of normalization.
+ *
+ * @see Site::normalizePageName
*
* @since 1.21
*
- * @return string|false
+ * @param string $pageName
+ *
+ * @return string
*/
- public function getLanguageCode();
+ public function normalizePageName( $pageName ) {
+ return $pageName;
+ }
/**
- * Sets language code of the sites primary language.
+ * Returns the type specific fields.
*
* @since 1.21
*
- * @param string $languageCode
+ * @return array
*/
- public function setLanguageCode( $languageCode );
+ public function getExtraData() {
+ return $this->extraData;
+ }
/**
- * Returns the normalized, canonical form of the given page name.
- * How normalization is performed or what the properties of a normalized name are depends on the site.
- * The general contract of this method is that the normalized form shall refer to the same content
- * as the original form, and any other page name referring to the same content will have the same normalized form.
+ * Sets the type specific fields.
+ *
+ * @since 1.21
*
- * Note that this method may call out to the target site to perform the normalization, so it may be slow
- * and fail due to IO errors.
+ * @param array $extraData
+ */
+ public function setExtraData( array $extraData ) {
+ $this->extraData = $extraData;
+ }
+
+ /**
+ * Returns the type specific config.
*
* @since 1.21
*
- * @param string $pageName
+ * @return array
+ */
+ public function getExtraConfig() {
+ return $this->extraConfig;
+ }
+
+ /**
+ * Sets the type specific config.
+ *
+ * @since 1.21
*
- * @return string the normalized page name
+ * @param array $extraConfig
*/
- public function normalizePageName( $pageName );
+ public function setExtraConfig( array $extraConfig ) {
+ $this->extraConfig = $extraConfig;
+ }
/**
- * Returns the interwiki link identifiers that can be used for this site.
+ * Returns language code of the sites primary language.
+ * Or null if it's not known.
*
* @since 1.21
*
- * @return array of string
+ * @return string|null
*/
- public function getInterwikiIds();
+ public function getLanguageCode() {
+ return $this->languageCode;
+ }
/**
- * Returns the equivalent link identifiers that can be used to make
- * the site show up in interfaces such as the "language links" section.
+ * Sets language code of the sites primary language.
*
* @since 1.21
*
- * @return array of string
+ * @param string $languageCode
*/
- public function getNavigationIds();
+ public function setLanguageCode( $languageCode ) {
+ $this->languageCode = $languageCode;
+ }
/**
- * Adds an local identifier to the site.
+ * Returns the set internal identifier for the site.
*
* @since 1.21
*
- * @param string $type The type of the identifier, element of the Site::ID_ enum
- * @param string $identifier
+ * @return string|null
*/
- public function addLocalId( $type, $identifier );
+ public function getInternalId() {
+ return $this->internalId;
+ }
/**
- * Adds an interwiki id to the site.
+ * Sets the internal identifier for the site.
+ * This typically is a primary key in a db table.
*
* @since 1.21
*
- * @param string $identifier
+ * @param int|null $internalId
*/
- public function addInterwikiId( $identifier );
+ public function setInternalId( $internalId = null ) {
+ $this->internalId = $internalId;
+ }
/**
- * Adds a navigation id to the site.
+ * Adds a local identifier.
*
* @since 1.21
*
+ * @param string $type
* @param string $identifier
*/
- public function addNavigationId( $identifier );
+ public function addLocalId( $type, $identifier ) {
+ if ( $this->localIds === false ) {
+ $this->localIds = array();
+ }
+
+ if ( !array_key_exists( $type, $this->localIds ) ) {
+ $this->localIds[$type] = array();
+ }
+
+ if ( !in_array( $identifier, $this->localIds[$type] ) ) {
+ $this->localIds[$type][] = $identifier;
+ }
+ }
/**
- * Saves the site.
+ * Adds an interwiki id to the site.
*
* @since 1.21
*
- * @param string|null $functionName
+ * @param string $identifier
*/
- public function save( $functionName = null );
+ public function addInterwikiId( $identifier ) {
+ $this->addLocalId( self::ID_INTERWIKI, $identifier );
+ }
/**
- * Returns the internal ID of the site.
+ * Adds a navigation id to the site.
*
* @since 1.21
*
- * @return integer
+ * @param string $identifier
*/
- public function getInternalId();
+ public function addNavigationId( $identifier ) {
+ $this->addLocalId( self::ID_EQUIVALENT, $identifier );
+ }
/**
- * Sets the provided url as path of the specified type.
+ * Returns the interwiki link identifiers that can be used for this site.
*
* @since 1.21
*
- * @param string $pathType
- * @param string $fullUrl
+ * @return string[]
*/
- public function setPath( $pathType, $fullUrl );
+ public function getInterwikiIds() {
+ return array_key_exists( self::ID_INTERWIKI, $this->localIds ) ? $this->localIds[self::ID_INTERWIKI] : array();
+ }
/**
- * Returns the path of the provided type or false if there is no such path.
+ * Returns the equivalent link identifiers that can be used to make
+ * the site show up in interfaces such as the "language links" section.
*
* @since 1.21
*
- * @param string $pathType
+ * @return string[]
+ */
+ public function getNavigationIds() {
+ return array_key_exists( self::ID_EQUIVALENT, $this->localIds ) ? $this->localIds[self::ID_EQUIVALENT] : array();
+ }
+
+ /**
+ * Returns all local ids
+ *
+ * @since 1.21
*
- * @return string|false
+ * @return array[]
*/
- public function getPath( $pathType );
+ public function getLocalIds() {
+ return $this->localIds;
+ }
/**
* Sets the path used to construct links with.
* Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
*
+ * @since 1.21
+ *
+ * @param string $pathType
* @param string $fullUrl
*
- * @since 1.21
+ * @throws MWException
*/
- public function setLinkPath( $fullUrl );
+ public function setPath( $pathType, $fullUrl ) {
+ if ( !is_string( $fullUrl ) ) {
+ throw new MWException( '$fullUrl needs to be a string' );
+ }
- /**
- * Returns the path used to construct links with or false if there is no such path.
- * Shall be equivalent to getPath( getLinkPathType() ).
- *
- * @return string|false
- */
- public function getLinkPath();
+ if ( !array_key_exists( 'paths', $this->extraData ) ) {
+ $this->extraData['paths'] = array();
+ }
+
+ $this->extraData['paths'][$pathType] = $fullUrl;
+ }
/**
- * Returns the path type used to construct links with.
+ * Returns the path of the provided type or false if there is no such path.
+ *
+ * @since 1.21
+ *
+ * @param string $pathType
*
- * @return string|false
+ * @return string|null
*/
- public function getLinkPathType();
+ public function getPath( $pathType ) {
+ $paths = $this->getAllPaths();
+ return array_key_exists( $pathType, $paths ) ? $paths[$pathType] : null;
+ }
/**
* Returns the paths as associative array.
*
* @since 1.21
*
- * @return array of string
+ * @return string[]
*/
- public function getAllPaths();
+ public function getAllPaths() {
+ return array_key_exists( 'paths', $this->extraData ) ? $this->extraData['paths'] : array();
+ }
/**
* Removes the path of the provided type if it's set.
*
* @param string $pathType
*/
- public function removePath( $pathType );
+ public function removePath( $pathType ) {
+ if ( array_key_exists( 'paths', $this->extraData ) ) {
+ unset( $this->extraData['paths'][$pathType] );
+ }
+ }
-}
\ No newline at end of file
+ // TODO: config
+
+ /**
+ * @since 1.21
+ *
+ * @param string $siteType
+ *
+ * @return Site
+ */
+ public static function newForType( $siteType ) {
+ global $wgSiteTypes;
+
+ if ( array_key_exists( $siteType, $wgSiteTypes ) ) {
+ return new $wgSiteTypes[$siteType]();
+ }
+
+ return new Site();
+ }
+
+}
+
+/**
+ * @deprecated
+ */
+class SiteObject extends Site {}
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Implementation of SiteList using GenericArrayObject.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @since 1.21
- *
- * @file
- * @ingroup Site
- *
- * @license GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class SiteArray extends GenericArrayObject implements SiteList {
- /**
- * Update this version number when the SiteArray format
- * changes in an incompatible way
- *
- * @since 1.21
- *
- * @var integer
- */
- const CACHE_VERSION = 1;
-
- /**
- * Version number of the SiteArray format of the currently used object
- *
- * @since 1.21
- *
- * @var integer
- */
- public $cacheVersion = self::CACHE_VERSION;
-
- /**
- * Internal site identifiers pointing to their sites offset value.
- *
- * @since 1.21
- *
- * @var array of integer
- */
- protected $byInternalId = array();
-
- /**
- * Global site identifiers pointing to their sites offset value.
- *
- * @since 1.21
- *
- * @var array of string
- */
- protected $byGlobalId = array();
-
- /**
- * @see GenericArrayObject::getObjectType
- *
- * @since 1.21
- *
- * @return string
- */
- public function getObjectType() {
- return 'Site';
- }
-
- /**
- * @see GenericArrayObject::preSetElement
- *
- * @since 1.21
- *
- * @param int|string $index
- * @param Site $site
- *
- * @return boolean
- */
- protected function preSetElement( $index, $site ) {
- if ( $this->hasSite( $site->getGlobalId() ) ) {
- $this->removeSite( $site->getGlobalId() );
- }
-
- $this->byGlobalId[$site->getGlobalId()] = $index;
- $this->byInternalId[$site->getInternalId()] = $index;
-
- return true;
- }
-
- /**
- * @see ArrayObject::offsetUnset()
- *
- * @since 1.21
- *
- * @param mixed $index
- */
- public function offsetUnset( $index ) {
- if ( $this->offsetExists( $index ) ) {
- /**
- * @var Site $site
- */
- $site = $this->offsetGet( $index );
-
- unset( $this->byGlobalId[$site->getGlobalId()] );
- unset( $this->byInternalId[$site->getInternalId()] );
- }
-
- parent::offsetUnset( $index );
- }
-
- /**
- * @see SiteList::getGlobalIdentifiers
- *
- * @since 1.21
- *
- * @return array
- */
- public function getGlobalIdentifiers() {
- return array_keys( $this->byGlobalId );
- }
-
- /**
- * @see SiteList::hasSite
- *
- * @param string $globalSiteId
- *
- * @return boolean
- */
- public function hasSite( $globalSiteId ) {
- return array_key_exists( $globalSiteId, $this->byGlobalId );
- }
-
- /**
- * @see SiteList::getSite
- *
- * @since 1.21
- *
- * @param string $globalSiteId
- *
- * @return Site
- */
- public function getSite( $globalSiteId ) {
- return $this->offsetGet( $this->byGlobalId[$globalSiteId] );
- }
-
- /**
- * @see SiteList::removeSite
- *
- * @since 1.21
- *
- * @param string $globalSiteId
- */
- public function removeSite( $globalSiteId ) {
- $this->offsetUnset( $this->byGlobalId[$globalSiteId] );
- }
-
- /**
- * @see SiteList::isEmpty
- *
- * @since 1.21
- *
- * @return boolean
- */
- public function isEmpty() {
- return $this->byGlobalId === array();
- }
-
- /**
- * @see SiteList::hasInternalId
- *
- * @param integer $id
- *
- * @return boolean
- */
- public function hasInternalId( $id ) {
- return array_key_exists( $id, $this->byInternalId );
- }
-
- /**
- * @see SiteList::getSiteByInternalId
- *
- * @since 1.21
- *
- * @param integer $id
- *
- * @return Site
- */
- public function getSiteByInternalId( $id ) {
- return $this->offsetGet( $this->byInternalId[$id] );
- }
-
- /**
- * @see SiteList::removeSiteByInternalId
- *
- * @since 1.21
- *
- * @param integer $id
- */
- public function removeSiteByInternalId( $id ) {
- $this->offsetUnset( $this->byInternalId[$id] );
- }
-
- /**
- * @see SiteList::setSite
- *
- * @since 1.21
- *
- * @param Site $site
- */
- public function setSite( Site $site ) {
- $this[] = $site;
- }
-
- /**
- * @see GenericArrayObject::getSerializationData
- *
- * @since 1.21
- *
- * @return array
- */
- protected function getSerializationData() {
- return array_merge(
- parent::getSerializationData(),
- array(
- 'cacheVersion' => self::CACHE_VERSION,
- 'internalIds' => $this->byInternalId,
- 'globalIds' => $this->byGlobalId,
- )
- );
- }
-
- /**
- * @see GenericArrayObject::unserialize
- *
- * @since 1.21
- *
- * @param string $serialization
- *
- * @return array
- */
- public function unserialize( $serialization ) {
- $serializationData = parent::unserialize( $serialization );
-
- $this->cacheVersion = $serializationData['cacheVersion'];
- $this->byInternalId = $serializationData['internalIds'];
- $this->byGlobalId = $serializationData['globalIds'];
-
- return $serializationData;
- }
-
-}
<?php
/**
- * Interface for lists of Site objects.
+ * Collection of Site objects.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @license GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-interface SiteList extends Countable, Traversable, Serializable, ArrayAccess {
+class SiteList extends GenericArrayObject {
+
+ /**
+ * Internal site identifiers pointing to their sites offset value.
+ *
+ * @since 1.21
+ *
+ * @var array of integer
+ */
+ protected $byInternalId = array();
+
+ /**
+ * Global site identifiers pointing to their sites offset value.
+ *
+ * @since 1.21
+ *
+ * @var array of string
+ */
+ protected $byGlobalId = array();
+
+ /**
+ * @see GenericArrayObject::getObjectType
+ *
+ * @since 1.21
+ *
+ * @return string
+ */
+ public function getObjectType() {
+ return 'Site';
+ }
+
+ /**
+ * @see GenericArrayObject::preSetElement
+ *
+ * @since 1.21
+ *
+ * @param int|string $index
+ * @param Site $site
+ *
+ * @return boolean
+ */
+ protected function preSetElement( $index, $site ) {
+ if ( $this->hasSite( $site->getGlobalId() ) ) {
+ $this->removeSite( $site->getGlobalId() );
+ }
+
+ $this->byGlobalId[$site->getGlobalId()] = $index;
+ $this->byInternalId[$site->getInternalId()] = $index;
+
+ return true;
+ }
+
+ /**
+ * @see ArrayObject::offsetUnset()
+ *
+ * @since 1.21
+ *
+ * @param mixed $index
+ */
+ public function offsetUnset( $index ) {
+ if ( $this->offsetExists( $index ) ) {
+ /**
+ * @var Site $site
+ */
+ $site = $this->offsetGet( $index );
+
+ unset( $this->byGlobalId[$site->getGlobalId()] );
+ unset( $this->byInternalId[$site->getInternalId()] );
+ }
+
+ parent::offsetUnset( $index );
+ }
/**
* Returns all the global site identifiers.
*
* @return array
*/
- public function getGlobalIdentifiers();
+ public function getGlobalIdentifiers() {
+ return array_keys( $this->byGlobalId );
+ }
/**
* Returns if the list contains the site with the provided global site identifier.
*
* @return boolean
*/
- public function hasSite( $globalSiteId );
+ public function hasSite( $globalSiteId ) {
+ return array_key_exists( $globalSiteId, $this->byGlobalId );
+ }
/**
* Returns the Site with the provided global site identifier.
*
* @return Site
*/
- public function getSite( $globalSiteId );
+ public function getSite( $globalSiteId ) {
+ return $this->offsetGet( $this->byGlobalId[$globalSiteId] );
+ }
/**
* Removes the site with the specified global site identifier.
*
* @param string $globalSiteId
*/
- public function removeSite( $globalSiteId );
+ public function removeSite( $globalSiteId ) {
+ $this->offsetUnset( $this->byGlobalId[$globalSiteId] );
+ }
+
+ /**
+ * Returns if the list contains no sites.
+ *
+ * @since 1.21
+ *
+ * @return boolean
+ */
+ public function isEmpty() {
+ return $this->byGlobalId === array();
+ }
/**
* Returns if the list contains the site with the provided site id.
*
* @return boolean
*/
- public function hasInternalId( $id );
+ public function hasInternalId( $id ) {
+ return array_key_exists( $id, $this->byInternalId );
+ }
/**
* Returns the Site with the provided site id.
*
* @return Site
*/
- public function getSiteByInternalId( $id );
+ public function getSiteByInternalId( $id ) {
+ return $this->offsetGet( $this->byInternalId[$id] );
+ }
/**
* Removes the site with the specified site id.
*
* @param integer $id
*/
- public function removeSiteByInternalId( $id );
+ public function removeSiteByInternalId( $id ) {
+ $this->offsetUnset( $this->byInternalId[$id] );
+ }
/**
* Sets a site in the list. If the site was not there,
*
* @param Site $site
*/
- public function setSite( Site $site );
+ public function setSite( Site $site ) {
+ $this[] = $site;
+ }
/**
- * Returns if the site list contains no sites.
+ * Returns the sites that are in the provided group.
*
* @since 1.21
*
- * @return boolean
+ * @param string $groupName
+ *
+ * @return SiteList
+ */
+ public function getGroup( $groupName ) {
+ $group = new self();
+
+ /**
+ * @var \Site $site
+ */
+ foreach ( $this as $site ) {
+ if ( $site->getGroup() === $groupName ) {
+ $group[] = $site;
+ }
+ }
+
+ return $group;
+ }
+
+ /**
+ * @see GenericArrayObject::getSerializationData
+ *
+ * @since 1.21
+ *
+ * @return array
*/
- public function isEmpty();
+ protected function getSerializationData() {
+ return array_merge(
+ parent::getSerializationData(),
+ array(
+ 'internalIds' => $this->byInternalId,
+ 'globalIds' => $this->byGlobalId,
+ )
+ );
+ }
-}
\ No newline at end of file
+ /**
+ * @see GenericArrayObject::unserialize
+ *
+ * @since 1.21
+ *
+ * @param string $serialization
+ *
+ * @return array
+ */
+ public function unserialize( $serialization ) {
+ $serializationData = parent::unserialize( $serialization );
+
+ $this->byInternalId = $serializationData['internalIds'];
+ $this->byGlobalId = $serializationData['globalIds'];
+
+ return $serializationData;
+ }
+
+}
+
+/**
+ * @deprecated
+ */
+class SiteArray extends SiteList {}
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Class representing a single site.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @since 1.21
- *
- * @file
- * @ingroup Site
- *
- * @license GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- * @author Daniel Werner
- */
-class SiteObject extends ORMRow implements Site {
-
- const PATH_LINK = 'link';
-
- /**
- * Holds the local ids for this site.
- * You can obtain them via @see getLocalIds
- *
- * @since 1.21
- *
- * @var array|false
- */
- protected $localIds = false;
-
- /**
- * @see Site::getGlobalId
- *
- * @since 1.21
- *
- * @return string
- */
- public function getGlobalId() {
- return $this->getField( 'global_key' );
- }
-
- /**
- * @see Site::setGlobalId
- *
- * @since 1.21
- *
- * @param string $globalId
- */
- public function setGlobalId( $globalId ) {
- $this->setField( 'global_key', $globalId );
- }
-
- /**
- * @see Site::getType
- *
- * @since 1.21
- *
- * @return string
- */
- public function getType() {
- return $this->getField( 'type' );
- }
-
- /**
- * @see Site::setType
- *
- * @since 1.21
- *
- * @param string $type
- */
- public function setType( $type ) {
- $this->setField( 'type', $type );
- }
-
- /**
- * @see Site::getGroup
- *
- * @since 1.21
- *
- * @return string
- */
- public function getGroup() {
- return $this->getField( 'group' );
- }
-
- /**
- * @see Site::setGroup
- *
- * @since 1.21
- *
- * @param string $group
- */
- public function setGroup( $group ) {
- $this->setField( 'group', $group );
- }
-
- /**
- * @see Site::getSource
- *
- * @since 1.21
- *
- * @return string
- */
- public function getSource() {
- return $this->getField( 'source' );
- }
-
- /**
- * @see Site::setSource
- *
- * @since 1.21
- *
- * @param string $source
- */
- public function setSource( $source ) {
- $this->setField( 'source', $source );
- }
-
- /**
- * @see Site::getDomain
- *
- * @since 1.21
- *
- * @return string|false
- */
- public function getDomain() {
- $path = $this->getLinkPath();
-
- if ( $path === false ) {
- return false;
- }
-
- return parse_url( $path, PHP_URL_HOST );
- }
-
- /**
- * @see Site::getProtocol
- *
- * @since 1.21
- *
- * @throws MWException
- * @return string|false
- */
- public function getProtocol() {
- $path = $this->getLinkPath();
-
- if ( $path === false ) {
- return '';
- }
-
- $protocol = parse_url( $path, PHP_URL_SCHEME );
-
- // Malformed URL
- if ( $protocol === false ) {
- throw new MWException( "failed to parse URL $path" );
- }
-
- // No schema
- if ( $protocol === null ) {
- // Used for protocol relative URLs
- $protocol = '';
- }
-
- return $protocol;
- }
-
- /**
- * Sets the path used to construct links with.
- * @see Site::setLinkPath
- *
- * @param string $fullUrl
- *
- * @since 1.21
- *
- * @throws MWException
- */
- public function setLinkPath( $fullUrl ) {
- $type = $this->getLinkPathType();
-
- if ( $type === false ) {
- throw new MWException( "This SiteObject does not support link paths." );
- }
-
- $this->setPath( $type, $fullUrl );
- }
-
- /**
- * Returns the path path used to construct links with or false if there is no such path.
- *
- * @see Site::getLinkPath
- *
- * @return string|false
- */
- public function getLinkPath() {
- $type = $this->getLinkPathType();
- return $type === false ? false : $this->getPath( $type );
- }
-
- /**
- * @see Site::getLinkPathType
- *
- * Returns the main path type, that is the type of the path that should generally be used to construct links
- * to the target site.
- *
- * This default implementation returns SiteObject::PATH_LINK as the default path type. Subclasses can override this
- * to define a different default path type, or return false to disable site links.
- *
- * @since 1.21
- *
- * @return string|false
- */
- public function getLinkPathType() {
- return self::PATH_LINK;
- }
-
- /**
- * @see Site::getPageUrl
- *
- * This implementation returns a URL constructed using the path returned by getLinkPath().
- *
- * @since 1.21
- *
- * @param bool|String $pageName
- *
- * @return string|false
- */
- public function getPageUrl( $pageName = false ) {
- $url = $this->getLinkPath();
-
- if ( $url === false ) {
- return false;
- }
-
- if ( $pageName !== false ) {
- $url = str_replace( '$1', rawurlencode( $pageName ), $url ) ;
- }
-
- return $url;
- }
-
- /**
- * Returns $pageName without changes.
- * Subclasses may override this to apply some kind of normalization.
- *
- * @see Site::normalizePageName
- *
- * @since 1.21
- *
- * @param string $pageName
- *
- * @return string
- */
- public function normalizePageName( $pageName ) {
- return $pageName;
- }
-
- /**
- * Returns the value of a type specific field, or the value
- * of the $default parameter in case it's not set.
- *
- * @since 1.21
- *
- * @param string $fieldName
- * @param mixed $default
- *
- * @return array
- */
- protected function getExtraData( $fieldName, $default = null ) {
- $data = $this->getField( 'data', array() );
- return array_key_exists( $fieldName,$data ) ? $data[$fieldName] : $default;
- }
-
- /**
- * Sets the value of a type specific field.
- * @since 1.21
- *
- * @param string $fieldName
- * @param mixed $value
- */
- protected function setExtraData( $fieldName, $value = null ) {
- $data = $this->getField( 'data', array() );
- $data[$fieldName] = $value;
- $this->setField( 'data', $data );
- }
-
- /**
- * @see Site::getLanguageCode
- *
- * @since 1.21
- *
- * @return string|false
- */
- public function getLanguageCode() {
- return $this->getField( 'language', false );
- }
-
- /**
- * @see Site::setLanguageCode
- *
- * @since 1.21
- *
- * @param string $languageCode
- */
- public function setLanguageCode( $languageCode ) {
- $this->setField( 'language', $languageCode );
- }
-
- /**
- * Returns the local identifiers of this site.
- *
- * @since 1.21
- *
- * @param string $type
- *
- * @return array
- */
- protected function getLocalIds( $type ) {
- if ( $this->localIds === false ) {
- $this->loadLocalIds();
- }
-
- return array_key_exists( $type, $this->localIds ) ? $this->localIds[$type] : array();
- }
-
- /**
- * Loads the local ids for the site.
- *
- * @since 1.21
- */
- protected function loadLocalIds() {
- $dbr = wfGetDB( $this->getTable()->getReadDb() );
-
- $ids = $dbr->select(
- 'site_identifiers',
- array(
- 'si_type',
- 'si_key',
- ),
- array(
- 'si_site' => $this->getId(),
- ),
- __METHOD__
- );
-
- $this->localIds = array();
-
- foreach ( $ids as $id ) {
- $this->addLocalId( $id->si_type, $id->si_key );
- }
- }
-
- /**
- * Adds a local identifier.
- *
- * @since 1.21
- *
- * @param string $type
- * @param string $identifier
- */
- public function addLocalId( $type, $identifier ) {
- if ( $this->localIds === false ) {
- $this->localIds = array();
- }
-
- if ( !array_key_exists( $type, $this->localIds ) ) {
- $this->localIds[$type] = array();
- }
-
- if ( !in_array( $identifier, $this->localIds[$type] ) ) {
- $this->localIds[$type][] = $identifier;
- }
- }
-
- /**
- * @see Site::addInterwikiId
- *
- * @since 1.21
- *
- * @param string $identifier
- */
- public function addInterwikiId( $identifier ) {
- $this->addLocalId( 'interwiki', $identifier );
- }
-
- /**
- * @see Site::addNavigationId
- *
- * @since 1.21
- *
- * @param string $identifier
- */
- public function addNavigationId( $identifier ) {
- $this->addLocalId( 'equivalent', $identifier );
- }
-
- /**
- * @see Site::getInterwikiIds
- *
- * @since 1.21
- *
- * @return array of string
- */
- public function getInterwikiIds() {
- return $this->getLocalIds( 'interwiki' );
- }
-
- /**
- * @see Site::getNavigationIds
- *
- * @since 1.21
- *
- * @return array of string
- */
- public function getNavigationIds() {
- return $this->getLocalIds( 'equivalent' );
- }
-
- /**
- * @see Site::getInternalId
- *
- * @since 1.21
- *
- * @return integer
- */
- public function getInternalId() {
- return $this->getId();
- }
-
- /**
- * @see IORMRow::save
- * @see Site::save
- *
- * @since 1.21
- *
- * @param string|null $functionName
- *
- * @return boolean Success indicator
- */
- public function save( $functionName = null ) {
- $dbw = $this->table->getWriteDbConnection();
-
- $trx = $dbw->trxLevel();
-
- if ( $trx == 0 ) {
- $dbw->begin( __METHOD__ );
- }
-
- $this->setField( 'protocol', $this->getProtocol() );
- $this->setField( 'domain', strrev( $this->getDomain() ) . '.' );
-
- $existedAlready = $this->hasIdField();
-
- $success = parent::save( $functionName );
-
- if ( $success && $existedAlready ) {
- $dbw->delete(
- 'site_identifiers',
- array( 'si_site' => $this->getId() ),
- __METHOD__
- );
- }
-
- if ( $success && $this->localIds !== false ) {
- foreach ( $this->localIds as $type => $ids ) {
- foreach ( $ids as $id ) {
- $dbw->insert(
- 'site_identifiers',
- array(
- 'si_site' => $this->getId(),
- 'si_type' => $type,
- 'si_key' => $id,
- ),
- __METHOD__
- );
- }
- }
- }
-
- if ( $trx == 0 ) {
- $dbw->commit( __METHOD__ );
- }
-
- return $success;
- }
-
- /**
- * @since 1.21
- *
- * @see ORMRow::onRemoved
- */
- protected function onRemoved() {
- $dbw = $this->table->getWriteDbConnection();
-
- $dbw->delete(
- 'site_identifiers',
- array(
- 'si_site' => $this->getId()
- ),
- __METHOD__
- );
-
- parent::onRemoved();
- }
-
- /**
- * @see Site::setPath
- *
- * @since 1.21
- *
- * @param string $pathType
- * @param string $fullUrl
- */
- public function setPath( $pathType, $fullUrl ) {
- $paths = $this->getExtraData( 'paths', array() );
- $paths[$pathType] = $fullUrl;
- $this->setExtraData( 'paths', $paths );
- }
-
- /**
- * @see Sitres::getPath
- *
- * @since 1.21
- *
- * @param string $pathType
- *
- * @return string|false
- */
- public function getPath( $pathType ) {
- $paths = $this->getExtraData( 'paths', array() );
- return array_key_exists( $pathType, $paths ) ? $paths[$pathType] : false;
- }
-
- /**
- * @see Sitres::getAll
- *
- * @since 1.21
- *
- * @return array of string
- */
- public function getAllPaths() {
- return $this->getExtraData( 'paths', array() );
- }
-
- /**
- * @see Sitres::removePath
- *
- * @since 1.21
- *
- * @param string $pathType
- */
- public function removePath( $pathType ) {
- $paths = $this->getExtraData( 'paths', array() );
- unset( $paths[$pathType] );
- $this->setExtraData( 'paths', $paths );
- }
-
-}
--- /dev/null
+<?php
+
+/**
+ * Represents the site configuration of a wiki.
+ * Holds a list of sites (ie SiteList) and takes care
+ * of retrieving and caching site information when appropriate.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @since 1.21
+ *
+ * @file
+ * @ingroup Site
+ *
+ * @license GNU GPL v2+
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class SiteSQLStore implements SiteStore {
+
+ /**
+ * @since 1.21
+ *
+ * @var SiteList|null
+ */
+ protected $sites = null;
+
+ /**
+ * @var ORMTable
+ */
+ protected $sitesTable;
+
+ /**
+ * @since 1.21
+ *
+ * @param ORMTable|null $sitesTable
+ *
+ * @return SiteStore
+ */
+ public static function newInstance( ORMTable $sitesTable = null ) {
+ return new static( $sitesTable );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @since 1.21
+ *
+ * @param ORMTable|null $sitesTable
+ */
+ protected function __construct( ORMTable $sitesTable = null ) {
+ if ( $sitesTable === null ) {
+ $sitesTable = $this->newSitesTable();
+ }
+
+ $this->sitesTable = $sitesTable;
+ }
+
+ /**
+ * @see SiteStore::getSites
+ *
+ * @since 1.21
+ *
+ * @param string $source either 'cache' or 'recache'
+ *
+ * @return SiteList
+ */
+ public function getSites( $source = 'cache' ) {
+ if ( $source === 'cache' ) {
+ if ( $this->sites === null ) {
+ $cache = wfGetMainCache();
+ $sites = $cache->get( wfMemcKey( 'SiteList' ) );
+
+ if ( is_object( $sites ) ) {
+ $this->sites = $sites;
+ } else {
+ $this->loadSites();
+ }
+ }
+ }
+ else {
+ $this->loadSites();
+ }
+
+ return $this->sites;
+ }
+
+ /**
+ * Returns a new Site object constructed from the provided ORMRow.
+ *
+ * @since 1.21
+ *
+ * @param ORMRow $siteRow
+ *
+ * @return Site
+ */
+ protected function siteFromRow( ORMRow $siteRow ) {
+ $site = Site::newForType( $siteRow->getField( 'type', Site::TYPE_UNKNOWN ) );
+
+ $site->setGlobalId( $siteRow->getField( 'global_key' ) );
+
+ if ( $siteRow->hasField( 'forward' ) ) {
+ $site->setForward( $siteRow->getField( 'forward' ) );
+ }
+
+ if ( $siteRow->hasField( 'group' ) ) {
+ $site->setGroup( $siteRow->getField( 'group' ) );
+ }
+
+ if ( $siteRow->hasField( 'language' ) ) {
+ $site->setLanguageCode( $siteRow->getField( 'language' ) === '' ? null : $siteRow->getField( 'language' ) );
+ }
+
+ if ( $siteRow->hasField( 'source' ) ) {
+ $site->setSource( $siteRow->getField( 'source' ) );
+ }
+
+ if ( $siteRow->hasField( 'data' ) ) {
+ $site->setExtraData( $siteRow->getField( 'data' ) );
+ }
+
+ if ( $siteRow->hasField( 'config' ) ) {
+ $site->setExtraConfig( $siteRow->getField( 'config' ) );
+ }
+
+ return $site;
+ }
+
+ /**
+ * Fetches the site from the database and loads them into the sites field.
+ *
+ * @since 1.21
+ */
+ protected function loadSites() {
+ $this->sites = new SiteList();
+
+ foreach ( $this->sitesTable->select() as $siteRow ) {
+ $this->sites[] = $this->siteFromRow( $siteRow );
+ }
+
+ // Batch load the local site identifiers.
+ $ids = wfGetDB( $this->sitesTable->getReadDb() )->select(
+ 'site_identifiers',
+ array(
+ 'si_site',
+ 'si_type',
+ 'si_key',
+ ),
+ array(),
+ __METHOD__
+ );
+
+ foreach ( $ids as $id ) {
+ if ( $this->sites->hasInternalId( $id->si_site ) ) {
+ $site = $this->sites->getSiteByInternalId( $id->si_site );
+ $site->addLocalId( $id->si_type, $id->si_key );
+ $this->sites->setSite( $site );
+ }
+ }
+
+ $cache = wfGetMainCache();
+ $cache->set( wfMemcKey( 'SiteList' ), $this->sites );
+ }
+
+ /**
+ * @see SiteStore::getSite
+ *
+ * @since 1.21
+ *
+ * @param string $globalId
+ * @param string $source
+ *
+ * @return Site|null
+ */
+ public function getSite( $globalId, $source = 'cache' ) {
+ $sites = $this->getSites( $source );
+
+ return $sites->hasSite( $globalId ) ? $sites->getSite( $globalId ) : null;
+ }
+
+ /**
+ * @see SiteStore::saveSite
+ *
+ * @since 1.21
+ *
+ * @param Site $site
+ *
+ * @return boolean Success indicator
+ */
+ public function saveSite( Site $site ) {
+ return $this->saveSites( array( $site ) );
+ }
+
+ /**
+ * @see SiteStore::saveSites
+ *
+ * @since 1.21
+ *
+ * @param Site[] $sites
+ *
+ * @return boolean Success indicator
+ */
+ public function saveSites( array $sites ) {
+ if ( empty( $sites ) ) {
+ return true;
+ }
+
+ $dbw = $this->sitesTable->getWriteDbConnection();
+
+ $trx = $dbw->trxLevel();
+
+ if ( $trx == 0 ) {
+ $dbw->begin( __METHOD__ );
+ }
+
+ $success = true;
+
+ $internalIds = array();
+ $localIds = array();
+
+ foreach ( $sites as $site ) {
+ $fields = array(
+ // Site data
+ 'global_key' => $site->getGlobalId(), // TODO: check not null
+ 'type' => $site->getType(),
+ 'group' => $site->getGroup(),
+ 'source' => $site->getSource(),
+ 'language' => $site->getLanguageCode() === null ? '' : $site->getLanguageCode(),
+ 'protocol' => $site->getProtocol(),
+ 'domain' => strrev( $site->getDomain() ) . '.',
+ 'data' => $site->getExtraData(),
+
+ // Site config
+ 'forward' => $site->shouldForward(),
+ 'config' => $site->getExtraConfig(),
+ );
+
+ if ( $site->getInternalId() !== null ) {
+ $fields['id'] = $site->getInternalId();
+ $internalIds[] = $site->getInternalId();
+ }
+
+ $siteRow = new ORMRow( $this->sitesTable, $fields );
+ $success = $siteRow->save( __METHOD__ ) && $success;
+
+ foreach ( $site->getLocalIds() as $idType => $ids ) {
+ foreach ( $ids as $id ) {
+ $localIds[] = array( $siteRow->getId(), $idType, $id );
+ }
+ }
+ }
+
+ if ( $internalIds !== array() ) {
+ $dbw->delete(
+ 'site_identifiers',
+ array( 'si_site' => $internalIds ),
+ __METHOD__
+ );
+ }
+
+ foreach ( $localIds as $localId ) {
+ $dbw->insert(
+ 'site_identifiers',
+ array(
+ 'si_site' => $localId[0],
+ 'si_type' => $localId[1],
+ 'si_key' => $localId[2],
+ ),
+ __METHOD__
+ );
+ }
+
+ if ( $trx == 0 ) {
+ $dbw->commit( __METHOD__ );
+ }
+
+ return $success;
+ }
+
+ /**
+ * @since 1.21
+ *
+ * @return ORMTable
+ */
+ protected function newSitesTable() {
+ return new ORMTable(
+ 'sites',
+ array(
+ 'id' => 'id',
+
+ // Site data
+ 'global_key' => 'str',
+ 'type' => 'str',
+ 'group' => 'str',
+ 'source' => 'str',
+ 'language' => 'str',
+ 'protocol' => 'str',
+ 'domain' => 'str',
+ 'data' => 'array',
+
+ // Site config
+ 'forward' => 'bool',
+ 'config' => 'array',
+ ),
+ array(
+ 'type' => Site::TYPE_UNKNOWN,
+ 'group' => Site::GROUP_NONE,
+ 'source' => Site::SOURCE_LOCAL,
+ 'data' => array(),
+
+ 'forward' => false,
+ 'config' => array(),
+ 'language' => '',
+ ),
+ 'ORMRow',
+ 'site_'
+ );
+ }
+
+}
+
+/**
+ * @deprecated
+ */
+class Sites extends SiteSQLStore {
+
+ /**
+ * Factory for creating new site objects.
+ *
+ * @since 1.21
+ * @deprecated
+ *
+ * @param string|boolean false $globalId
+ *
+ * @return Site
+ */
+ public static function newSite( $globalId = false ) {
+ $site = new Site();
+
+ if ( $globalId !== false ) {
+ $site->setGlobalId( $globalId );
+ }
+
+ return $site;
+ }
+
+ /**
+ * @deprecated
+ * @return SiteStore
+ */
+ public static function singleton() {
+ return new static();
+ }
+
+ /**
+ * @deprecated
+ * @return SiteList
+ */
+ public function getSiteGroup( $group ) {
+ return $this->getSites()->getGroup( $group );
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+interface SiteStore {
+
+ /**
+ * Saves the provided site.
+ *
+ * @since 1.21
+ *
+ * @param Site $site
+ *
+ * @return boolean Success indicator
+ */
+ public function saveSite( Site $site );
+
+ /**
+ * Saves the provided sites.
+ *
+ * @since 1.21
+ *
+ * @param Site[] $sites
+ *
+ * @return boolean Success indicator
+ */
+ public function saveSites( array $sites );
+
+ /**
+ * Returns the site with provided global id, or null if there is no such site.
+ *
+ * @since 1.21
+ *
+ * @param string $globalId
+ * @param string $source either 'cache' or 'recache'.
+ * If 'cache', the values are allowed (but not obliged) to come from a cache.
+ *
+ * @return Site|null
+ */
+ public function getSite( $globalId, $source = 'cache' );
+
+ /**
+ * Returns a list of all sites. By default this site is
+ * fetched from the cache, which can be changed to loading
+ * the list from the database using the $useCache parameter.
+ *
+ * @since 1.21
+ *
+ * @param string $source either 'cache' or 'recache'.
+ * If 'cache', the values are allowed (but not obliged) to come from a cache.
+ *
+ * @return SiteList
+ */
+ public function getSites( $source = 'cache' );
+
+}
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Represents the site configuration of a wiki.
- * Holds a list of sites (ie SiteList) and takes care
- * of retrieving and caching site information when appropriate.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @since 1.21
- *
- * @file
- * @ingroup Site
- *
- * @license GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class Sites {
-
- /**
- * @since 1.21
- * @var SiteList|null
- */
- protected $sites = null;
-
- /**
- * Constructor.
- *
- * @since 1.21
- */
- protected function __construct() {}
-
- /**
- * Returns an instance of Sites.
- *
- * @since 1.21
- *
- * @return Sites
- */
- public static function singleton() {
- static $instance = false;
-
- if ( $instance === false ) {
- $instance = new static();
- }
-
- return $instance;
- }
-
- /**
- * Factory for creating new site objects.
- *
- * @since 1.21
- *
- * @param string|boolean false $globalId
- *
- * @return Site
- */
- public static function newSite( $globalId = false ) {
- /**
- * @var Site $site
- */
- $site = SitesTable::singleton()->newRow( array(), true );
-
- if ( $globalId !== false ) {
- $site->setGlobalId( $globalId );
- }
-
- return $site;
- }
-
- /**
- * Returns a list of all sites. By default this site is
- * fetched from the cache, which can be changed to loading
- * the list from the database using the $useCache parameter.
- *
- * @since 1.21
- *
- * @param string $source either 'cache' or 'recache'
- *
- * @return SiteList
- */
- public function getSites( $source = 'cache' ) {
- if ( $source === 'cache' ) {
- if ( $this->sites === null ) {
- $cache = wfGetMainCache();
- $sites = $cache->get( wfMemcKey( 'SiteList' ) );
-
- if ( is_object( $sites ) && isset( $sites->cacheVersion ) && $sites->cacheVersion === SiteArray::CACHE_VERSION ) {
- $this->sites = $sites;
- } else {
- $this->loadSites();
- }
- }
- }
- else {
- $this->loadSites();
- }
-
- return $this->sites;
- }
-
- /**
- * Returns a list of sites in the given group. Calling getGroup() on any of
- * the sites in the resulting SiteList shall return $group.
- *
- * @since 1.21
- *
- * @param string $group th group to get.
- *
- * @return SiteList
- */
- public function getSiteGroup( $group ) {
- $sites = self::getSites();
-
- $siteGroup = new SiteArray();
-
- /* @var Site $site */
- foreach ( $sites as $site ) {
- if ( $site->getGroup() == $group ) {
- $siteGroup->append( $site );
- }
- }
-
- return $siteGroup;
- }
-
- /**
- * Fetches the site from the database and loads them into the sites field.
- *
- * @since 1.21
- */
- protected function loadSites() {
- $this->sites = new SiteArray( SitesTable::singleton()->select() );
-
- // Batch load the local site identifiers.
- $dbr = wfGetDB( SitesTable::singleton()->getReadDb() );
-
- $ids = $dbr->select(
- 'site_identifiers',
- array(
- 'si_site',
- 'si_type',
- 'si_key',
- ),
- array(),
- __METHOD__
- );
-
- foreach ( $ids as $id ) {
- if ( $this->sites->hasInternalId( $id->si_site ) ) {
- $site = $this->sites->getSiteByInternalId( $id->si_site );
- $site->addLocalId( $id->si_type, $id->si_key );
- $this->sites->setSite( $site );
- }
- }
-
- $cache = wfGetMainCache();
- $cache->set( wfMemcKey( 'SiteList' ), $this->sites );
- }
-
- /**
- * Returns the site with provided global id, or false if there is no such site.
- *
- * @since 1.21
- *
- * @param string $globalId
- * @param string $source
- *
- * @return Site|false
- */
- public function getSite( $globalId, $source = 'cache' ) {
- $sites = $this->getSites( $source );
-
- return $sites->hasSite( $globalId ) ? $sites->getSite( $globalId ) : false;
- }
-
-}
+++ /dev/null
-<?php
-
-/**
- * Represents the sites database table.
- * All access to this table should be done through this class.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @since 1.21
- *
- * @file
- * @ingroup Site
- *
- * @license GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class SitesTable extends ORMTable {
-
- /**
- * @see IORMTable::getName()
- * @since 1.21
- * @return string
- */
- public function getName() {
- return 'sites';
- }
-
- /**
- * @see IORMTable::getFieldPrefix()
- * @since 1.21
- * @return string
- */
- public function getFieldPrefix() {
- return 'site_';
- }
-
- /**
- * @see IORMTable::getRowClass()
- * @since 1.21
- * @return string
- */
- public function getRowClass() {
- return 'SiteObject';
- }
-
- /**
- * @see IORMTable::getFields()
- * @since 1.21
- * @return array
- */
- public function getFields() {
- return array(
- 'id' => 'id',
-
- // Site data
- 'global_key' => 'str',
- 'type' => 'str',
- 'group' => 'str',
- 'source' => 'str',
- 'language' => 'str',
- 'protocol' => 'str',
- 'domain' => 'str',
- 'data' => 'array',
-
- // Site config
- 'forward' => 'bool',
- 'config' => 'array',
- );
- }
-
- /**
- * @see IORMTable::getDefaults()
- * @since 1.21
- * @return array
- */
- public function getDefaults() {
- return array(
- 'type' => Site::TYPE_UNKNOWN,
- 'group' => Site::GROUP_NONE,
- 'source' => Site::SOURCE_LOCAL,
- 'data' => array(),
-
- 'forward' => false,
- 'config' => array(),
- 'language' => 'en', // XXX: can we default to '' instead?
- );
- }
-
- /**
- * Returns the class name for the provided site type.
- *
- * @since 1.21
- *
- * @param integer $siteType
- *
- * @return string
- */
- protected static function getClassForType( $siteType ) {
- global $wgSiteTypes;
- return array_key_exists( $siteType, $wgSiteTypes ) ? $wgSiteTypes[$siteType] : 'SiteObject';
- }
-
- /**
- * Factory method to construct a new Site instance.
- *
- * @since 1.21
- *
- * @param array $data
- * @param boolean $loadDefaults
- *
- * @return Site
- */
- public function newRow( array $data, $loadDefaults = false ) {
- if ( !array_key_exists( 'type', $data ) ) {
- $data['type'] = Site::TYPE_UNKNOWN;
- }
-
- $class = static::getClassForType( $data['type'] );
-
- return new $class( $this, $data, $loadDefaults );
- }
-
-}
\ No newline at end of file
array(
'result' => 'Failure',
'stage' => 'publish',
- 'status' => Status::newFatal( 'api-error-stashfailed' )
+ 'status' => Status::newFatal( 'api-error-publishfailed' )
)
);
throw $e;
'laggedslavemode' => 'Waarskuwing: Onlangse wysigings dalk nie in bladsy vervat nie.',
'readonly' => 'Databasis gesluit',
'enterlockreason' => 'Rede vir die sluiting,
-en beraming van wanneer ontsluiting sal plaas vind',
-'readonlytext' => 'Die {{SITENAME}} databasis is tans gesluit vir nuwe
-artikelwysigings, waarskynlik vir roetine databasisonderhoud,
+en beraming van wanneer ontsluiting sal plaasvind',
+'readonlytext' => 'Die databasis is tans gesluit vir nuwe artikelwysigings, waarskynlik vir roetine onderhoud,
waarna dit terug sal wees na normaal.
-Die administreerder wat dit gesluit het se verduideliking:
-$1',
+Die administrateur wat dit gesluit het se verduideliking: $1',
'missing-article' => "Die databasis kon nie soos verwag die teks vir die bladsy genaamd \"\$1\" \$2 kry nie.
Dit gebeur gewoonlik as mens 'n verouderde verskil- of geskiedenis-skakel volg na 'n bladsy wat reeds verwyder is.
Indien dit nie die geval is nie, het u moontlik 'n fout in die sagteware ontdek. Rapporteer asseblief die probleem aan 'n [[Special:ListUsers/sysop|administrateur]], en maak 'n nota van die URL.",
'missingarticle-rev' => '(weergawe#: $1)',
'missingarticle-diff' => '(Wysiging: $1, $2)',
-'readonly_lag' => 'Die databasis is outomaties gesluit terwyl die slaafdatabasisse sinchroniseer met die meester',
+'readonly_lag' => 'Die databasis is outomaties gesluit terwyl die slaafdatabasisse met die meester gesinchroniseer word',
'internalerror' => 'Interne fout',
'internalerror_info' => 'Interne fout: $1',
'fileappenderrorread' => 'Kon nie "$1" tydens die "append" lees nie.',
'securelogin-stick-https' => 'Bly verbind met HTTPS na aanmelding',
'yourdomainname' => 'U domein:',
'password-change-forbidden' => 'U kan nie wagwoorde op hierdie wiki verander nie.',
-'externaldberror' => "'n Databasis fout het voorgekom tydens aanmelding of u het nie toestemming om u eksterne rekening op te dateer nie.",
+'externaldberror' => "'n Databasisfout het voorgekom tydens aanmelding of u het nie toestemming om u eksterne rekening op te dateer nie.",
'login' => 'Teken in',
'nav-login-createaccount' => 'Teken in',
'loginprompt' => 'U blaaier moet koekies toelaat om by {{SITENAME}} te kan aanteken.',
'''MOENIE WERK WAT DEUR KOPIEREG BESKERM WORD HIER PLAAS SONDER TOESTEMMING NIE!'''",
'longpageerror' => "'''Fout: die teks wat u bygevoeg het is {{PLURAL:$1|een kilogreep|$1 kilogrepe}} groot, wat groter is as die maksimum van {{PLURAL:$2|een kilogreep|$2 kilogrepe}}.'''
Die bladsy kan nie gestoor word nie.",
-'readonlywarning' => "'''WAARSKUWING: Die databasis is gesluit vir onderhoud. Dus sal u nie nou u wysigings kan stoor nie. Dalk wil u die teks plak in 'n lêer en stoor vir later.'''
+'readonlywarning' => "'''WAARSKUWING: Die databasis is gesluit vir onderhoud. Dus sal u nie nou u wysigings kan stoor nie. Dalk wil u die teks in 'n lêer plak en stoor vir later.'''
-Een administrateur het die databasis geblokkeer vir hierdie rede: $1",
+Die administrateur wat dit gesluit het se verduideliking: \$ 1",
'protectedpagewarning' => "'''WAARSKUWING: Hierdie bladsy is beveilig sodat slegs administrateurs die inhoud sal kan verander.''' Die nuutste logboekinskrywing word hieronder ter verwysing vertoon:",
'semiprotectedpagewarning' => "'''Let wel:''' Hierdie artikel is beveilig sodat slegs ingetekende gebruikers dit sal kan wysig. Die nuutste logboekinskrywing word hieronder ter verwysing vertoon:",
'cascadeprotectedwarning' => "'''Waarskuwing:''' Die bladsy was beveilig sodat dit slegs deur administrateurs gewysig kan word, omrede dit ingesluit is in die volgende {{PLURAL:$1|bladsy|bladsye}} wat kaskade-beskerming geniet:",
'protect-level-sysop' => 'ܡܕܒܪ̈ܢܐ ܒܠܚܘܕ',
'protect-expiring' => 'ܬܦܪܘܩ ܒ $1 (UTC)',
'protect-expiry-indefinite' => 'ܠܥܠܡ',
-'protect-othertime' => 'Ü¥Ü\95Ü¢Ü\90 Ü\90Ü\9aܪܬܐ:',
-'protect-othertime-op' => 'Ü¥Ü\95Ü¢Ü\90 Ü\90Ü\9aܪܬܐ',
+'protect-othertime' => 'Ü¥Ü\95Ü¢Ü\90 Ü\90Ü\9aܪܢܐ:',
+'protect-othertime-op' => 'Ü¥Ü\95Ü¢Ü\90 Ü\90Ü\9aܪܢܐ',
'protect-otherreason' => 'ܥܠܬܐ ܐܚܪܬܐ/ܢܩܝܦܬܐ:',
'protect-otherreason-op' => 'ܥܠܬܐ ܐܚܪܬܐ',
'protect-edit-reasonlist' => 'ܫܚܠܦ ܥܠܬܐ ܕܢܛܪܐ',
-'protect-expiry-options' => '1 ܫܥܬÜ\90:1 hour,1 Ü\9dÜ\98Ü¡Ü\90:1 day,1 Ü«Ü\92Ü\98Ü¥Ü\90:1 week,2 Ü«Ü\92Ü\98Ü¥Ì\88Ü\90:2 weeks,1 Ü\9dܪÜ\9aÜ\90:1 month,3 Ü\9dܪÌ\88Ü\9aÜ\90:3 months,6 Ü\9dܪÌ\88Ü\9aÜ\90:6 months,1 ܫܢܬܐ:1 year,ܠܥܠܡ:infinite',
+'protect-expiry-options' => '1 Ü«Ü¥Ü\90:1 hour,1 Ü\9dÜ\98Ü¡:1 day,1 Ü«Ü\92Ü\98Ü¥:1 week,2 Ü«Ü\92Ü\98Ü¥Ì\88Ü\9dÜ¢:2 weeks,1 Ü\9dܪÜ\9a:1 month,3 Ü\9dܪÌ\88Ü\9aÜ\9dÜ¢:3 months,6 Ü\9dܪÌ\88Ü\9aÜ\9dÜ¢:6 months,1 Ü«Ü¢ܐ:1 year,ܠܥܠܡ:infinite',
'restriction-type' => 'ܦܣܣܐ:',
'restriction-level' => 'ܫܘܝܐ ܕܣܘܝܟܐ:',
'minimum-size' => 'ܡܬܚܐ ܬܚܬܝܐ ܕܥܓܪܐ',
'ipbreason' => 'ܥܠܬܐ:',
'ipbreasonotherlist' => 'ܥܠܬܐ ܐܚܪܬܐ',
'ipbsubmit' => 'ܚܪܘܡ ܡܦܠܚܢܐ ܗܢܐ',
-'ipbother' => 'Ü¥Ü\95Ü¢Ü\90 Ü\90Ü\9aܪܬܐ',
-'ipboptions' => '2 ܫܥܬ̈ܐ:2 hours,1 ܝܘܡܐ:1 day,3 ܝܘܡܬ̈ܐ:3 days,1 ܫܒܘܥܐ:1 week,2 ܫܒܘܥ̈ܐ:2 weeks,1 ܝܪܚܐ:1 month,3 ܝܪ̈ܚܐ:3 months,6 ܝܪ̈ܚܐ:6 months,1 ܫܢܬܐ:1 year,ܠܥܠܡ:infinite',
+'ipbother' => 'Ü¥Ü\95Ü¢Ü\90 Ü\90Ü\9aܪܢܐ',
+'ipboptions' => '2 ܫܥ̈ܝܢ:2 hours,1 ܝܘܡ:1 day,3 ܝܘܡ̈ܝܢ:3 days,1 ܫܒܘܥ:1 week,2 ܫܒܘܥ̈ܝܢ:2 weeks,1 ܝܪܚ:1 month,3 ܝܪ̈ܚܝܢ:3 months,6 ܝܪ̈ܚܝܢ:6 months,1 ܫܢܐ:1 year,ܠܥܠܡ:infinite',
'ipbotheroption' => 'ܐܚܪܢܐ',
'ipbotherreason' => 'ܥܠܬܐ ܐܚܪܬܐ/ܢܩܝܦܬܐ:',
'ipbhidename' => 'ܛܫܝ ܫܡܐ ܕܡܦܠܚܢܐ ܡܢ ܫܘܚܠܦ̈ܐ ܘܡܟܬܒܘܬ̈ܐ',
'exportlistauthors' => 'هر صحیفه اوچون دَییشدیرمه ائدن سیياهیسینی اؤزونده ساخلايین',
'export-submit' => 'ایخراج',
'export-addcattext' => 'صحیفهلری بو بولمه دن علاوه ائت:',
-'export-addcat' => 'عÙ\84اÙ\88Ù\87 ائت',
+'export-addcat' => 'آرتÛ\8cر',
'export-addnstext' => 'صحیفهلری آدلار فزاسیندان علاوه ائت:',
-'export-addns' => 'عÙ\84اÙ\88Ù\87 ائت',
+'export-addns' => 'آرتÛ\8cر',
'export-download' => 'فایلی قئید ائت',
'export-templates' => 'شابلونلاری داخیل ائت',
'export-pagelinks' => 'باغلی صحیفهلری داخیل درینلیک:',
'version-variables' => 'Erweiterungen mit Variablen',
'version-antispam' => 'Spamschutzerweiterungen',
'version-skins' => 'Benutzeroberflächen',
+'version-api' => 'API-Erweiterungen',
'version-other' => 'Andere Erweiterungen',
'version-mediahandlers' => 'Mediennutzungserweiterungen',
'version-hooks' => "Schnittstellen ''(Hooks)''",
'api-error-ok-but-empty' => 'Interner Fehler: Der Server reagiert nicht.',
'api-error-overwrite' => 'Das Überschreiben einer vorhandenen Datei ist nicht erlaubt.',
'api-error-stashfailed' => 'Interner Fehler: Der Server konnte keine temporäre Datei speichern.',
+'api-error-publishfailed' => 'Interner Fehler: Der Server konnte die temporäre Datei nicht veröffentlichen.',
'api-error-timeout' => 'Der Server hat nicht innerhalb der erwarteten Zeit reagiert.',
'api-error-unclassified' => 'Ein unbekannter Fehler ist aufgetreten.',
'api-error-unknown-code' => 'Unbekannter Fehler: „$1“',
keyepel nıka zaf meşğulo yew dema herayi de newe ra tesel bıkerê.',
'license' => 'Lisans:',
-'license-header' => 'Lisans',
+'license-header' => 'Lisansdayış',
'nolicense' => 'Theba nêweçineya',
'license-nopreview' => '(verqeydî çin o)',
'upload_source_url' => '(yew URLê raştî, şar rê akerde yo)',
'api-error-ok-but-empty' => 'Internal error: No response from server.',
'api-error-overwrite' => 'Overwriting an existing file is not allowed.',
'api-error-stashfailed' => 'Internal error: Server failed to store temporary file.',
+'api-error-publishfailed' => 'Internal error: Server failed to publish temporary file.',
'api-error-timeout' => 'The server did not respond within the expected time.',
'api-error-unclassified' => 'An unknown error occurred.',
'api-error-unknown-code' => 'Unknown error: "$1".',
'prot_1movedto2' => 'heredando la protección al trasladar [[$1]] a [[$2]]',
'protect-badnamespace-title' => 'Espacio de nombres no protegible',
'protect-badnamespace-text' => 'Las páginas de este espacio de nombres no pueden ser protegidas',
+'protect-norestrictiontypes-title' => 'Página no protegible',
'protect-legend' => 'Confirmar protección',
'protectcomment' => 'Motivo:',
'protectexpiry' => 'Caducidad:',
'pageinfo-magic-words' => '{{PLURAL:$1|Palabra mágica|Palabras mágicas}} ($1)',
'pageinfo-hidden-categories' => '{{PLURAL:$1|Categoría oculta|Categorías ocultas}} ($1)',
'pageinfo-templates' => '{{PLURAL:$1|Plantilla incluida|Plantillas incluidas}} ($1)',
+'pageinfo-transclusions' => '{{PLURAL:$1|Página incluida|Páginas incluidas}} ($1)',
'pageinfo-toolboxlink' => 'Información de la página',
'pageinfo-redirectsto' => 'Redirige a',
'pageinfo-redirectsto-info' => 'Información',
'minutes' => '{{PLURAL:$1|un minuto|$1 minutos}}',
'hours' => '{{PLURAL:$1|una hora|$1 horas}}',
'days' => '{{PLURAL:$1|un día|$1 días}}',
+'months' => '{{PLURAL:$1|$1 mes|$1 meses}}',
+'years' => '{{PLURAL:$1|$1 año|$1 años}}',
'ago' => 'hace $1',
'just-now' => 'Ahora mismo',
'prot_1movedto2' => 'siirsi sivun [[$1]] uudelle nimelle [[$2]]',
'protect-badnamespace-title' => 'Nimiavaruus ei suojattavissa',
'protect-badnamespace-text' => 'Tämän nimiavaruuden sivuja ei voi suojata.',
+'protect-norestrictiontypes-text' => 'Tätä sivua ei voi suojata, koska mitään rajoitusvaihtoehtoja ei ole käytettävissä.',
+'protect-norestrictiontypes-title' => 'Ei suojattavissa oleva sivu',
'protect-legend' => 'Suojaukset',
'protectcomment' => 'Syy',
'protectexpiry' => 'Vanhentuu',
'protect-default' => 'Salli kaikki käyttäjät',
'protect-fallback' => 'Vaadi $1-oikeus',
'protect-level-autoconfirmed' => 'Estä uudet ja kirjautumattomat käyttäjät',
-'protect-level-sysop' => 'Vain ylläpitäjät',
+'protect-level-sysop' => 'Salli vain ylläpitäjät',
'protect-summary-cascade' => 'laajennettu',
'protect-expiring' => 'vanhentuu $1 (UTC)',
'protect-expiring-local' => 'vanhentuu $1',
'pageinfo-magic-words' => '{{PLURAL:$1|Taikasana|Taikasanat}} ($1)',
'pageinfo-hidden-categories' => '{{PLURAL:$1|Piilotettu luokka|Piilotetut luokat}} ($1)',
'pageinfo-templates' => '{{PLURAL:$1|Sisällytetty malline|Sisällytetyt mallineet}} ($1)',
+'pageinfo-transclusions' => 'Sisällytetty {{PLURAL:$1|sivulle|sivuille}} ($1)',
'pageinfo-toolboxlink' => 'Sivun tiedot',
'pageinfo-redirectsto' => 'Ohjaus sivulle',
'pageinfo-redirectsto-info' => 'tiedot',
'newwindow' => '(wårt önj en nai waning ääm mååged)',
'cancel' => 'Oufbreege',
'moredotdotdot' => 'Mör ...',
+'morenotlisted' => 'Öödern, ei apfeerd ...',
'mypage' => 'Sidj',
'mytalk' => 'Diskusjuun',
'anontalk' => 'Diskusjoonssid foon jüdeer IP',
'namespaces' => 'Noomerüme',
'variants' => 'Fariante',
+'navigation-heading' => 'Nawigatsjuun',
'errorpagetitle' => 'Fäägel',
'returnto' => 'Tubääg tu jü side $1.',
'tagline' => 'Üt {{SITENAME}}',
'youhavenewmessages' => 'Dü hääst $1 aw din diskusjoonssid ($2).',
'newmessageslink' => 'naie tisinge',
'newmessagesdifflink' => 'Leest änring',
+'youhavenewmessagesfromusers' => 'Dü heest $1 faan {{PLURAL:$3|en öödern brüker|$3 ööder brükern}} ($2).',
+'youhavenewmessagesmanyusers' => 'Dü heest $1 faan flook ööder brükern ($2).',
+'newmessageslinkplural' => '{{PLURAL:$1|ian nei nooracht|nei noorachten}}',
+'newmessagesdifflinkplural' => 'leetst {{PLURAL:$1|feranrang|feranrangen}}',
'youhavenewmessagesmulti' => 'Dü hääst nai tisinge aw $1',
'editsection' => 'Beårbe',
'editsection-brackets' => '[$1]',
'invalidtitle-knownnamespace' => 'Ferkiard auerskraft uun di nöömrüm „$2“ an tekst „$3“',
'invalidtitle-unknownnamespace' => 'Ferkiard auerskraft uun di ünbekäänd nöömrüm „$1“ an tekst „$2“',
'exception-nologin' => 'Ei uunmeldet',
+'exception-nologin-text' => 'Det könst dü bluas bewerke, wan dü uunmeldet beest.',
# Virus scanner
'virus-badscanner' => "Hiinje konfigurasjoon: ünbekånde fiirusscanner: ''$1''",
Dü koost {{SITENAME}} nü anonüüm widerbrüke, unti de wider uner diseelew unti en oudern brükernoome <span class='plainlinks'>[$1 önjmälde]</span>.
Påås aw, dåt hu side nuch wise koone, dåt dü önjmälded bast, sülung dü ai dan browsercache lääsimååged heest.",
+'welcomeuser' => 'Welkimen, $1!',
+'welcomecreation-msg' => 'Din brükerkonto as iinracht wurden.
+Ferjid det ei, an aachte üüb din [[Special:Preferences|{{SITENAME}} iinstelangen]].',
'yourname' => 'Brükernoome:',
'yourpassword' => 'Pååsuurd:',
'yourpasswordagain' => 'Schriw pååsuurd nuch iinjsen:',
-'remembermypassword' => 'Aw diheere komputer foon duur önjmälde (maksimool for {{PLURAL:$1|däi|deege}})',
+'remembermypassword' => 'Aw diheere komputer foon duur önjmälde (maksimool for $1 {{PLURAL:$1|däi|deege}})',
'securelogin-stick-https' => 'Eefter önjmälding ma HTTPS ferbünen bliwe',
'yourdomainname' => 'Din domain:',
+'password-change-forbidden' => 'Üüb detheer wiki könst dü nian paaswurden feranre.',
'externaldberror' => 'Deer läit en fäägel bai jü äkstärn autentifisiiring for, unti dü möist din äkstärn brükerkonto äi aktualisiire.',
'login' => 'Önjmälde',
'nav-login-createaccount' => 'Önjmälde',
# E-mail sending
'php-mail-error-unknown' => 'Ünbekäänd feeler mä det funktsjuun mail() faan PHP.',
'user-mail-no-addy' => 'Köö niinj e-mail schake suner e-mail-adres.',
+'user-mail-no-body' => 'Dü wulst en e-mail saner tekst wechsjüür.',
# Change password dialog
'resetpass' => 'Pååsuurd änre',
'changeemail-oldemail' => 'Aktuel e-mail adres',
'changeemail-newemail' => 'Nei e-mail adres',
'changeemail-none' => '(niin)',
+'changeemail-password' => 'Din {{SITENAME}} paaswurd:',
'changeemail-submit' => 'E-mail adres feranre',
'changeemail-cancel' => 'Ufbreeg',
<span class="plainlinks">önj da deertuhiirende [{{fullurl:{{#special:Log}}|page={{FULLPAGENAMEE}}}} logböke säke] unti jüdeer sid [{{fullurl:{{FULLPAGENAME}}|action=edit}} beårbe]</span>.',
'noarticletext-nopermission' => 'Üüb detdiar sidj stäänt noch niks, oober dü mutst diar uk niks iinskriiw.
Dü könst diar üüb ööder sidjen efter [[Special:Search/{{PAGENAME}}|sjük]] of a <span class="plainlinks">[{{fullurl:{{#special:Log}}|page={{FULLPAGENAME}}}} logbuken uunluke].</span>',
+'missing-revision' => 'Det werjuun #$1 faan det sidj "{{PAGENAME}}" jaft at ei.
+
+Det komt diar miast faan, dat en ual ferwisang stregen wurden as.
+Dü könst det uun\'t [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} logbuk faan stregen sidjen] efterlees.',
'userpage-userdoesnotexist' => "Det brükerkonto ''$1'' as ei diar.
Wel dü detdiar sidj würelk maage/bewerke?",
'userpage-userdoesnotexist-view' => 'Benjüterkonto "$1" bestoont ai.',
'edit-already-exists' => 'Köö niinj nai sid mååge.
Dåt bestöö ål.',
'defaultmessagetext' => 'Standard tekst',
+'content-failed-to-parse' => "Parsing faan $2 för't model $1 ging skiaf: $3",
+'invalid-content-data' => 'Diar stäänt wat uun, wat diar ei hen hiart',
+'content-not-allowed-here' => '„$1“ mut ei skrewen wurd üüb sidj [[$2]]',
+
+# Content models
+'content-model-wikitext' => 'wikitekst',
+'content-model-text' => 'normool tekst',
+'content-model-javascript' => 'JavaScript',
+'content-model-css' => 'CSS',
# Parser/template warnings
'expensive-parserfunction-warning' => 'Woorschauing: Jüdeer sid önjthålt tu fool apteele foon widluftie parserfunksjoone.
'expansion-depth-exceeded-warning' => 'Detdiar sidj hää tuföl ütjwidjangen (expansion)',
'parser-unstrip-loop-warning' => 'Diar as en jinsidjag ferwisang',
'parser-unstrip-recursion-limit' => 'Tuföl jinsidjag ferwisangen bi $1',
+'converter-manual-rule-error' => "Bi't manuel reegel för't spriakferanrang lääpt wat skiaf.",
# "Undo" feature
'undo-success' => 'Detdiar feranrang koon turag nimen wurd.
'editundo' => 'tunintemååge',
'diff-multi' => '({{PLURAL:$1|Ian wersjuun diartesken|$1 wersjuunen diartesken}} faan {{PLURAL:$2|ään brüker|$2 brükern}} {{PLURAL:$1|woort|wurd}} ei uunwiset)',
'diff-multi-manyusers' => '({{PLURAL:$1|Ian wersjuun diartesken|$1 wersjuunen diartesken}} faan muar üs $2 {{PLURAL:$2|brüker|brükern}} wurd ei uunwiset)',
+'difference-missing-revision' => "{{PLURAL:$2|Ian werjuun|$2 werjuunen}} faan di ferskeel ($1) {{PLURAL:$2|as|san}} ei fünjen wurden.
+
+Det komt diar miast faan, dat en ual ferwisang stregen wurden as.
+Dü könst det uun't [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} logbuk faan stregen sidjen] efterlees.",
# Search results
'searchresults' => 'Säkjresultoote',
'api-error-nomodule' => 'Erro interno: Non hai ningún módulo de cargas.',
'api-error-ok-but-empty' => 'Erro interno: Non hai resposta do servidor.',
'api-error-overwrite' => 'Non está permitido sobrescribir un ficheiro existente.',
-'api-error-stashfailed' => 'Erro interno: O servidor non puido almacenar os ficheiros temporais.',
+'api-error-stashfailed' => 'Erro interno: O servidor non puido almacenar o ficheiro temporal.',
+'api-error-publishfailed' => 'Erro interno: O servidor non puido publicar o ficheiro temporal.',
'api-error-timeout' => 'O servidor non respondeu no tempo esperado.',
'api-error-unclassified' => 'Houbo un erro descoñecido.',
'api-error-unknown-code' => 'Erro descoñecido: "$1"',
'api-error-ok-but-empty' => 'שגיאה פנימית: אין תשובה מהשרת.',
'api-error-overwrite' => 'לא מותרת החלפת קובץ קיים.',
'api-error-stashfailed' => 'שגיאה פנימית: השרת נכשל באחסון הקובץ הזמני.',
+'api-error-publishfailed' => 'שגיאה פנימית: השרת נכשל בפרסום הקובץ הזמני.',
'api-error-timeout' => 'השרת לא השיב בזמן המצופה.',
'api-error-unclassified' => 'אירעה שגיאה בלתי ידועה.',
'api-error-unknown-code' => 'שגיאה בלתי ידועה: "$1".',
'watchthisupload' => 'Na dosya de şêr ke',
'license' => 'Lisans:',
-'license-header' => 'Lisanskerdene',
+'license-header' => 'Lisansdais',
# Special:ListFiles
'imgfile' => 'dosya',
'api-error-ok-but-empty' => '내부 오류: 서버에서 응답이 없습니다.',
'api-error-overwrite' => '이미 있는 파일을 덮어쓸 수 없습니다.',
'api-error-stashfailed' => '내부 오류: 서버가 임시 파일을 저장하지 못했습니다.',
+'api-error-publishfailed' => '내부 오류: 서버가 임시 파일을 게시하지 못했습니다.',
'api-error-timeout' => '서버가 제 시간 내에 응답하지 않았습니다.',
'api-error-unclassified' => '알 수 없는 오류가 발생했습니다.',
'api-error-unknown-code' => '알 수 없는 오류: "$1".',
'tog-externaleditor' => 'Nemm jedes Mol en extern Editor-Projramm (Doför bruchs de extra Enstellunge op Dingem Kompjutor. Dat es jet för Fachlück. Doh kanns De [//www.mediawiki.org/wiki/Manual:External_editors mieh drövver lässe])',
'tog-externaldiff' => 'Nemm jedes Mol en extern Diff-Projramm (Doför bruchs de extra Enstellunge op Dingem Kompjutor. Dat es jet för Fachlück. Doh kanns De [//www.mediawiki.org/wiki/Manual:External_editors mieh drövver lässe])',
'tog-showjumplinks' => '„Jangk-noh“-Links usjevve, die bei em „Zojang ohne Barrikad“ helfe dun',
-'tog-uselivepreview' => 'Dun de „Lebendije Vör-Aansich“ zeije (em Usprobierstadium, un bruch Java_Skripp)',
+'tog-uselivepreview' => 'Dun de „Lebendije Vör-Aansich“ zeije (bruch Java_Skripp)',
'tog-forceeditsummary' => 'Froch noh, wann en däm Feld „Koot zosammejefass, Quell“ beim Avspeichere nix dren steiht',
'tog-watchlisthideown' => 'Dun ming eije Änderunge <strong>nit</strong> en minger Oppassliss aanzeije',
'tog-watchlisthidebots' => 'Dun jedes Mol dä Bots ehr Änderunge <strong>nit</strong> en minger Oppassliss zeije',
'api-error-nomodule' => 'Внатрешна грешка: нема зададено модул за подигање.',
'api-error-ok-but-empty' => 'Внатрешна грешка: опслужувачот не одговара.',
'api-error-overwrite' => 'Презапишувањето врз постоечки податотеки не е дозволено.',
-'api-error-stashfailed' => 'Внатрешна грешка: опслужувачот не успеа да ја складира привремената податотека.',
+'api-error-stashfailed' => 'Внатрешна грешка: Опслужувачот не успеа да ја складира привремената податотека.',
+'api-error-publishfailed' => 'Внатрешна грешка: Опслужувачот не успеа да ја објави привремената податотека.',
'api-error-timeout' => 'Опслужувачот не одговори во очекуваното време.',
'api-error-unclassified' => 'Се појави непозната грешка.',
'api-error-unknown-code' => 'Непозната грешка: „$1“',
'category-empty' => "''ഈ വർഗ്ഗത്തിൽ താളുകളോ പ്രമാണങ്ങളോ ഇല്ല.''",
'hidden-categories' => '{{PLURAL:$1|മറഞ്ഞിരിക്കുന്ന വർഗ്ഗം|മറഞ്ഞിരിക്കുന്ന വർഗ്ഗങ്ങൾ}}',
'hidden-category-category' => 'മറഞ്ഞിരിക്കുന്ന വർഗ്ഗങ്ങൾ',
-'category-subcat-count' => '{{PLURAL:$2|à´\88 വർà´\97àµ\8dà´\97à´¤àµ\8dതിനàµ\8d, താഴàµ\86 നൽà´\95ിയിരിà´\95àµ\8dà´\95àµ\81à´¨àµ\8dà´¨ à´\92à´°àµ\81 à´\89പവർà´\97àµ\8dà´\97à´\82 മാതàµ\8dരമാണàµ\81à´³àµ\8dളതàµ\8d.|à´\88 വർà´\97àµ\8dà´\97à´¤àµ\8dതിനàµ\8d $2 à´\89പവർà´\97àµ\8dà´\97à´\99àµ\8dà´\99à´³àµ\81à´³àµ\8dളതിൽ {{PLURAL:$1|à´\92à´°àµ\86à´£àµ\8dà´£à´\82|$1 à´\8eà´£àµ\8dà´£à´\82}} താഴàµ\86 നൽà´\95à´¿à´¯ിരിക്കുന്നു.}}',
+'category-subcat-count' => '{{PLURAL:$2|à´\88 വർà´\97àµ\8dà´\97à´¤àµ\8dതിനàµ\81 താഴàµ\86 നൽà´\95ിയിരിà´\95àµ\8dà´\95àµ\81à´¨àµ\8dà´¨ à´\92à´°àµ\81 à´\89പവർà´\97àµ\8dà´\97à´\82 മാതàµ\8dരമാണàµ\81à´³àµ\8dളതàµ\8d.|à´\88 വർà´\97àµ\8dà´\97à´¤àµ\8dതിനàµ\8d à´\86à´\95àµ\86 $2 à´\89പവർà´\97àµ\8dà´\97à´\99àµ\8dà´\99ൾ à´\89à´³àµ\8dളതിൽ {{PLURAL:$1|à´\92à´°àµ\81 à´\89പവർà´\97àµ\8dà´\97à´\82|$1 à´\89പവർà´\97àµ\8dà´\97à´\99àµ\8dà´\99ൾ}}, താഴàµ\86à´\95àµ\8dà´\95àµ\8aà´\9fàµ\81à´¤àµ\8dà´¤ിരിക്കുന്നു.}}',
'category-subcat-count-limited' => 'ഈ വർഗ്ഗത്തിനു താഴെ നൽകിയിരിക്കുന്ന {{PLURAL:$1|ഉപവർഗ്ഗമുണ്ട്|$1 ഉപവർഗ്ഗങ്ങളുണ്ട്}}.',
'category-article-count' => '{{PLURAL:$2|ഈ വർഗ്ഗത്തിൽ താഴെ നൽകിയിരിക്കുന്ന ഒരു താൾ മാത്രമാണുള്ളത്.|ഈ വർഗ്ഗത്തിൽ $2 താളുകളുള്ളതിൽ {{PLURAL:$1|ഒരു താൾ|$1 എണ്ണം}} താഴെ നൽകിയിരിക്കുന്നു.}}',
'category-article-count-limited' => 'ഈ വർഗ്ഗത്തിൽ താഴെ നൽകിയിരിക്കുന്ന {{PLURAL:$1|ഒരു താൾ ഉണ്ട്|$1 താളുകൾ ഉണ്ട്}}.',
# Move page
'move-page' => '$1 മാറ്റുക',
'move-page-legend' => 'താൾ മാറ്റുക',
-'movepagetext' => "താഴെയുള്ള ഫോം ഒരു താളിനെ പുനർനാമകരണം ചെയ്യാനുള്ളതാണ്.
-താളിന്റെ പഴയരൂപങ്ങളും ഈ മാറ്റത്തിന് വിധേയമാക്കപ്പെടും.
+'movepagetext' => "താഴെയുള്ള ഫോം ഒരു താളിനെ പുനർനാമകരണം ചെയ്യാനുള്ളതാണ്, താളിന്റെ നാൾവഴിയും അക്കൂടെ പുതിയ പേരിലേയ്ക്ക് മാറുന്നതാണ്.
പഴയ തലക്കെട്ട്, പുതിയ തലക്കെട്ടുള്ള താളിലേക്കുള്ള ഒരു തിരിച്ചുവിടൽ താളായി മാറും.
പഴയ തലക്കെട്ടിലേക്കുള്ള തിരിച്ചുവിടലുകൾ യന്ത്രങ്ങൾ ഉപയോഗിച്ച് താങ്കൾക്ക് ശരിയാക്കാവുന്നതാണ്.
അങ്ങനെ വേണ്ട എന്നാണ് താങ്കളാഗ്രഹിക്കുന്നതെങ്കിൽ [[Special:DoubleRedirects|ഇരട്ട തിരിച്ചുവിടലുകളോ]], [[Special:BrokenRedirects|ഫലപ്രദമല്ലാത്ത തിരിച്ചുവിടലുകളോ]] ഉണ്ടാകുന്നുണ്ടോയെന്ന് ദയവായി പരിശോധിക്കുക.
'blocklist-tempblocks' => 'Gøym mellombelse blokkeringar',
'blocklist-addressblocks' => 'Gøym einskilde IP-blokkeringar',
'blocklist-rangeblocks' => 'Gøym intervallblokkeringar',
-'blocklist-timestamp' => 'Tidsmerkje',
+'blocklist-timestamp' => 'Tidsmerke',
'blocklist-target' => 'Mål',
'blocklist-expiry' => 'Endar',
'blocklist-by' => 'Blokkerande admin',
'allmessages' => 'Systemmeldingar',
'allmessagesname' => 'Namn',
'allmessagesdefault' => 'Standardtekst',
-'allmessagescurrent' => 'Noverande tekst',
+'allmessagescurrent' => 'Gjeldande meldingstekst',
'allmessagestext' => 'Dette er ei liste over systemmeldingar i MediaWiki-namnerommet.
Vitja [//www.mediawiki.org/wiki/Localisation MediaWiki Localisation] og [//translatewiki.net translatewiki.net] om du ynskjer å bidra til den generelle omsetjinga av MediaWiki.',
'allmessagesnotsupportedDB' => "Denne sida kan ein ikkje bruka fordi «'''\$wgUseDatabaseMessages'''» er slått av.",
'badtitle' => 'Títol marrit',
'badtitletext' => 'Lo títol de la pagina demandada es invalid, void o s’agís d’un títol interlenga o interprojècte mal ligat. Benlèu conten un o maites caractèrs que pòdon pas èsser utilizats dins los títols.',
'perfcached' => "Las donadas seguendas son en escondedor e benlèu, son pas a jorn. Un maximum de {{PLURAL:$1|un resultat|$1 resultats}} es disponible dins l'escondedor.",
-'perfcachedts' => "Las donadas que segon son dins l'amagatal, son doncas pas forçadament a jorn. La darrièra actualizacion data del $1. A maximum of {{PLURAL:$4|one result is|$4 results are}} available in the cache.",
+'perfcachedts' => "Las donadas seguendas son en escondedor e benlèu, son pas a jorn. Un maximum de {{PLURAL:$1|un resultat|$1 resultats}} es disponible dins l'escondedor.",
'querypage-no-updates' => 'Las mesas a jorn per aquesta pagina son actualamnt desactivadas. Las donadas çaijós son pas mesas a jorn.',
'wrong_wfQuery_params' => 'Paramètres incorrèctes sus wfQuery()<br />
Foncion : $1<br />
'viewsource-title' => 'Veire la font de $1',
'actionthrottled' => 'Accion limitada',
'actionthrottledtext' => "Per luchar contra lo spam, l’utilizacion d'aquesta accion es limitada a un cèrt nombre de còps dins una sosta pro corta. S'avèra qu'avètz depassat aqueste limit. Ensajatz tornamai dins qualques minutas.",
-'protectedpagetext' => 'Aquesta pagina es estada protegida per empachar sa modificacion.',
+'protectedpagetext' => "Aquesta pagina es estada protegida per empachar sa modificacion o d'autras accions.",
'viewsourcetext' => 'Podètz veire e copiar lo contengut de l’article per poder trabalhar dessús :',
+'viewyourtext' => "Podètz veire e copiar lo contengut de '''vòstras modificacions''' a aquesta pagina :",
'protectedinterface' => 'Aquesta pagina provesís de tèxte d’interfàcia pel logicial e es protegida per evitar los abuses.',
'editinginterface' => "'''Atencion :''' sètz a editar una pagina utilizada per crear lo tèxte de l’interfàcia del logicial. Los cambiaments se repercutaràn, segon lo contèxte, sus totas o d'unas paginas visiblas pels autres utilizaires. Per las traduccions, vos convidam a utilizar lo projècte MediaWiki d'internacionalizacion dels messatges [//translatewiki.net/wiki/Main_Page?setlang=oc translatewiki.net].",
'sqlhidden' => '(Requèsta SQL amagada)',
'emailconfirmlink' => 'Confirmatz vòstra adreça de corrièr electronic',
'invalidemailaddress' => "Aquesta adreça de corrièr electronic pòt pas èsser acceptada perque sembla qu'a un format incorrècte.
Picatz una adreça plan formatada o daissatz aqueste camp void.",
+'emaildisabled' => 'Aqueste site pòt pas mandar de corrièls.',
'accountcreated' => 'Compte creat.',
'accountcreatedtext' => "Lo compte d'utilizaire de $1 es estat creat.",
'createaccount-title' => "Creacion d'un compte per {{SITENAME}}",
'usernamehasherror' => "Lo nom d'utilizaire pòt pas conténer de caractèrs de hachage",
'login-throttled' => 'Avètz ensajat tròp de temptativas de connexion darrièrament.
Esperatz abans d’ensajar tornamai.',
+'login-abort-generic' => 'Vòstra temptativa de connexion a fracassat',
'loginlanguagelabel' => 'Lenga: $1',
'suspicious-userlogout' => 'Vòstra demanda de desconnexion es estada refusada perque sembla qu’es estada mandada per un navigador copat o la mesa en escondedor d’un proxy.',
+# E-mail sending
+'php-mail-error-unknown' => 'Error desconeguda dins la foncion mail() de PHP.',
+
# Change password dialog
'resetpass' => 'Cambiar lo senhal del compte',
'resetpass_announce' => 'Vos sètz enregistrat amb un senhal temporari mandat per corrièr electronic. Per acabar l’enregistrament, vos cal picar un senhal novèl aicí :',
'resetprefs' => 'Oischdellunge verwerfe',
'guesstimezone' => 'Aus em Browser iwwernemme',
'yourrealname' => 'Birscherlischer Nome:',
+'yourlanguage' => 'Schbrooch:',
'gender-unknown' => 'Ghoim gkalde',
# Groups
'group-bureaucrat' => 'Birokrade',
'group-all' => '(alle)',
-'group-bot-member' => 'Bot',
-'group-sysop-member' => 'Adminischdrador',
-'group-bureaucrat-member' => 'Birokrad',
+'group-bot-member' => '{{GENDER:$1|Bot}}',
+'group-sysop-member' => '{{GENDER:$1|Adminischdrador}}',
+'group-bureaucrat-member' => '{{GENDER:$1|Birokrad}}',
'grouppage-sysop' => '{{ns:project}}:Adminischtratore',
'rcshowhidemine' => 'Mai Bearwaidunge $1',
'rclinks' => 'Zeich die letschte $1 Ännerunge in de letschte $2 Dache<br />$3',
'diff' => 'Unnerschied',
-'hist' => 'Gschicht',
+'hist' => 'Gschichd',
'hide' => 'vaschdeggle',
'show' => 'zaische',
'minoreditletter' => 'k',
'uploadbtn' => 'Datei hochlade',
'uploadlogpage' => 'Dateie-Logbuch',
'filedesc' => 'Zommefassung',
+'fileuploadsummary' => 'Zommefassung:',
'savefile' => 'Datei schbeichere',
-'uploadedimage' => 'hot „[[$1]]“ hochglade',
+'uploadedimage' => 'hod „[[$1]]“ nuffglade',
# Lock manager
'lockmanager-notlocked' => '„$1“ hod ned uffgmachd were kenne, die isch ganed gschberd gwesd.',
{{Identical|$1 bots}}",
'rcshowhideliu' => 'Option text in [[Special:RecentChanges]]',
'rcshowhideanons' => "Option text in [[Special:RecentChanges]]. Parameters:
-* $1 is the 'show/hide' command, with the text taken from either {{msg-mw|show}} or {{msg-mw|hide}}.",
+* $1 is the 'show/hide' command, with the text taken from either {{msg-mw|show}} or {{msg-mw|hide}}.
+{{Identical|Anonymous user}}",
'rcshowhidepatr' => "Option text in [[Special:RecentChanges]]. Parameters:
* $1 is the 'show/hide' command, with the text taken from either {{msg-mw|show}} or {{msg-mw|hide}}.",
'rcshowhidemine' => "Option text in [[Special:RecentChanges]]. Parameters:
**{{msg-mw|enotif body intro deleted}}
**{{msg-mw|enotif body intro created}}
**{{msg-mw|enotif body intro moved}}
-**{{msg-mw|enotif body intro restored}}
+**{{msg-mw|enotif body intro restored}}
**{{msg-mw|enotif body intro changed}} (for all the other cases).
*$NEWPAGE consists of either
**if the page is new (in older releases), {{msg-mw|enotif newpagetext}}
'rollback' => '{{Identical|Rollback}}',
'rollback_short' => '{{Identical|Rollback}}',
'rollbacklink' => '{{Identical|Rollback}}
-This link text appears on the recent changes page to users who have the "rollback" right.
+This link text appears on the recent changes page to users who have the "rollback" right.
This message has a tooltip {{msg-mw|tooltip-rollback}}
{{Doc-actionlink}}',
See also {{msg-mw|Minutes-abbrev}}
-Part of variable $1 in {{msg-mw|Ago}}',
+Part of variable $1 in {{msg-mw|Ago}}.
+{{Identical|Minute}}',
'hours' => 'Full word for "hours". $1 is the number of hours.
See also {{msg-mw|Hours-abbrev}}
'api-error-ok-but-empty' => 'API error message that can be used for client side localisation of API errors.',
'api-error-overwrite' => 'API error message that can be used for client side localisation of API errors.',
'api-error-stashfailed' => 'API error message that can be used for client side localisation of API errors.',
+'api-error-publishfailed' => 'API error message that can be used for client side localisation of API errors.',
'api-error-timeout' => 'API error message that can be used for client side localisation of API errors.',
'api-error-unclassified' => 'API error message that can be used for client side localisation of API errors.',
'api-error-unknown-code' => 'API error message that can be used for client side localisation of API errors. Parameters:
# Durations
'duration-seconds' => '{{Related|Duration}}',
-'duration-minutes' => '{{Related|Duration}}',
+'duration-minutes' => '{{Related|Duration}}
+{{Identical|Minute}}',
'duration-hours' => '{{Related|Duration}}',
'duration-days' => '{{Related|Duration}}',
'duration-weeks' => '{{Related|Duration}}',
'api-error-ok-but-empty' => "Errore inderne: Nisciune resposte da 'u server.",
'api-error-overwrite' => "'A sovrascritture de 'nu file ca esiste non ge se pò fà.",
'api-error-stashfailed' => "Errore inderne: 'U server ha fallite 'a reggistrazione de le file temboranèe.",
+'api-error-publishfailed' => "Errore inderne: 'U server ha fallite 'a pubblecazione d'u file temboranèe.",
'api-error-timeout' => "'U server non g'ave resposte jndr'à 'u tiembe ca 'u spettave.",
'api-error-unclassified' => "'N'errore scanusciute s'a verificate",
'api-error-unknown-code' => 'Errore scanusciute: "$1"',
'newwindow' => '(öppnas i ett nytt fönster)',
'cancel' => 'Avbryt',
'moredotdotdot' => 'Mer...',
+'morenotlisted' => 'Mer som inte är listad...',
'mypage' => 'Min sida',
'mytalk' => 'Diskussion',
'anontalk' => 'Diskussionssida för denna IP-adress',
Om du väljer att inte göra det, kontrollera då att du inte skapar några [[Special:DoubleRedirects|dubbla]] eller [[Special:BrokenRedirects|trasiga omdirigeringar]].
Du bör också se till att länkar fortsätter att peka dit de ska.
-Notera att sidan '''inte''' kan flyttas om det redan finns en sida under den nya sidtiteln, såvida inte den sidan är tom eller en omdirigering till den gamla titeln och saknar annan versionshistorik.
+Notera att sidan '''inte''' kan flyttas om det redan finns en sida under den nya sidtiteln, såvida inte den sidan är en omdirigering till den gamla titeln och saknar annan versionshistorik.
Det innebär att du kan flytta tillbaks en sida om du råkar göra fel, och att du inte kan skriva över existerande sidor.
'''VARNING!'''
'api-error-ok-but-empty' => 'Internt fel: Inget svar från servern.',
'api-error-overwrite' => 'Det är inte tillåtet att skriva över en befintlig fil.',
'api-error-stashfailed' => 'Internt fel: servern kunde inte lagra temporär fil.',
+'api-error-publishfailed' => 'Internt fel: Servern kunde inte publicera temporär fil.',
'api-error-timeout' => 'Servern svarade inte inom förväntad tid.',
'api-error-unclassified' => 'Ett okänt fel uppstod',
'api-error-unknown-code' => 'Okänt fel: "$1"',
'tog-previewontop' => "Mostra l'anteprima sora ła caseła de modifega e no soto",
'tog-previewonfirst' => "Mostra l'anteprima par ła prima modifega",
'tog-nocache' => 'Disativa ła cache par łe pajine del browser',
-'tog-enotifwatchlistpages' => 'Segnałame via e-mail łe modifeghe a łe pajine oservae',
+'tog-enotifwatchlistpages' => "Segnałame via e-mail có vien canbià na pàjina o un file prexente inte ła lista de łe tegnùe d'ocio",
'tog-enotifusertalkpages' => 'Avìseme par e-mail se i scrive su la me pagina de discussion',
-'tog-enotifminoredits' => 'Avìseme par e-mail anca par i canbiamenti picenini',
+'tog-enotifminoredits' => "Avìxeme par e-mail anca pa' i canbiamenti picenini de pàjine e file",
'tog-enotifrevealaddr' => 'Fà védar el me indirisso e-mail in tei messagi de aviso',
'tog-shownumberswatching' => 'Mostra el numaro de utenti che i ga ła pajina en oservasion',
'tog-oldsig' => 'Anteprima de ła firma:',
'underline-always' => 'Senpre',
'underline-never' => 'Mai',
-'underline-default' => 'Mantieni łe inpostasion del browser',
+'underline-default' => 'Mantien łe inpostasion del browser o de ła skin',
# Font style option in Special:Preferences
'editfont-style' => "Stiłe font de l'area de modifega:",
'cancel' => 'Lassa star',
'moredotdotdot' => 'Altro...',
'morenotlisted' => 'Altro nó elencà',
-'mypage' => 'La me pagina',
+'mypage' => 'Pàjina',
'mytalk' => 'Discussion',
'anontalk' => 'Discusion par sto IP',
'navigation' => 'Navigasion',
'vector-action-protect' => 'Protezi',
'vector-action-undelete' => 'Recupera',
'vector-action-unprotect' => 'Canbia ła protesion',
-'vector-simplesearch-preference' => "Intaca i sugerimenti di ricerca avansadi (solo par l'interfacia Vector)",
+'vector-simplesearch-preference' => "Abiłita ła sbara par ła riserca senplifegà (soło che par l'interfacia Vector)",
'vector-view-create' => 'Crea',
'vector-view-edit' => 'Canbia',
'vector-view-history' => "Varda ła 'storia",
# General errors
'error' => 'Erore',
'databaseerror' => 'Erore del database',
-'dberrortext' => 'Erore de sintassi ne ła richiesta inoltrà al database.
-Ciò podaria indicare ła presensa de on bug nel software.
-L\'ultima query invià al database xè sta:
+'dberrortext' => 'Eror de sintasi inte ła dimanda inoltrà al database.
+Ciò podaria indicar ła prexensa de un bug inte\'l software.
+L\'ultema query invià al database ła xè sta:
<blockquote><tt>$1</tt></blockquote>
riciamà da ła funsion "<tt>$2</tt>".
-El database el ga restituio el seguente erore "<tt>$3: $4</tt>".',
+El database el ga restituio el seguente eror "<tt>$3: $4</tt>".',
'dberrortextcl' => 'Erore de sintasi ne ła richiesta inoltrà al database.
L\'ultima query invià al database xè sta:
"$1"
'viewsource-title' => 'Varda el testo de $1',
'actionthrottled' => 'Asion ritardà',
'actionthrottledtext' => "Come misura de sicuresa contro e o spam, l'esecusion de alcune asion e a xè limità a on numaro masimo de volte en on determinà periodo de tenpo, limite che en questo caso xè sta superà. Se prega de riprovare tra qualche minuto.",
-'protectedpagetext' => 'Sta pagina la xe stà proteta de modo che nissuni possa canbiarla.',
+'protectedpagetext' => 'Sta pàjina ła xe stà proteta de modo che nisun posa canbiarla o far altre operasion.',
'viewsourcetext' => 'Se pole vardar e copiar el testo de sta pagina:',
'viewyourtext' => "Xè posibile vedàre e copiare el codexe sorzente de le '''to modifighe''' a sta pajina:",
-'protectedinterface' => "Sta pagina la gà drento un testo de l'interfacia utente del software, quindi la xe proteta parché nissuni la strussia.",
-'editinginterface' => "'''Ocio:''' El testo de sta pajina el fa parte de l'interfacia utente del sito. Tute łe modifeghe aportae a sta pajina se riflete so i mesaji visuałizà par tuti i utenti.
-Par łe tradusion, considera ła posibiłità de usare [//translatewiki.net/wiki/Main_Page?setlang=vec translatewiki.net], el projeto MediaWiki par ła localizasion.",
+'protectedinterface' => "Sta pàjina ła gà drento un testo de l'interfacia utente del software de sto sito, quindi la xe proteta parché nisuni ła strusie.
+Par xontar o modifegar tradusion par tute łe wiki doparar [//translatewiki.net/ translatewiki.net], el projeto de locałixasion de MediaWiki.",
+'editinginterface' => "'''Ocio:''' El testo de sta pàjina el fa parte de l'interfacia utente del sito. Tute łe modifeghe aportae a sta pajina se riflete so i mesaji visuałixà par tuti i utenti so sta wiki.
+Par xontare o modifegar łe tradusion vałide so tute łe wiki, considera ła posibiłità de doparar [//translatewiki.net/wiki/Main_Page?setlang=vec translatewiki.net], el projeto MediaWiki par ła localixasion.",
'sqlhidden' => '(ła query SQL ła xè sta sconta)',
'cascadeprotected' => 'So sta pajina no xè posibiłe efetuare modifeghe parché xè sta inclusa {{PLURAL:$1|ne ła pajina indicà de seguito, che xè sta proteta|ne łe pajine indicae de seguito, che e xè sta protete}} sełesionando ła protesion "ricorsiva":
$2',
'userpage-userdoesnotexist-view' => 'L\'utensa "$1" no la xe gnancora registrà.',
'blocked-notice-logextract' => "Sto utente xè atualmente blocà.
L'ultimo ełemento del rejistro de i blochi xè riportà de seguito par informasion:",
-'clearyourcache' => "Ocio: dopo aver salvà, połe darse che te gabi da netare ła cache del to browser par védar i canbiamenti.
+'clearyourcache' => "Ocio: dopo 'ver salvà, pol darse che te gabi da netare ła cache del to browser par védar i canbiamenti.
*Par '''Firefox / Safari:''' tien macà el boton de łe majuscołe e schicia \"Recarga\", o senò maca ''Ctrl-F5'' o ''Ctrl-R'' (''⌘-R'' se te ghè el Mac)
-*Par '''Google Chrome''':schicia ''Ctrl-Shift-R'' (''⌘-Shift-R'' co' un Mac)
+*Par '''Google Chrome''':schicia ''Ctrl-Shift-R'' (''⌘-Shift-R'' có un Mac)
*Par '''Internet Explorer''': tien schicià el boton \"Ctrl\" fin che te schici '''Recarga''', senò schicia '''Ctrl+F5'''
-*Par '''Konqueror''': schicia \"Recarga\" o maca ''F5'';
-*Par '''Opera:''' néta la cache in ''Strumenti → Preferense;''",
+*Par '''Opera:''' néta la cache in ''Strumenti → Prefarense;''",
'usercssyoucanpreview' => "'''Sugerimento:''' se consiglia de doparar el boton \"{{int:showpreview}} par proàr i novi CSS prima de salvarli.",
'userjsyoucanpreview' => "'''Sugerimento:''' se consiglia de doparar el boton \"{{int:showpreview}}\" par proàr i novi JavaScript prima de salvarli.",
'usercsspreview' => "'''Sta qua la xe solo n'anteprima del proprio CSS personal.
'updated' => '(Agiornà)',
'note' => "'''Nota:'''",
'previewnote' => "Sta cua ła xe soło n'anteprima; i canbiamenti a ła pajina NO i xe gnancora stà salvài!",
-'continue-editing' => 'Continua modifegare',
+'continue-editing' => "Va a l'area de modifega",
'previewconflict' => 'Sta anteprima la corisponde al testo ne la casèla de edizion de sora, e la fa védar come vegnarà fora la pagina se te machi "Salva la pagina" in sto momento.',
'session_fail_preview' => "No xè stà possibiłe salvar le to modifiche parché i dati de la session i xè andai persi.
Par piaser, riproa da novo.
'revdelete-no-change' => "''Ocio:''' la version datà $1 a le $2 la gà zà le inpostassion de visibilità da ti richieste.",
'revdelete-concurrent-change' => "No se riesse a modificar la version datà $1 a le $2: pararìa che qualchidun altro el gavesse canbià el stato de la version intanto che ti te sercavi de far la stessa roba. Daghe n'ociada sui registri.",
'revdelete-only-restricted' => "Eròr sercando de scondar l'elemento datà $1 a le $2: no te podi inpedirghe ai aministradori de vardar na revision se no te selessioni al tenpo stesso una de le altre opzioni de restrizion.",
-'revdelete-reason-dropdown' => '*Motivassion pi comuni par la scancelassion
-** Violassion de copyright
-** Informassion personali inapropriàe',
+'revdelete-reason-dropdown' => '*Motivasion pi comuni par la scansełasion
+** Viołasion de copyright
+** Comenti o informasion personali inapropriàe
+** Nome utente inapropià
+** Informasion potensialmente difamatoria',
'revdelete-otherreason' => 'Altro:',
'revdelete-reasonotherlist' => 'Altra motivassion',
'revdelete-edit-reasonlist' => 'Modifica le motivazion par la scancelazion',
'prefs-rc' => 'Ultime modifeghe',
'prefs-watchlist' => "Pàjine tegnùe d'ocio",
'prefs-watchlist-days' => 'Nùmaro de giòrni da far védar nei osservati speciali:',
-'prefs-watchlist-days-max' => 'Masimo $1 dì',
+'prefs-watchlist-days-max' => 'Masimo $1 {{PLURAL:$1|xorno|xorni}}',
'prefs-watchlist-edits' => 'Nùmaro de modifiche da far védar con le funzion avanzade:',
'prefs-watchlist-edits-max' => 'Numaro massimo: 1000',
'prefs-watchlist-token' => "Segnal par le pagine tegnùe d'ocio:",
'timezoneregion-indian' => 'Oceano Indian',
'timezoneregion-pacific' => 'Oceano Pacifico',
'allowemail' => 'Consenti la ricezion de e-mail da altri utenti<sup>1</sup>',
-'prefs-searchoptions' => 'Opsioni de riserca',
+'prefs-searchoptions' => 'Riserca',
'prefs-namespaces' => 'Namespace',
'defaultns' => 'Serca in sti namespace se no diversamente specificà:',
'default' => 'predefinìo',
'prefs-emailconfirm-label' => "Conferma de l'e-mail:",
'prefs-textboxsize' => 'Dimension de la casèla de modifica',
'youremail' => 'La to e-mail',
-'username' => 'Nome utente',
-'uid' => 'ID utente:',
-'prefs-memberingroups' => 'Menbro {{PLURAL:$1|del grupo|dei grupi}}:',
+'username' => '{{GENDER:$1|Nome utente}}:',
+'uid' => '{{GENDER:$1|ID utente}}:',
+'prefs-memberingroups' => '{{GENDER:$2|Menbro}} {{PLURAL:$1|del grupo|de i grupi}}:',
'prefs-registration' => 'Data de registrassion:',
'yourrealname' => 'El to vero nome:',
'yourlanguage' => 'Lengua:',
'disambiguations' => 'Pajine cołegade a pajine de dixanbiguasion',
'disambiguationspage' => 'Template:Disambigua',
-'disambiguations-text' => "Le pagine ne la lista che segue le contien dei colegamenti a '''pagine de disanbiguazion''' e no a l'argomento a cui le dovarìà far riferimento.<br />
-Vien considerà pagine de disanbiguazion tute quele che contien i modèi elencà in [[MediaWiki:Disambiguationspage]]",
+'disambiguations-text' => "Łe pàjine inte ła lista cuà soto łe ga drento almanco un ligamento a na '''pàjina de dixanbiguasion'''.
+Łe podaria dover puntar a na pàjina pì apropià.<br />
+Vien considerae pàjine de dixanbiguasion tute cuełe che łe ga drento i modełi elencai in [[MediaWiki:Disambiguationspage]].",
'doubleredirects' => 'Redirect dopi',
'doubleredirectstext' => 'Sta pagina le elenca pagine che rimanda a altre pagine de rimando.
'linksearch-pat' => 'Espression de riserca:',
'linksearch-ns' => 'Namespace:',
'linksearch-ok' => 'Serca',
-'linksearch-text' => 'Xe posibiłe doparare metacarateri, come "*.wikipedia.org".<br />
-Xe necesario almanco un dominio de primo liveło, tipo "*.org".<br />
-Protocołi suportadi: <code>$1</code> (no sta xontare nesuno de sti cuà inte ła to riçerca).',
+'linksearch-text' => 'Xe posibiłe doparare metacarateri, come "*.wikipedia.org".
+Xe nesesario almanco un dominio de primo liveło, tipo "*.org".<br />
+{{PLURAL:$2|Protocoło suportà|Protocołi suportai}}: <code>$1</code> (predefinio http:// se nisun protocoło el xe spesifegà).',
'linksearch-line' => '$1 presente ne la pagina $2',
'linksearch-error' => "I metacaràteri i pode vegner doparài solo a l'inizio del nome de l'host.",
'emailuser-title-target' => 'Scrivi na e-mail a {{GENDER:$1|sto|sta}} utente',
'emailuser-title-notarget' => "Scrivi na e-mail a l'utente",
'emailpage' => "Scrivi na e-mail a l'utente",
-'emailpagetext' => 'Te podi usar el modulo chi soto par mandare na e-mail a sto utente.
-La e-mail che te ghè indicà ne le [[Special:Preferences|to preferense]] la vegnarà fora nel canpo "Da" de la mail, così che el destinatario el possa rispóndarte a ti diretamente.',
+'emailpagetext' => 'Te podi usar el moduło chi soto par mandare na e-mail a sto {{GENDER:$1|utente}}.
+Ła e-mail che te ghè indicà inte łe [[Special:Preferences|to prefarense]] ła vegnarà fora inte\'l canpo "Da" de la mail, cusì che\'l destinatario el posa rispóndarte diretamente a ti.',
'usermailererror' => "L'ogeto mail el gà restituìo l'eror:",
'defemailsubject' => 'Mesajo da {{SITENAME}} dal utente "$1"',
'usermaildisabled' => 'e-mail utente disabiłità',
'watchnologin' => 'Acesso mia efetuà',
'watchnologintext' => 'Te ghè prima da far el [[Special:UserLogin|login]] par modificar la to lista de osservati speciali.',
'addwatch' => "Tien d'ocio",
-'addedwatchtext' => "La pagina \"[[:\$1]]\" la xe stà zontà a la to [[Special:Watchlist|lista de pagine da tegner d'ocio]].
-I futuri canbiamenti a sta pagina e a la so pagina de discussion i se vedarà fora qua, e la pagina la se vedarà in '''grosso''' sui [[Special:RecentChanges|ultimi canbiamenti]] par tegnerla d'ocio mejo.",
+'addedwatchtext' => 'Ła pagina "[[:$1]]" ła xe stà xontà a ła to [[Special:Watchlist|lista de pàjine da tegner d\'ocio]].
+I futuri canbiamenti a sta pàjina e a ła so pàjina de discusion i vegnarà elencai in cheła pàjina là.',
'removewatch' => "Cava da łe tegnùe d'ocio",
'removedwatchtext' => 'La pagina "[[:$1]]" la xe stà cavà da le to [[Special:Watchlist|pagine tegnùe de ocio]].',
'watch' => "Tien d'ocio",
'watchmethod-list' => 'controło de i osservati speciałi par modifeghe recenti',
'watchlistcontains' => 'La lista de i osservati speciałi la contien {{PLURAL:$1|una pagina|$1 pagine}}.',
'iteminvalidname' => "Problemi con la voxe '$1', nome mìa vałido...",
-'wlnote' => "Qua soto te cati {{PLURAL:$1|l'ultimo canbiamento|i ultimi '''$1''' canbiamenti}} ne {{PLURAL:$2|l'ultima ora|le ultime '''$2''' ore}}.",
+'wlnote' => "Cuà soto te cati {{PLURAL:$1|'l ultimo canbiamento|i ultimi '''$1''' canbiamenti}} inte {{PLURAL:$2|l'ultema ora|łe ultime '''$2''' ore}}; i dati i xe axornai a łe $4 del $3.",
'wlshowlast' => 'Mostra le ultime $1 ore $2 zorni $3',
'watchlist-options' => "Inpostassion de le pagine tegnùe d'ocio",
'enotif_anon_editor' => 'utente anonimo $1',
'enotif_body' => 'Caro/a $WATCHINGUSERNAME,
-ła pàxena $PAGETITLE de {{SITENAME}} la xè stà $CHANGEDORCREATED el $PAGEEDITDATE da $PAGEEDITOR, varda $PAGETITLE_URL par ła version atuałe.
-
-$NEWPAGE
+$PAGEINTRO $NEWPAGE
-Somario del redator: $PAGESUMMARY $PAGEMINOREDIT
+Ogeto del intervento, inserio dal autor: $PAGESUMMARY $PAGEMINOREDIT
-Contatta el redator:
-mail: $PAGEEDITOR_EMAIL
-wiki: $PAGEEDITOR_WIKI
+Contata l\'autor:
+via posta eletronega: $PAGEEDITOR_EMAIL
+so\'l sito: $PAGEEDITOR_WIKI
-No ghe sarà altre notifiche in caso de ulteriori canbiamenti, a manco che ti no te visiti sta pàxena.
-Te podi anca reinpostar l\'avixo de notifica par tuti i osservati speciałi de ła to łista.
+Nó vegnarà inviae altre notifeghe in caxo de ulteriori atività, se nó te vixiti ła pàjina. Inoltre, xe posibiłe modifegar łe inpostasion de notifega par tute łe pàjine inte ła lista de łe tegnùe d\'ocio.
- El to amichevole sistema de notifica de {{SITENAME}}
+ El sistema de notifega de {{SITENAME}}, al to servisio
--
-Par canbiar łe inpostassion de i to osservati speciałi, visita
-{{canonicalurl:Special:Watchlist/edit}}
+Par modifegar łe inpostasion de łe notifeghe via posta eletronega, varda
+{{canonicalurl:{{#special:Preferences}}}}
+
+Par modifegar ła lista de łe tegnùe d\'ocio, varda
+{{canonicalurl:{{#special:EditWatchlist}}}}
-Par cavar la pagina da i to osservati speciałi, visita
+Par cavar ła pàjina da ła lista de łe tegnùe d\'ocio, varda
$UNWATCHURL
-Par riscontri e ulteriore assistensa:
+Par comentare e risevere ajuto:
{{canonicalurl:{{MediaWiki:Helppage}}}}',
'created' => 'creà',
'changed' => 'canbià',
Le impostazion atuali par la pagina le xe '''$1''':",
'protect-cascadeon' => 'Al momento sta pagina la xe blocà parché la xe inclusa {{PLURAL:$1|ne la pagina indicà de seguito, par la quale|ne le pagine indichè de seguito, par le quali}} xe ativa la protezion ricorsiva. Se pol modificar el livel de protezion individual de la pagina, ma le inpostazion derivanti da la protezion ricorsiva no le sarà mìa modificà.',
'protect-default' => 'Autoriza tuti i utenti',
-'protect-fallback' => 'Ghe vole el parmesso de "$1"',
-'protect-level-autoconfirmed' => 'Bloca i utenti novi o mia registrà',
-'protect-level-sysop' => 'Solo aministradori',
+'protect-fallback' => 'Consentio soło che a i utenti có parmeso "$1"',
+'protect-level-autoconfirmed' => 'Consentio soło che a i utenti "autoconfermai"',
+'protect-level-sysop' => 'Consentio soło che a i aministradori',
'protect-summary-cascade' => 'ricorsiva',
'protect-expiring' => 'scadensa: $1 (UTC)',
'protect-expiring-local' => 'scade el $1',
'undeletepagetext' => "{{PLURAL:$1|La pàxena qua de sèvito la xe stà scancelà, ma la ghe xe 'ncora in archivio e pertanto se pole 'ncora recuperarla|Le $1 pàxene qua de sèvito le xe stà scancelè, ma le ghe xe 'ncora in archivio e pertanto se pole 'ncora recuperarle}}.
L'archivio el vien svodà periodicamente.",
'undelete-fieldset-title' => 'Recupera version',
-'undeleteextrahelp' => "Par recuperar la storia de la pàxena par intiero, lassa tute łe casełe desełezionàe e struca '''''Ripristina'''''.
-Par efetuar un ripristino sełetivo, seleziona łe casełe corispondenti a łe revixion da ripristinar e struca '''''Ripristina'''''. Strucando '''''Reset''''' vegnarà deselezionàe tute łe casełe e svodà el posto par el comento.",
+'undeleteextrahelp' => "Par recuperar l'intiera storia de ła pàjina, łasar tute łe caxełe desełesionae e strucar so '''''{{int:undeletebtn}}'''''.
+Par efetuar un ripristino sełetivo, sełesionar łe caxełe corispondenti a łe revixion da ripristinar e strucar so '''''{{int:undeletebtn}}'''''.",
'undeleterevisions' => '{{PLURAL:$1|Una revision|$1 revision}} in archivio',
'undeletehistory' => 'Recuperando sta pàxena, tute łe so revixion le vegnarà inserìe da novo ne ła rełativa cronołogia.
Se dopo ła scancełazion xè stà creà na nova pàxena col stesso titoło, łe revixion recuperà le sarà inserìe ne ła cronołogia preçedente.',
'undeletedrevisions' => '{{PLURAL:$1|Una revision recuperà|$1 revision recuperà}}',
'undeletedrevisions-files' => '{{PLURAL:$1|Una revision|$1 revision}} e $2 file recuperà',
'undeletedfiles' => '{{PLURAL:$1|Un file recuperà|$1 file recuperà}}',
-'cannotundelete' => "El recupero no'l xè riussìo: qualchedun altro el podarià aver xà recuperà ła pàxena.",
+'cannotundelete' => 'Ripristino nó riusìo:
+$1',
'undeletedpage' => "'''$1 la xè stà recuperà'''
Consulta el [[Special:Log/delete|registro de le scancełassion]] par vardare łe scancełassion e i recuperi pì reçenti.",
# Move page
'move-page' => 'Spostamento de $1',
'move-page-legend' => 'Spostamento de pagina',
-'movepagetext' => "Col modulo qua soto te podi rinominar na pagina, spostando anca tuta la so storia al titolo novo.
-El vecio titolo el deventarà automaticamente un rimando (redirect) che punta al titolo novo.
-Te podi agiornar automaticamente i rimandi che punta al vecio titolo.
-Se te siegli de no farlo, tiente in mente de controlar ben che no se crea [[Special:DoubleRedirects|dopi redirect]] o [[Special:BrokenRedirects|redirect interoti]].
-Resta ne la to responsabilità de controlar che i colegamenti i continua a puntar dove che i deve.
+'movepagetext' => "Có 'l moduło cuà soto te podi rinominar na pàjina, spostando anca tuta ła so storia al titoło novo.
+El vecio titoło el devegnarà automategamente un rimando (redirect) che ponta al titoło novo.
+Te podi axornar automategamente i rimandi che ponta al vecio titoło.
+Se te siełi de nó farlo, tiente inamente de controłar ben che nó se cree [[Special:DoubleRedirects|dopi rimandi]] o [[Special:BrokenRedirects|rimandi interoti]].
+Resta inte ła to responsabiłità de controłar che i ligamenti i continue a pontar 'ndove che i deve.
-Ocio: la pagina '''no''' la sarà spostà se ghe fusse zà na pagina col titolo novo, a meno che no la sia na pagina voda o un rimando, e senpre che no la gabia na storia.
-Questo significa che, se te fè un eror, te podi da novo rinominar na pagina col vecio titolo, ma no te podi sovrascrìvar na pagina zà esistente.
+Ocio: ła pàjina '''nó''' ła sarà spostà se ghe fuse xà na pàjina có 'l titoło novo, a meno che nó ła sia un rimando, e senpre che nó ła gabia na storia.
+Cuesto signifega che, se te fè un eror, te podi da novo rinominar na pàjina có 'l vecio titoło, ma nó te podi sovrascrìvar na pàjina xà existente.
'''OCIO!'''
-Sto canbiamento drastico el podarìa dar problemi che no se se speta, specialmente se se trata de na pagina molto visità.
-Stà ben tento a le conseguense del spostamento, prima de farlo.",
+Sto canbiamento drastico el podarìa dar problemi che nó se se speta, spesalmente se se trata de na pàjina molto vixità.
+Stà ben tento a łe conseguense del spostamento, prima de farlo.",
'movepagetext-noredirectfixer' => "Col modulo qua soto te podi rinominar na pagina, spostando anca tuta la so storia al titolo novo.
El vecio titolo el deventarà automaticamente un rimando (redirect) che punta al titolo novo.
Tiente in mente de controlar ben che no se crea [[Special:DoubleRedirects|dopi redirect]] o [[Special:BrokenRedirects|redirect interoti]].
'api-error-ok-but-empty' => 'Eror interno: nisuna risposta dal server.',
'api-error-overwrite' => 'Nó xe parmeso de sorascrìvar un file existente.',
'api-error-stashfailed' => "Eror interno: el server nó 'l xe riusio a memorixar el documento tenporaneo.",
+'api-error-publishfailed' => "Eror interno: el server nó 'l xe riusio a publicar el documento tenporaneo.",
'api-error-timeout' => "El server nó 'l ga risposto entro el tenpo previsto.",
'api-error-unclassified' => 'Se gà verifegà un eror sconosùo.',
'api-error-unknown-code' => 'Eror sconosùo: "$1"',
Nếu bạn chọn không cập nhật, hãy nhớ kiểm tra [[Special:DoubleRedirects|đổi hướng kép]] hoặc [[Special:BrokenRedirects|đổi hướng đến trang không tồn tại]].
Bạn phải chịu trách nhiệm đảm bảo các liên kết đó tiếp tục trỏ đến nơi chúng cần đến.
-Chú ý rằng trang sẽ '''không''' bị di chuyển nếu đã có một trang tại tên mới, trừ khi nó rỗng hoặc là trang đổi hướng và không có lịch sử sửa đổi trước đây.
+Chú ý rằng trang sẽ '''không''' bị di chuyển nếu đã có một trang tại tên mới, trừ khi nó là trang đổi hướng và không có lịch sử sửa đổi trước đây.
Điều này có nghĩa là bạn có thể đổi tên trang lại như cũ nếu bạn có nhầm lẫn, và bạn không thể ghi đè lên một trang đã có sẵn.
'''CẢNH BÁO!'''
'api-error-ok-but-empty' => '内部错误:服务器没有响应。',
'api-error-overwrite' => '不允许覆盖现有文件。',
'api-error-stashfailed' => '内部错误:服务器保存临时文件失败。',
+'api-error-publishfailed' => '内部错误:服务器发布临时文件失败。',
'api-error-timeout' => '服务器没有在预期内响应。',
'api-error-unclassified' => '出现未知错误。',
'api-error-unknown-code' => '未知错误:$1',
'api-error-nomodule' => '內部錯誤:缺少上傳模塊集。',
'api-error-ok-but-empty' => '內部錯誤:伺服器沒有響應。',
'api-error-overwrite' => '不允許覆蓋現有檔案。',
-'api-error-stashfailed' => '內部錯誤:伺服器保存臨時文件失敗。',
+'api-error-stashfailed' => '內部錯誤:伺服器保存臨時檔案失敗。',
+'api-error-publishfailed' => '內部錯誤:伺服器發佈臨時檔案失敗。',
'api-error-timeout' => '伺服器沒有在預期的時間內回應。',
'api-error-unclassified' => '發生未知錯誤。',
'api-error-unknown-code' => '未知錯誤:$1',
$ops = array();
$fsFiles = array();
$copiedRel = array(); // for output message
+
+ // Download the batch of source files into backend cache...
+ if ( $this->hasOption( 'missingonly' ) ) {
+ $srcPaths = array();
+ foreach ( $srcPathsRel as $srcPathRel ) {
+ $srcPaths[] = $src->getRootStoragePath() . "/$backendRel/$srcPathRel";
+ }
+ $fsFiles = $src->getLocalReferenceMulti( array( 'srcs' => $srcPaths, 'latest' => 1 ) );
+ }
+
+ // Determine what files need to be copied over...
foreach ( $srcPathsRel as $srcPathRel ) {
$srcPath = $src->getRootStoragePath() . "/$backendRel/$srcPathRel";
$dstPath = $dst->getRootStoragePath() . "/$backendRel/$srcPathRel";
$this->output( "Already have $srcPathRel.\n" );
continue; // assume already copied...
}
- // Note: getLocalReference() is fast for FS backends
- $fsFile = $src->getLocalReference( array( 'src' => $srcPath, 'latest' => 1 ) );
+ $fsFile = array_key_exists( $srcPath, $fsFiles )
+ ? $fsFiles[$srcPath]
+ : $src->getLocalReference( array( 'src' => $srcPath, 'latest' => 1 ) );
if ( !$fsFile ) {
$this->error( "Could not get local copy of $srcPath.", 1 ); // die
} elseif ( !$fsFile->exists() ) {
$copiedRel[] = $srcPathRel;
}
+ // Copy in the batch of source files...
$t_start = microtime( true );
$status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) );
if ( !$status->isOK() ) {
'api-error-ok-but-empty',
'api-error-overwrite',
'api-error-stashfailed',
+ 'api-error-publishfailed',
'api-error-timeout',
'api-error-unclassified',
'api-error-unknown-code',
var conditions, dir, i, op, val;
profile = $.isPlainObject( profile ) ? profile : $.client.profile();
-
dir = $( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr';
// Check over each browser condition to determine if we are running in a compatible client
if ( typeof map[dir] !== 'object' || map[dir][profile.name] === undefined ) {
return true;
}
conditions = map[dir][profile.name];
+ if ( conditions === false ) {
+ return false;
+ }
for ( i = 0; i < conditions.length; i++ ) {
op = conditions[i][0];
val = conditions[i][1];
- if ( val === false ) {
- return false;
- }
if ( typeof val === 'string' ) {
if ( !( eval( 'profile.version' + op + '"' + val + '"' ) ) ) {
return false;
}
}
}
+
return true;
}
};
'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php",
# tests/phpunit/includes/site
- 'SiteObjectTest' => "$testDir/phpunit/includes/site/SiteObjectTest.php",
+ 'SiteTest' => "$testDir/phpunit/includes/site/SiteTest.php",
'TestSites' => "$testDir/phpunit/includes/site/TestSites.php",
# tests/phpunit/languages
* @dataProvider dataGetDeletionUpdates
*/
public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) {
- $title = Title::newFromText( $title );
- $title->resetArticleID( 2342 ); //dummy id. fine as long as we don't try to execute the updates!
+ $ns = $this->getDefaultWikitextNS();
+ $title = Title::newFromText( $title, $ns );
$content = ContentHandler::makeContent( $text, $title, $model );
- $updates = $content->getDeletionUpdates( WikiPage::factory( $title ) );
+ $page = WikiPage::factory( $title );
+ $page->doEditContent( $content, '' );
+
+ $updates = $content->getDeletionUpdates( $page );
// make updates accessible by class name
foreach ( $updates as $update ) {
$this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" );
}
}
+
+ $page->doDeleteArticle( '' );
}
public static function provideConvert() {
* @group Database
*/
public function testGetSecondaryDataUpdates( $title, $model, $text, $expectedStuff ) {
- $title = Title::newFromText( $title );
- $title->resetArticleID( 2342 ); //dummy id. fine as long as we don't try to execute the updates!
+ $ns = $this->getDefaultWikitextNS();
+ $title = Title::newFromText( $title, $ns );
$content = ContentHandler::makeContent( $text, $title, $model );
+ $page = WikiPage::factory( $title );
+ $page->doEditContent( $content, '' );
+
$updates = $content->getSecondaryDataUpdates( $title );
// make updates accessible by class name
$this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" );
}
}
+
+ $page->doDeleteArticle( '' );
}
public static function dataGetSection() {
$this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." );
+ $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir1" ) );
+ $items = is_array( $iter ) ? $iter : iterator_to_array( $iter );
+ $this->assertEquals( array(), $items, "Directory listing is empty." );
+
foreach ( $files as $file ) { // clean up
$this->backend->doOperation( array( 'op' => 'delete', 'src' => $file ) );
}
$iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/not/exists" ) );
- foreach ( $iter as $iter ) {} // no errors
+ foreach ( $iter as $file ) {} // no errors
+ $items = is_array( $iter ) ? $iter : iterator_to_array( $iter );
+ $this->assertEquals( array(), $items, "Directory listing is empty." );
+
+ $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/not/exists" ) );
+ $items = is_array( $iter ) ? $iter : iterator_to_array( $iter );
+ $this->assertEquals( array(), $items, "Directory listing is empty." );
}
public function testLockCalls() {
".foo\t{\tleft\t:\t0;}",
".foo\t{\tright\t:\t0;}"
),
+
+ // Guard against partial keys
+ array(
+ '.foo { leftxx: 0; }',
+ '.foo { leftxx: 0; }'
+ ),
+ array(
+ '.foo { rightxx: 0; }',
+ '.foo { rightxx: 0; }'
+ ),
);
}
*/
function provideTransformBrokenCases() {
return array(
- // Guard against partial keys
- array(
- '.foo { leftxx: 0; }',
- '.foo { leftxx: 0; }'
- ),
- array(
- '.foo { rightxx: 0; }',
- '.foo { rightxx: 0; }'
- ),
-
// Guard against selectors that look flippable
array(
# <foo-left-x attr="x">
* @ingroup Test
*
* @group Site
- * @group Database
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-class MediaWikiSiteTest extends SiteObjectTest {
-
- public function setUp() {
- parent::setUp();
-
- static $hasSites = false;
-
- if ( !$hasSites ) {
- TestSites::insertIntoDb();
- $hasSites = true;
- }
- }
-
- public function testFactoryConstruction() {
- $this->assertInstanceOf( 'MediaWikiSite', MediaWikiSite::newFromGlobalId( 'enwiki' ) );
- $this->assertInstanceOf( 'Site', MediaWikiSite::newFromGlobalId( 'enwiki' ) );
- $this->assertInstanceOf( 'MediaWikiSite', SitesTable::singleton()->newRow( array( 'type' => Site::TYPE_MEDIAWIKI ) ) );
- }
+class MediaWikiSiteTest extends SiteTest {
public function testNormalizePageTitle() {
- $site = MediaWikiSite::newFromGlobalId( 'enwiki' );
+ $site = new MediaWikiSite();
+ $site->setGlobalId( 'enwiki' );
//NOTE: this does not actually call out to the enwiki site to perform the normalization,
// but uses a local Title object to do so. This is hardcoded on SiteLink::normalizePageTitle
* @dataProvider fileUrlProvider
*/
public function testGetFileUrl( $url, $filePath, $pathArgument, $expected ) {
- $site = MediaWikiSite::newFromGlobalId( 'enwiki' );
-
+ $site = new MediaWikiSite();
$site->setFilePath( $url . $filePath );
$this->assertEquals( $expected, $site->getFileUrl( $pathArgument ) );
* @dataProvider provideGetPageUrl
*/
public function testGetPageUrl( $path, $page, $expected ) {
- /* @var MediaWikiSite $site */
- $site = MediaWikiSite::newFromGlobalId( 'enwiki' );
-
+ $site = new MediaWikiSite();
$site->setLinkPath( $path );
+
$this->assertContains( $path, $site->getPageUrl() );
$this->assertContains( $expected, $site->getPageUrl( $page ) );
}
+++ /dev/null
-<?php
-
-/**
- * Tests for the SiteArray class.
- * The tests for methods defined in the SiteList interface are in SiteListTest.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *Both
- * Bith
- * @file
- * @since 1.21
- *
- * @ingroup Site
- * @ingroup Test
- *
- * @group Site
- *
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class SiteArrayTest extends GenericArrayObjectTest {
-
- /**
- * @see GenericArrayObjectTest::elementInstancesProvider
- *
- * @since 1.21
- *
- * @return array
- */
- public function elementInstancesProvider() {
- $sites = TestSites::getSites();
-
- $siteArrays = array();
-
- $siteArrays[] = $sites;
-
- $siteArrays[] = array( array_shift( $sites ) );
-
- $siteArrays[] = array( array_shift( $sites ), array_shift( $sites ) );
-
- return $this->arrayWrap( $siteArrays );
- }
-
- /**
- * @see GenericArrayObjectTest::getInstanceClass
- *
- * @since 1.21
- *
- * @return array
- */
- public function getInstanceClass() {
- return 'SiteArray';
- }
-
- /**
- * @dataProvider instanceProvider
- *
- * @since 1.21
- *
- * @param SiteArray $list
- */
- public function testSerializationMore( SiteArray $list ) {
- $serialization = serialize( $list );
- /**
- * @var SiteArray $copy
- */
- $copy = unserialize( $serialization );
-
- $this->assertArrayEquals( $list->getGlobalIdentifiers(), $copy->getGlobalIdentifiers() );
-
- /**
- * @var Site $site
- */
- foreach ( $list as $site ) {
- $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) );
- }
- }
-
-}
\ No newline at end of file
<?php
/**
- * Tests for the SiteList implementing classes.
+ * Tests for the SiteList class.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
$listInstances = array();
foreach ( $sitesArrays as $sitesArray ) {
- $listInstances[] = new SiteArray( $sitesArray[0] );
+ $listInstances[] = new SiteList( $sitesArray[0] );
}
return $this->arrayWrap( $listInstances );
$this->assertArrayEquals( $expected, $identifiers );
}
+ /**
+ * @dataProvider siteListProvider
+ *
+ * @since 1.21
+ *
+ * @param SiteList $list
+ */
+ public function testSerialization( SiteList $list ) {
+ $serialization = serialize( $list );
+ /**
+ * @var SiteArray $copy
+ */
+ $copy = unserialize( $serialization );
+
+ $this->assertArrayEquals( $list->getGlobalIdentifiers(), $copy->getGlobalIdentifiers() );
+
+ /**
+ * @var Site $site
+ */
+ foreach ( $list as $site ) {
+ $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) );
+ }
+ }
}
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Tests for the SiteObject class.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @since 1.21
- *
- * @ingroup Site
- * @ingroup Test
- *
- * @group Site
- * @group Database
- *
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class SiteObjectTest extends ORMRowTest {
-
- /**
- * @see ORMRowTest::getRowClass
- * @since 1.21
- * @return string
- */
- protected function getRowClass() {
- return 'SiteObject';
- }
-
- /**
- * @see ORMRowTest::getTableInstance
- * @since 1.21
- * @return IORMTable
- */
- protected function getTableInstance() {
- return SitesTable::singleton();
- }
-
- /**
- * @see ORMRowTest::constructorTestProvider
- * @since 1.21
- * @return array
- */
- public function constructorTestProvider() {
- $argLists = array();
-
- $argLists[] = array( 'global_key' => 'foo' );
-
- $argLists[] = array( 'global_key' => 'bar', 'type' => Site::TYPE_MEDIAWIKI );
-
- $constructorArgs = array();
-
- foreach ( $argLists as $argList ) {
- $constructorArgs[] = array( $argList, true );
- }
-
- return $constructorArgs;
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetInterwikiIds( Site $site ) {
- $this->assertInternalType( 'array', $site->getInterwikiIds() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetNavigationIds( Site $site ) {
- $this->assertInternalType( 'array', $site->getNavigationIds() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testAddNavigationId( Site $site ) {
- $site->addNavigationId( 'foobar' );
- $this->assertTrue( in_array( 'foobar', $site->getNavigationIds(), true ) );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testAddInterwikiId( Site $site ) {
- $site->addInterwikiId( 'foobar' );
- $this->assertTrue( in_array( 'foobar', $site->getInterwikiIds(), true ) );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetLanguageCode( Site $site ) {
- $this->assertTypeOrFalse( 'string', $site->getLanguageCode() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testSetLanguageCode( Site $site ) {
- $site->setLanguageCode( 'en' );
- $this->assertEquals( 'en', $site->getLanguageCode() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testNormalizePageName( Site $site ) {
- $this->assertInternalType( 'string', $site->normalizePageName( 'Foobar' ) );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetGlobalId( Site $site ) {
- $this->assertInternalType( 'string', $site->getGlobalId() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testSetGlobalId( Site $site ) {
- $site->setGlobalId( 'foobar' );
- $this->assertEquals( 'foobar', $site->getGlobalId() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetType( Site $site ) {
- $this->assertInternalType( 'string', $site->getType() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetPath( Site $site ) {
- $this->assertTypeOrFalse( 'string', $site->getPath( 'page_path' ) );
- $this->assertTypeOrFalse( 'string', $site->getPath( 'file_path' ) );
- $this->assertTypeOrFalse( 'string', $site->getPath( 'foobar' ) );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testGetAllPaths( Site $site ) {
- $this->assertInternalType( 'array', $site->getAllPaths() );
- }
-
- /**
- * @dataProvider instanceProvider
- * @param Site $site
- */
- public function testSetAndRemovePath( Site $site ) {
- $count = count( $site->getAllPaths() );
-
- $site->setPath( 'spam', 'http://www.wikidata.org/$1' );
- $site->setPath( 'spam', 'http://www.wikidata.org/foo/$1' );
- $site->setPath( 'foobar', 'http://www.wikidata.org/bar/$1' );
-
- $this->assertEquals( $count + 2, count( $site->getAllPaths() ) );
-
- $this->assertInternalType( 'string', $site->getPath( 'foobar' ) );
- $this->assertEquals( 'http://www.wikidata.org/foo/$1', $site->getPath( 'spam' ) );
-
- $site->removePath( 'spam' );
- $site->removePath( 'foobar' );
-
- $this->assertEquals( $count, count( $site->getAllPaths() ) );
-
- $this->assertFalse( $site->getPath( 'foobar' ) );
- $this->assertFalse( $site->getPath( 'spam' ) );
- }
-
- public function testSetLinkPath() {
- /* @var SiteObject $site */
- $site = $this->getRowInstance( $this->getMockFields(), false );
- $path = "TestPath/$1";
-
- $site->setLinkPath( $path );
- $this->assertEquals( $path, $site->getLinkPath() );
- }
-
- public function testGetLinkPathType() {
- /* @var SiteObject $site */
- $site = $this->getRowInstance( $this->getMockFields(), false );
-
- $path = 'TestPath/$1';
- $site->setLinkPath( $path );
- $this->assertEquals( $path, $site->getPath( $site->getLinkPathType() ) );
-
- $path = 'AnotherPath/$1';
- $site->setPath( $site->getLinkPathType(), $path );
- $this->assertEquals( $path, $site->getLinkPath() );
- }
-
- public function testSetPath() {
- /* @var SiteObject $site */
- $site = $this->getRowInstance( $this->getMockFields(), false );
-
- $path = 'TestPath/$1';
- $site->setPath( 'foo', $path );
-
- $this->assertEquals( $path, $site->getPath( 'foo' ) );
- }
-
- public function testProtocolRelativePath() {
- /* @var SiteObject $site */
- $site = $this->getRowInstance( $this->getMockFields(), false );
-
- $type = $site->getLinkPathType();
- $path = '//acme.com/'; // protocol-relative URL
- $site->setPath( $type, $path );
-
- $this->assertEquals( '', $site->getProtocol() );
- }
-
- public function provideGetPageUrl() {
- //NOTE: the assumption that the URL is built by replacing $1
- // with the urlencoded version of $page
- // is true for SiteObject but not guaranteed for subclasses.
- // Subclasses need to override this provider appropriately.
-
- return array(
- array( #0
- 'http://acme.test/TestPath/$1',
- 'Foo',
- '/TestPath/Foo',
- ),
- array( #1
- 'http://acme.test/TestScript?x=$1&y=bla',
- 'Foo',
- 'TestScript?x=Foo&y=bla',
- ),
- array( #2
- 'http://acme.test/TestPath/$1',
- 'foo & bar/xyzzy (quux-shmoox?)',
- '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29',
- ),
- );
- }
-
- /**
- * @dataProvider provideGetPageUrl
- */
- public function testGetPageUrl( $path, $page, $expected ) {
- /* @var SiteObject $site */
- $site = $this->getRowInstance( $this->getMockFields(), false );
-
- //NOTE: the assumption that getPageUrl is based on getLinkPath
- // is true for SiteObject but not guaranteed for subclasses.
- // Subclasses need to override this test case appropriately.
- $site->setLinkPath( $path );
- $this->assertContains( $path, $site->getPageUrl() );
-
- $this->assertContains( $expected, $site->getPageUrl( $page ) );
- }
-
- protected function assertTypeOrFalse( $type, $value ) {
- if ( $value === false ) {
- $this->assertTrue( true );
- }
- else {
- $this->assertInternalType( $type, $value );
- }
- }
-
-}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * Tests for the SiteSQLStore class.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 1.21
+ *
+ * @ingroup Site
+ * @ingroup Test
+ *
+ * @group Site
+ * @group Database
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class SiteSQLStoreTest extends MediaWikiTestCase {
+
+ public function testGetSites() {
+ $expectedSites = TestSites::getSites();
+ TestSites::insertIntoDb();
+
+ $sitesTable = SiteSQLStore::newInstance();
+
+ $sites = $sitesTable->getSites();
+
+ $this->assertInstanceOf( 'SiteList', $sites );
+
+ /**
+ * @var Site $site
+ */
+ foreach ( $sites as $site ) {
+ $this->assertInstanceOf( 'Site', $site );
+ }
+
+ foreach ( $expectedSites as $site ) {
+ if ( $site->getGlobalId() !== null ) {
+ $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
+ }
+ }
+ }
+
+ public function testSaveSites() {
+ $sitesTable = SiteSQLStore::newInstance();
+
+ $sites = array();
+
+ $site = new Site();
+ $site->setGlobalId( 'ertrywuutr' );
+ $site->setLanguageCode( 'en' );
+ $sites[] = $site;
+
+ $site = new MediaWikiSite();
+ $site->setGlobalId( 'sdfhxujgkfpth' );
+ $site->setLanguageCode( 'nl' );
+ $sites[] = $site;
+
+ $this->assertTrue( $sitesTable->saveSites( $sites ) );
+
+ $site = $sitesTable->getSite( 'ertrywuutr', 'nocache' );
+ $this->assertInstanceOf( 'Site', $site );
+ $this->assertEquals( 'en', $site->getLanguageCode() );
+
+ $site = $sitesTable->getSite( 'sdfhxujgkfpth', 'nocache' );
+ $this->assertInstanceOf( 'Site', $site );
+ $this->assertEquals( 'nl', $site->getLanguageCode() );
+ }
+
+}
--- /dev/null
+<?php
+
+/**
+ * Tests for the Site class.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 1.21
+ *
+ * @ingroup Site
+ * @ingroup Test
+ *
+ * @group Site
+ *
+ * @licence GNU GPL v2+
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class SiteTest extends MediaWikiTestCase {
+
+ public function instanceProvider() {
+ $instances = array();
+
+ $instances[] = new Site();
+
+ $site = new Site();
+ $site->setGlobalId( 'enwiki' );
+ $site->setInternalId( 42 );
+ $instances[] = $site;
+
+ $site = new MediaWikiSite();
+ $site->setGlobalId( 'nlwiki' );
+ $site->setLanguageCode( 'nl' );
+ $instances[] = $site;
+
+ return $this->arrayWrap( $instances );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetInterwikiIds( Site $site ) {
+ $this->assertInternalType( 'array', $site->getInterwikiIds() );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetNavigationIds( Site $site ) {
+ $this->assertInternalType( 'array', $site->getNavigationIds() );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testAddNavigationId( Site $site ) {
+ $site->addNavigationId( 'foobar' );
+ $this->assertTrue( in_array( 'foobar', $site->getNavigationIds(), true ) );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testAddInterwikiId( Site $site ) {
+ $site->addInterwikiId( 'foobar' );
+ $this->assertTrue( in_array( 'foobar', $site->getInterwikiIds(), true ) );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetLanguageCode( Site $site ) {
+ $this->assertTypeOrValue( 'string', $site->getLanguageCode(), null );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testSetLanguageCode( Site $site ) {
+ $site->setLanguageCode( 'en' );
+ $this->assertEquals( 'en', $site->getLanguageCode() );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testNormalizePageName( Site $site ) {
+ $this->assertInternalType( 'string', $site->normalizePageName( 'Foobar' ) );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetGlobalId( Site $site ) {
+ $this->assertTypeOrValue( 'string', $site->getGlobalId(), null );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testSetGlobalId( Site $site ) {
+ $site->setGlobalId( 'foobar' );
+ $this->assertEquals( 'foobar', $site->getGlobalId() );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetType( Site $site ) {
+ $this->assertInternalType( 'string', $site->getType() );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetPath( Site $site ) {
+ $this->assertTypeOrValue( 'string', $site->getPath( 'page_path' ), null );
+ $this->assertTypeOrValue( 'string', $site->getPath( 'file_path' ), null );
+ $this->assertTypeOrValue( 'string', $site->getPath( 'foobar' ), null );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testGetAllPaths( Site $site ) {
+ $this->assertInternalType( 'array', $site->getAllPaths() );
+ }
+
+ /**
+ * @dataProvider instanceProvider
+ * @param Site $site
+ */
+ public function testSetAndRemovePath( Site $site ) {
+ $count = count( $site->getAllPaths() );
+
+ $site->setPath( 'spam', 'http://www.wikidata.org/$1' );
+ $site->setPath( 'spam', 'http://www.wikidata.org/foo/$1' );
+ $site->setPath( 'foobar', 'http://www.wikidata.org/bar/$1' );
+
+ $this->assertEquals( $count + 2, count( $site->getAllPaths() ) );
+
+ $this->assertInternalType( 'string', $site->getPath( 'foobar' ) );
+ $this->assertEquals( 'http://www.wikidata.org/foo/$1', $site->getPath( 'spam' ) );
+
+ $site->removePath( 'spam' );
+ $site->removePath( 'foobar' );
+
+ $this->assertEquals( $count, count( $site->getAllPaths() ) );
+
+ $this->assertNull( $site->getPath( 'foobar' ) );
+ $this->assertNull( $site->getPath( 'spam' ) );
+ }
+
+ public function testSetLinkPath() {
+ $site = new Site();
+ $path = "TestPath/$1";
+
+ $site->setLinkPath( $path );
+ $this->assertEquals( $path, $site->getLinkPath() );
+ }
+
+ public function testGetLinkPathType() {
+ $site = new Site();
+
+ $path = 'TestPath/$1';
+ $site->setLinkPath( $path );
+ $this->assertEquals( $path, $site->getPath( $site->getLinkPathType() ) );
+
+ $path = 'AnotherPath/$1';
+ $site->setPath( $site->getLinkPathType(), $path );
+ $this->assertEquals( $path, $site->getLinkPath() );
+ }
+
+ public function testSetPath() {
+ $site = new Site();
+
+ $path = 'TestPath/$1';
+ $site->setPath( 'foo', $path );
+
+ $this->assertEquals( $path, $site->getPath( 'foo' ) );
+ }
+
+ public function testProtocolRelativePath() {
+ $site = new Site();
+
+ $type = $site->getLinkPathType();
+ $path = '//acme.com/'; // protocol-relative URL
+ $site->setPath( $type, $path );
+
+ $this->assertEquals( '', $site->getProtocol() );
+ }
+
+ public function provideGetPageUrl() {
+ //NOTE: the assumption that the URL is built by replacing $1
+ // with the urlencoded version of $page
+ // is true for Site but not guaranteed for subclasses.
+ // Subclasses need to override this provider appropriately.
+
+ return array(
+ array( #0
+ 'http://acme.test/TestPath/$1',
+ 'Foo',
+ '/TestPath/Foo',
+ ),
+ array( #1
+ 'http://acme.test/TestScript?x=$1&y=bla',
+ 'Foo',
+ 'TestScript?x=Foo&y=bla',
+ ),
+ array( #2
+ 'http://acme.test/TestPath/$1',
+ 'foo & bar/xyzzy (quux-shmoox?)',
+ '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provideGetPageUrl
+ */
+ public function testGetPageUrl( $path, $page, $expected ) {
+ $site = new Site();
+
+ //NOTE: the assumption that getPageUrl is based on getLinkPath
+ // is true for Site but not guaranteed for subclasses.
+ // Subclasses need to override this test case appropriately.
+ $site->setLinkPath( $path );
+ $this->assertContains( $path, $site->getPageUrl() );
+
+ $this->assertContains( $expected, $site->getPageUrl( $page ) );
+ }
+
+ protected function assertTypeOrFalse( $type, $value ) {
+ if ( $value === false ) {
+ $this->assertTrue( true );
+ }
+ else {
+ $this->assertInternalType( $type, $value );
+ }
+ }
+
+}
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Tests for the Sites class.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @since 1.21
- *
- * @ingroup Site
- * @ingroup Test
- *
- * @group Site
- * @group Database
- *
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class SitesTest extends MediaWikiTestCase {
-
- public function setUp() {
- parent::setUp();
- TestSites::insertIntoDb();
- }
-
- public function testSingleton() {
- $this->assertInstanceOf( 'Sites', Sites::singleton() );
- $this->assertTrue( Sites::singleton() === Sites::singleton() );
- }
-
- public function testGetSites() {
- $this->assertInstanceOf( 'SiteList', Sites::singleton()->getSites() );
- }
-
-
- public function testGetSite() {
- $count = 0;
- $sites = Sites::singleton()->getSites();
-
- /**
- * @var Site $site
- */
- foreach ( $sites as $site ) {
- $this->assertInstanceOf( 'Site', $site );
-
- $this->assertEquals(
- $site,
- Sites::singleton()->getSite( $site->getGlobalId() )
- );
-
- if ( ++$count > 100 ) {
- break;
- }
- }
- }
-
- public function testNewSite() {
- $this->assertInstanceOf( 'Site', Sites::newSite() );
- $this->assertInstanceOf( 'Site', Sites::newSite( 'enwiki' ) );
- }
-
- public function testGetGroup() {
- $wikipedias = Sites::singleton()->getSiteGroup( "wikipedia" );
-
- $this->assertFalse( $wikipedias->isEmpty() );
-
- /* @var Site $site */
- foreach ( $wikipedias as $site ) {
- $this->assertEquals( 'wikipedia', $site->getGroup() );
- }
- }
-
-}
public static function getSites() {
$sites = array();
- $site = Sites::newSite( 'foobar' );
+ $site = new Site();
+ $site->setGlobalId( 'foobar' );
$sites[] = $site;
- $site = Sites::newSite( 'enwiktionary' );
+ $site = new MediaWikiSite();
+ $site->setGlobalId( 'enwiktionary' );
$site->setGroup( 'wiktionary' );
- $site->setType( Site::TYPE_MEDIAWIKI );
$site->setLanguageCode( 'en' );
$site->addNavigationId( 'enwiktionary' );
$site->setPath( MediaWikiSite::PATH_PAGE, "https://en.wiktionary.org/wiki/$1" );
$site->setPath( MediaWikiSite::PATH_FILE, "https://en.wiktionary.org/w/$1" );
$sites[] = $site;
- $site = Sites::newSite( 'dewiktionary' );
+ $site = new MediaWikiSite();
+ $site->setGlobalId( 'dewiktionary' );
$site->setGroup( 'wiktionary' );
- $site->setType( Site::TYPE_MEDIAWIKI );
$site->setLanguageCode( 'de' );
$site->addInterwikiId( 'dewiktionary' );
$site->addInterwikiId( 'wiktionaryde' );
$site->setPath( MediaWikiSite::PATH_FILE, "https://de.wiktionary.org/w/$1" );
$sites[] = $site;
- $site = Sites::newSite( 'spam' );
+ $site = new Site();
+ $site->setGlobalId( 'spam' );
$site->setGroup( 'spam' );
- $site->setType( Site::TYPE_UNKNOWN );
$site->setLanguageCode( 'en' );
$site->addNavigationId( 'spam' );
$site->addNavigationId( 'spamz' );
$sites[] = $site;
foreach ( array( 'en', 'de', 'nl', 'sv', 'sr', 'no', 'nn' ) as $langCode ) {
- $site = Sites::newSite( $langCode . 'wiki' );
+ $site = new MediaWikiSite();
+ $site->setGlobalId( $langCode . 'wiki' );
$site->setGroup( 'wikipedia' );
- $site->setType( Site::TYPE_MEDIAWIKI );
$site->setLanguageCode( $langCode );
$site->addInterwikiId( $langCode );
$site->addNavigationId( $langCode );
public static function insertIntoDb() {
$dbw = wfGetDB( DB_MASTER );
- $dbw->begin( __METHOD__ );
+ $trx = $dbw->trxLevel();
+
+ if ( $trx == 0 ) {
+ $dbw->begin( __METHOD__ );
+ }
$dbw->delete( 'sites', '*', __METHOD__ );
$dbw->delete( 'site_identifiers', '*', __METHOD__ );
- /**
- * @var Site $site
- */
- foreach ( TestSites::getSites() as $site ) {
- $site->save();
- }
+ $sitesTable = SiteSQLStore::newInstance();
+ $sitesTable->saveSites( TestSites::getSites() );
- $dbw->commit( __METHOD__ );
-
- Sites::singleton()->getSites( false ); // re-cache
+ if ( $trx == 0 ) {
+ $dbw->commit( __METHOD__ );
+ }
}
}
\ No newline at end of file
// Check the source file storage path
if ( !$img->exists() ) {
- wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
+ wfThumbError( 404, "The source file '$fileName' does not exist." );
wfProfileOut( __METHOD__ );
return;
} elseif ( $img->getPath() === false ) {
- wfThumbError( 500, 'The source file is not locally accessible.' );
+ wfThumbError( 500, "The source file '$fileName' is not locally accessible." );
wfProfileOut( __METHOD__ );
return;
}