Merge "Revert "Make UserNotLoggedIn redirect to login page""
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 15 Jul 2014 23:18:53 +0000 (23:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 15 Jul 2014 23:18:53 +0000 (23:18 +0000)
51 files changed:
includes/AutoLoader.php
includes/MWNamespace.php [new file with mode: 0644]
includes/MediaWiki.php [new file with mode: 0644]
includes/Namespace.php [deleted file]
includes/Wiki.php [deleted file]
includes/debug/Debug.php [deleted file]
includes/debug/MWDebug.php [new file with mode: 0644]
includes/installer/i18n/pl.json
includes/parser/MWTidy.php [new file with mode: 0644]
includes/parser/Tidy.php [deleted file]
includes/revisiondelete/RevisionDelete.php
includes/specials/SpecialVersion.php
languages/i18n/arq.json
languages/i18n/arz.json
languages/i18n/bar.json
languages/i18n/bcc.json
languages/i18n/be-tarask.json
languages/i18n/be.json
languages/i18n/bn.json
languages/i18n/cs.json
languages/i18n/de.json
languages/i18n/el.json
languages/i18n/fa.json
languages/i18n/hu.json
languages/i18n/mg.json
languages/i18n/mk.json
languages/i18n/nn.json
languages/i18n/sr-ec.json
languages/i18n/sr-el.json
languages/i18n/zh-hant.json
resources/Resources.php
resources/src/mediawiki.less/mediawiki.ui/mixins.less [new file with mode: 0644]
resources/src/mediawiki.less/mediawiki.ui/variables.less [new file with mode: 0644]
resources/src/mediawiki.ui/components/buttons.less [new file with mode: 0644]
resources/src/mediawiki.ui/components/default/buttons.less [deleted file]
resources/src/mediawiki.ui/components/default/forms.less [deleted file]
resources/src/mediawiki.ui/components/forms.less [new file with mode: 0644]
resources/src/mediawiki.ui/components/utilities.less
resources/src/mediawiki.ui/components/vector/buttons.less [deleted file]
resources/src/mediawiki.ui/components/vector/containers.less [deleted file]
resources/src/mediawiki.ui/components/vector/forms.less [deleted file]
resources/src/mediawiki.ui/default.less
resources/src/mediawiki.ui/mixins/effects.less [deleted file]
resources/src/mediawiki.ui/mixins/forms.less [deleted file]
resources/src/mediawiki.ui/mixins/type.less [deleted file]
resources/src/mediawiki.ui/mixins/utilities.less [deleted file]
resources/src/mediawiki.ui/settings/colors.less [deleted file]
resources/src/mediawiki.ui/settings/typography.less [deleted file]
resources/src/mediawiki.ui/vector.less [deleted file]
skins/MonoBook/i18n/be.json
skins/Vector/i18n/be.json

index c879258..8b4895a 100644 (file)
@@ -128,7 +128,7 @@ $wgAutoloadLocalClasses = array(
        'MagicWord' => 'includes/MagicWord.php',
        'MagicWordArray' => 'includes/MagicWord.php',
        'MailAddress' => 'includes/UserMailer.php',
-       'MediaWiki' => 'includes/Wiki.php',
+       'MediaWiki' => 'includes/MediaWiki.php',
        'MediaWikiI18N' => 'includes/SkinTemplate.php',
        'MediaWikiVersionFetcher' => 'includes/MediaWikiVersionFetcher.php',
        'Message' => 'includes/Message.php',
@@ -136,7 +136,7 @@ $wgAutoloadLocalClasses = array(
        'MimeMagic' => 'includes/MimeMagic.php',
        'MWHookException' => 'includes/Hooks.php',
        'MWHttpRequest' => 'includes/HttpFunctions.php',
-       'MWNamespace' => 'includes/Namespace.php',
+       'MWNamespace' => 'includes/MWNamespace.php',
        'OutputPage' => 'includes/OutputPage.php',
        'Pager' => 'includes/Pager.php',
        'PasswordError' => 'includes/User.php',
@@ -463,7 +463,7 @@ $wgAutoloadLocalClasses = array(
        'SQLiteField' => 'includes/db/DatabaseSqlite.php',
 
        # includes/debug
-       'MWDebug' => 'includes/debug/Debug.php',
+       'MWDebug' => 'includes/debug/MWDebug.php',
 
        # includes/deferred
        'DataUpdate' => 'includes/deferred/DataUpdate.php',
@@ -798,8 +798,8 @@ $wgAutoloadLocalClasses = array(
        'CoreTagHooks' => 'includes/parser/CoreTagHooks.php',
        'DateFormatter' => 'includes/parser/DateFormatter.php',
        'LinkHolderArray' => 'includes/parser/LinkHolderArray.php',
-       'MWTidy' => 'includes/parser/Tidy.php',
-       'MWTidyWrapper' => 'includes/parser/Tidy.php',
+       'MWTidy' => 'includes/parser/MWTidy.php',
+       'MWTidyWrapper' => 'includes/parser/MWTidy.php',
        'PPCustomFrame_DOM' => 'includes/parser/Preprocessor_DOM.php',
        'PPCustomFrame_Hash' => 'includes/parser/Preprocessor_Hash.php',
        'PPDAccum_Hash' => 'includes/parser/Preprocessor_Hash.php',
diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php
new file mode 100644 (file)
index 0000000..392f558
--- /dev/null
@@ -0,0 +1,496 @@
+<?php
+/**
+ * Provide things related to namespaces.
+ *
+ * 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
+ */
+
+/**
+ * This is a utility class with only static functions
+ * for dealing with namespaces that encodes all the
+ * "magic" behaviors of them based on index.  The textual
+ * names of the namespaces are handled by Language.php.
+ *
+ * These are synonyms for the names given in the language file
+ * Users and translators should not change them
+ *
+ */
+class MWNamespace {
+
+       /**
+        * These namespaces should always be first-letter capitalized, now and
+        * forevermore. Historically, they could've probably been lowercased too,
+        * but some things are just too ingrained now. :)
+        */
+       private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_USER, NS_MEDIAWIKI );
+
+       /**
+        * Throw an exception when trying to get the subject or talk page
+        * for a given namespace where it does not make sense.
+        * Special namespaces are defined in includes/Defines.php and have
+        * a value below 0 (ex: NS_SPECIAL = -1 , NS_MEDIA = -2)
+        *
+        * @param int $index
+        * @param string $method
+        *
+        * @throws MWException
+        * @return bool
+        */
+       private static function isMethodValidFor( $index, $method ) {
+               if ( $index < NS_MAIN ) {
+                       throw new MWException( "$method does not make any sense for given namespace $index" );
+               }
+               return true;
+       }
+
+       /**
+        * Can pages in the given namespace be moved?
+        *
+        * @param int $index Namespace index
+        * @return bool
+        */
+       public static function isMovable( $index ) {
+               global $wgAllowImageMoving;
+
+               $result = !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving ) );
+
+               /**
+                * @since 1.20
+                */
+               wfRunHooks( 'NamespaceIsMovable', array( $index, &$result ) );
+
+               return $result;
+       }
+
+       /**
+        * Is the given namespace is a subject (non-talk) namespace?
+        *
+        * @param int $index Namespace index
+        * @return bool
+        * @since 1.19
+        */
+       public static function isSubject( $index ) {
+               return !self::isTalk( $index );
+       }
+
+       /**
+        * Is the given namespace a talk namespace?
+        *
+        * @param int $index Namespace index
+        * @return bool
+        */
+       public static function isTalk( $index ) {
+               return $index > NS_MAIN
+                       && $index % 2;
+       }
+
+       /**
+        * Get the talk namespace index for a given namespace
+        *
+        * @param int $index Namespace index
+        * @return int
+        */
+       public static function getTalk( $index ) {
+               self::isMethodValidFor( $index, __METHOD__ );
+               return self::isTalk( $index )
+                       ? $index
+                       : $index + 1;
+       }
+
+       /**
+        * Get the subject namespace index for a given namespace
+        * Special namespaces (NS_MEDIA, NS_SPECIAL) are always the subject.
+        *
+        * @param int $index Namespace index
+        * @return int
+        */
+       public static function getSubject( $index ) {
+               # Handle special namespaces
+               if ( $index < NS_MAIN ) {
+                       return $index;
+               }
+
+               return self::isTalk( $index )
+                       ? $index - 1
+                       : $index;
+       }
+
+       /**
+        * Get the associated namespace.
+        * For talk namespaces, returns the subject (non-talk) namespace
+        * For subject (non-talk) namespaces, returns the talk namespace
+        *
+        * @param int $index Namespace index
+        * @return int|null If no associated namespace could be found
+        */
+       public static function getAssociated( $index ) {
+               self::isMethodValidFor( $index, __METHOD__ );
+
+               if ( self::isSubject( $index ) ) {
+                       return self::getTalk( $index );
+               } elseif ( self::isTalk( $index ) ) {
+                       return self::getSubject( $index );
+               } else {
+                       return null;
+               }
+       }
+
+       /**
+        * Returns whether the specified namespace exists
+        *
+        * @param int $index
+        *
+        * @return bool
+        * @since 1.19
+        */
+       public static function exists( $index ) {
+               $nslist = self::getCanonicalNamespaces();
+               return isset( $nslist[$index] );
+       }
+
+       /**
+        * Returns whether the specified namespaces are the same namespace
+        *
+        * @note It's possible that in the future we may start using something
+        * other than just namespace indexes. Under that circumstance making use
+        * of this function rather than directly doing comparison will make
+        * sure that code will not potentially break.
+        *
+        * @param int $ns1 The first namespace index
+        * @param int $ns2 The second namespace index
+        *
+        * @return bool
+        * @since 1.19
+        */
+       public static function equals( $ns1, $ns2 ) {
+               return $ns1 == $ns2;
+       }
+
+       /**
+        * Returns whether the specified namespaces share the same subject.
+        * eg: NS_USER and NS_USER wil return true, as well
+        *     NS_USER and NS_USER_TALK will return true.
+        *
+        * @param int $ns1 The first namespace index
+        * @param int $ns2 The second namespace index
+        *
+        * @return bool
+        * @since 1.19
+        */
+       public static function subjectEquals( $ns1, $ns2 ) {
+               return self::getSubject( $ns1 ) == self::getSubject( $ns2 );
+       }
+
+       /**
+        * Returns array of all defined namespaces with their canonical
+        * (English) names.
+        *
+        * @param bool $rebuild Rebuild namespace list (default = false). Used for testing.
+        *
+        * @return array
+        * @since 1.17
+        */
+       public static function getCanonicalNamespaces( $rebuild = false ) {
+               static $namespaces = null;
+               if ( $namespaces === null || $rebuild ) {
+                       global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
+                       $namespaces = array( NS_MAIN => '' ) + $wgCanonicalNamespaceNames;
+                       if ( is_array( $wgExtraNamespaces ) ) {
+                               $namespaces += $wgExtraNamespaces;
+                       }
+                       wfRunHooks( 'CanonicalNamespaces', array( &$namespaces ) );
+               }
+               return $namespaces;
+       }
+
+       /**
+        * Returns the canonical (English) name for a given index
+        *
+        * @param int $index Namespace index
+        * @return string|bool If no canonical definition.
+        */
+       public static function getCanonicalName( $index ) {
+               $nslist = self::getCanonicalNamespaces();
+               if ( isset( $nslist[$index] ) ) {
+                       return $nslist[$index];
+               } else {
+                       return false;
+               }
+       }
+
+       /**
+        * Returns the index for a given canonical name, or NULL
+        * The input *must* be converted to lower case first
+        *
+        * @param string $name Namespace name
+        * @return int
+        */
+       public static function getCanonicalIndex( $name ) {
+               static $xNamespaces = false;
+               if ( $xNamespaces === false ) {
+                       $xNamespaces = array();
+                       foreach ( self::getCanonicalNamespaces() as $i => $text ) {
+                               $xNamespaces[strtolower( $text )] = $i;
+                       }
+               }
+               if ( array_key_exists( $name, $xNamespaces ) ) {
+                       return $xNamespaces[$name];
+               } else {
+                       return null;
+               }
+       }
+
+       /**
+        * Returns an array of the namespaces (by integer id) that exist on the
+        * wiki. Used primarily by the api in help documentation.
+        * @return array
+        */
+       public static function getValidNamespaces() {
+               static $mValidNamespaces = null;
+
+               if ( is_null( $mValidNamespaces ) ) {
+                       foreach ( array_keys( self::getCanonicalNamespaces() ) as $ns ) {
+                               if ( $ns >= 0 ) {
+                                       $mValidNamespaces[] = $ns;
+                               }
+                       }
+               }
+
+               return $mValidNamespaces;
+       }
+
+       /**
+        * Can this namespace ever have a talk namespace?
+        *
+        * @param int $index Namespace index
+        * @return bool
+        */
+       public static function canTalk( $index ) {
+               return $index >= NS_MAIN;
+       }
+
+       /**
+        * Does this namespace contain content, for the purposes of calculating
+        * statistics, etc?
+        *
+        * @param int $index Index to check
+        * @return bool
+        */
+       public static function isContent( $index ) {
+               global $wgContentNamespaces;
+               return $index == NS_MAIN || in_array( $index, $wgContentNamespaces );
+       }
+
+       /**
+        * Can pages in a namespace be watched?
+        *
+        * @param int $index
+        * @return bool
+        */
+       public static function isWatchable( $index ) {
+               return $index >= NS_MAIN;
+       }
+
+       /**
+        * Does the namespace allow subpages?
+        *
+        * @param int $index Index to check
+        * @return bool
+        */
+       public static function hasSubpages( $index ) {
+               global $wgNamespacesWithSubpages;
+               return !empty( $wgNamespacesWithSubpages[$index] );
+       }
+
+       /**
+        * Get a list of all namespace indices which are considered to contain content
+        * @return array Array of namespace indices
+        */
+       public static function getContentNamespaces() {
+               global $wgContentNamespaces;
+               if ( !is_array( $wgContentNamespaces ) || $wgContentNamespaces === array() ) {
+                       return array( NS_MAIN );
+               } elseif ( !in_array( NS_MAIN, $wgContentNamespaces ) ) {
+                       // always force NS_MAIN to be part of array (to match the algorithm used by isContent)
+                       return array_merge( array( NS_MAIN ), $wgContentNamespaces );
+               } else {
+                       return $wgContentNamespaces;
+               }
+       }
+
+       /**
+        * List all namespace indices which are considered subject, aka not a talk
+        * or special namespace. See also MWNamespace::isSubject
+        *
+        * @return array Array of namespace indices
+        */
+       public static function getSubjectNamespaces() {
+               return array_filter(
+                       MWNamespace::getValidNamespaces(),
+                       'MWNamespace::isSubject'
+               );
+       }
+
+       /**
+        * List all namespace indices which are considered talks, aka not a subject
+        * or special namespace. See also MWNamespace::isTalk
+        *
+        * @return array Array of namespace indices
+        */
+       public static function getTalkNamespaces() {
+               return array_filter(
+                       MWNamespace::getValidNamespaces(),
+                       'MWNamespace::isTalk'
+               );
+       }
+
+       /**
+        * Is the namespace first-letter capitalized?
+        *
+        * @param int $index Index to check
+        * @return bool
+        */
+       public static function isCapitalized( $index ) {
+               global $wgCapitalLinks, $wgCapitalLinkOverrides;
+               // Turn NS_MEDIA into NS_FILE
+               $index = $index === NS_MEDIA ? NS_FILE : $index;
+
+               // Make sure to get the subject of our namespace
+               $index = self::getSubject( $index );
+
+               // Some namespaces are special and should always be upper case
+               if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
+                       return true;
+               }
+               if ( isset( $wgCapitalLinkOverrides[$index] ) ) {
+                       // $wgCapitalLinkOverrides is explicitly set
+                       return $wgCapitalLinkOverrides[$index];
+               }
+               // Default to the global setting
+               return $wgCapitalLinks;
+       }
+
+       /**
+        * Does the namespace (potentially) have different aliases for different
+        * genders. Not all languages make a distinction here.
+        *
+        * @since 1.18
+        * @param int $index Index to check
+        * @return bool
+        */
+       public static function hasGenderDistinction( $index ) {
+               return $index == NS_USER || $index == NS_USER_TALK;
+       }
+
+       /**
+        * It is not possible to use pages from this namespace as template?
+        *
+        * @since 1.20
+        * @param int $index Index to check
+        * @return bool
+        */
+       public static function isNonincludable( $index ) {
+               global $wgNonincludableNamespaces;
+               return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
+       }
+
+       /**
+        * Get the default content model for a namespace
+        * This does not mean that all pages in that namespace have the model
+        *
+        * @since 1.21
+        * @param int $index Index to check
+        * @return null|string Default model name for the given namespace, if set
+        */
+       public static function getNamespaceContentModel( $index ) {
+               global $wgNamespaceContentModels;
+               return isset( $wgNamespaceContentModels[$index] )
+                       ? $wgNamespaceContentModels[$index]
+                       : null;
+       }
+
+       /**
+        * Determine which restriction levels it makes sense to use in a namespace,
+        * optionally filtered by a user's rights.
+        *
+        * @since 1.23
+        * @param int $index Index to check
+        * @param User $user User to check
+        * @return array
+        */
+       public static function getRestrictionLevels( $index, User $user = null ) {
+               global $wgNamespaceProtection, $wgRestrictionLevels;
+
+               if ( !isset( $wgNamespaceProtection[$index] ) ) {
+                       // All levels are valid if there's no namespace restriction.
+                       // But still filter by user, if necessary
+                       $levels = $wgRestrictionLevels;
+                       if ( $user ) {
+                               $levels = array_values( array_filter( $levels, function ( $level ) use ( $user ) {
+                                       $right = $level;
+                                       if ( $right == 'sysop' ) {
+                                               $right = 'editprotected'; // BC
+                                       }
+                                       if ( $right == 'autoconfirmed' ) {
+                                               $right = 'editsemiprotected'; // BC
+                                       }
+                                       return ( $right == '' || $user->isAllowed( $right ) );
+                               } ) );
+                       }
+                       return $levels;
+               }
+
+               // First, get the list of groups that can edit this namespace.
+               $namespaceGroups = array();
+               $combine = 'array_merge';
+               foreach ( (array)$wgNamespaceProtection[$index] as $right ) {
+                       if ( $right == 'sysop' ) {
+                               $right = 'editprotected'; // BC
+                       }
+                       if ( $right == 'autoconfirmed' ) {
+                               $right = 'editsemiprotected'; // BC
+                       }
+                       if ( $right != '' ) {
+                               $namespaceGroups = call_user_func( $combine, $namespaceGroups,
+                                       User::getGroupsWithPermission( $right ) );
+                               $combine = 'array_intersect';
+                       }
+               }
+
+               // Now, keep only those restriction levels where there is at least one
+               // group that can edit the namespace but would be blocked by the
+               // restriction.
+               $usableLevels = array( '' );
+               foreach ( $wgRestrictionLevels as $level ) {
+                       $right = $level;
+                       if ( $right == 'sysop' ) {
+                               $right = 'editprotected'; // BC
+                       }
+                       if ( $right == 'autoconfirmed' ) {
+                               $right = 'editsemiprotected'; // BC
+                       }
+                       if ( $right != '' && ( !$user || $user->isAllowed( $right ) ) &&
+                               array_diff( $namespaceGroups, User::getGroupsWithPermission( $right ) )
+                       ) {
+                               $usableLevels[] = $level;
+                       }
+               }
+
+               return $usableLevels;
+       }
+}
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
new file mode 100644 (file)
index 0000000..a8bafa3
--- /dev/null
@@ -0,0 +1,722 @@
+<?php
+/**
+ * Helper class for the index.php entry point.
+ *
+ * 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
+ */
+
+/**
+ * The MediaWiki class is the helper class for the index.php entry point.
+ *
+ * @internal documentation reviewed 15 Mar 2010
+ */
+class MediaWiki {
+       /**
+        * @todo Fold $output, etc, into this
+        * @var IContextSource
+        */
+       private $context;
+
+       /**
+        * @param null|WebRequest $x
+        * @return WebRequest
+        */
+       public function request( WebRequest $x = null ) {
+               $old = $this->context->getRequest();
+               $this->context->setRequest( $x );
+               return $old;
+       }
+
+       /**
+        * @param null|OutputPage $x
+        * @return OutputPage
+        */
+       public function output( OutputPage $x = null ) {
+               $old = $this->context->getOutput();
+               $this->context->setOutput( $x );
+               return $old;
+       }
+
+       /**
+        * @param IContextSource|null $context
+        */
+       public function __construct( IContextSource $context = null ) {
+               if ( !$context ) {
+                       $context = RequestContext::getMain();
+               }
+
+               $this->context = $context;
+       }
+
+       /**
+        * Parse the request to get the Title object
+        *
+        * @return Title Title object to be $wgTitle
+        */
+       private function parseTitle() {
+               global $wgContLang;
+
+               $request = $this->context->getRequest();
+               $curid = $request->getInt( 'curid' );
+               $title = $request->getVal( 'title' );
+               $action = $request->getVal( 'action', 'view' );
+
+               if ( $request->getCheck( 'search' ) ) {
+                       // Compatibility with old search URLs which didn't use Special:Search
+                       // Just check for presence here, so blank requests still
+                       // show the search page when using ugly URLs (bug 8054).
+                       $ret = SpecialPage::getTitleFor( 'Search' );
+               } elseif ( $curid ) {
+                       // URLs like this are generated by RC, because rc_title isn't always accurate
+                       $ret = Title::newFromID( $curid );
+               } else {
+                       $ret = Title::newFromURL( $title );
+                       // Alias NS_MEDIA page URLs to NS_FILE...we only use NS_MEDIA
+                       // in wikitext links to tell Parser to make a direct file link
+                       if ( !is_null( $ret ) && $ret->getNamespace() == NS_MEDIA ) {
+                               $ret = Title::makeTitle( NS_FILE, $ret->getDBkey() );
+                       }
+                       // Check variant links so that interwiki links don't have to worry
+                       // about the possible different language variants
+                       if ( count( $wgContLang->getVariants() ) > 1
+                               && !is_null( $ret ) && $ret->getArticleID() == 0
+                       ) {
+                               $wgContLang->findVariantLink( $title, $ret );
+                       }
+               }
+
+               // If title is not provided, always allow oldid and diff to set the title.
+               // If title is provided, allow oldid and diff to override the title, unless
+               // we are talking about a special page which might use these parameters for
+               // other purposes.
+               if ( $ret === null || !$ret->isSpecialPage() ) {
+                       // We can have urls with just ?diff=,?oldid= or even just ?diff=
+                       $oldid = $request->getInt( 'oldid' );
+                       $oldid = $oldid ? $oldid : $request->getInt( 'diff' );
+                       // Allow oldid to override a changed or missing title
+                       if ( $oldid ) {
+                               $rev = Revision::newFromId( $oldid );
+                               $ret = $rev ? $rev->getTitle() : $ret;
+                       }
+               }
+
+               // Use the main page as default title if nothing else has been provided
+               if ( $ret === null
+                       && strval( $title ) === ''
+                       && !$request->getCheck( 'curid' )
+                       && $action !== 'delete'
+               ) {
+                       $ret = Title::newMainPage();
+               }
+
+               if ( $ret === null || ( $ret->getDBkey() == '' && !$ret->isExternal() ) ) {
+                       $ret = SpecialPage::getTitleFor( 'Badtitle' );
+               }
+
+               return $ret;
+       }
+
+       /**
+        * Get the Title object that we'll be acting on, as specified in the WebRequest
+        * @return Title
+        */
+       public function getTitle() {
+               if ( $this->context->getTitle() === null ) {
+                       $this->context->setTitle( $this->parseTitle() );
+               }
+               return $this->context->getTitle();
+       }
+
+       /**
+        * Returns the name of the action that will be executed.
+        *
+        * @return string Action
+        */
+       public function getAction() {
+               static $action = null;
+
+               if ( $action === null ) {
+                       $action = Action::getActionName( $this->context );
+               }
+
+               return $action;
+       }
+
+       /**
+        * Performs the request.
+        * - bad titles
+        * - read restriction
+        * - local interwiki redirects
+        * - redirect loop
+        * - special pages
+        * - normal pages
+        *
+        * @throws MWException|PermissionsError|BadTitleError|HttpError
+        * @return void
+        */
+       private function performRequest() {
+               global $wgServer, $wgUsePathInfo, $wgTitle;
+
+               wfProfileIn( __METHOD__ );
+
+               $request = $this->context->getRequest();
+               $requestTitle = $title = $this->context->getTitle();
+               $output = $this->context->getOutput();
+               $user = $this->context->getUser();
+
+               if ( $request->getVal( 'printable' ) === 'yes' ) {
+                       $output->setPrintable();
+               }
+
+               $unused = null; // To pass it by reference
+               wfRunHooks( 'BeforeInitialize', array( &$title, &$unused, &$output, &$user, $request, $this ) );
+
+               // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
+               if ( is_null( $title ) || ( $title->getDBkey() == '' && !$title->isExternal() )
+                       || $title->isSpecial( 'Badtitle' )
+               ) {
+                       $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
+                       wfProfileOut( __METHOD__ );
+                       throw new BadTitleError();
+               }
+
+               // Check user's permissions to read this page.
+               // We have to check here to catch special pages etc.
+               // We will check again in Article::view().
+               $permErrors = $title->getUserPermissionsErrors( 'read', $user );
+               if ( count( $permErrors ) ) {
+                       // Bug 32276: allowing the skin to generate output with $wgTitle or
+                       // $this->context->title set to the input title would allow anonymous users to
+                       // determine whether a page exists, potentially leaking private data. In fact, the
+                       // curid and oldid request  parameters would allow page titles to be enumerated even
+                       // when they are not guessable. So we reset the title to Special:Badtitle before the
+                       // permissions error is displayed.
+                       //
+                       // The skin mostly uses $this->context->getTitle() these days, but some extensions
+                       // still use $wgTitle.
+
+                       $badTitle = SpecialPage::getTitleFor( 'Badtitle' );
+                       $this->context->setTitle( $badTitle );
+                       $wgTitle = $badTitle;
+
+                       wfProfileOut( __METHOD__ );
+                       throw new PermissionsError( 'read', $permErrors );
+               }
+
+               $pageView = false; // was an article or special page viewed?
+
+               // Interwiki redirects
+               if ( $title->isExternal() ) {
+                       $rdfrom = $request->getVal( 'rdfrom' );
+                       if ( $rdfrom ) {
+                               $url = $title->getFullURL( array( 'rdfrom' => $rdfrom ) );
+                       } else {
+                               $query = $request->getValues();
+                               unset( $query['title'] );
+                               $url = $title->getFullURL( $query );
+                       }
+                       // Check for a redirect loop
+                       if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url )
+                               && $title->isLocal()
+                       ) {
+                               // 301 so google et al report the target as the actual url.
+                               $output->redirect( $url, 301 );
+                       } else {
+                               $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
+                               wfProfileOut( __METHOD__ );
+                               throw new BadTitleError();
+                       }
+               // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
+               } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()
+                       && ( $request->getVal( 'title' ) === null
+                               || $title->getPrefixedDBkey() != $request->getVal( 'title' ) )
+                       && !count( $request->getValueNames( array( 'action', 'title' ) ) )
+                       && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) )
+               ) {
+                       if ( $title->isSpecialPage() ) {
+                               list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
+                               if ( $name ) {
+                                       $title = SpecialPage::getTitleFor( $name, $subpage );
+                               }
+                       }
+                       $targetUrl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
+                       // Redirect to canonical url, make it a 301 to allow caching
+                       if ( $targetUrl == $request->getFullRequestURL() ) {
+                               $message = "Redirect loop detected!\n\n" .
+                                       "This means the wiki got confused about what page was " .
+                                       "requested; this sometimes happens when moving a wiki " .
+                                       "to a new server or changing the server configuration.\n\n";
+
+                               if ( $wgUsePathInfo ) {
+                                       $message .= "The wiki is trying to interpret the page " .
+                                               "title from the URL path portion (PATH_INFO), which " .
+                                               "sometimes fails depending on the web server. Try " .
+                                               "setting \"\$wgUsePathInfo = false;\" in your " .
+                                               "LocalSettings.php, or check that \$wgArticlePath " .
+                                               "is correct.";
+                               } else {
+                                       $message .= "Your web server was detected as possibly not " .
+                                               "supporting URL path components (PATH_INFO) correctly; " .
+                                               "check your LocalSettings.php for a customized " .
+                                               "\$wgArticlePath setting and/or toggle \$wgUsePathInfo " .
+                                               "to true.";
+                               }
+                               throw new HttpError( 500, $message );
+                       } else {
+                               $output->setSquidMaxage( 1200 );
+                               $output->redirect( $targetUrl, '301' );
+                       }
+               // Special pages
+               } elseif ( NS_SPECIAL == $title->getNamespace() ) {
+                       $pageView = true;
+                       // Actions that need to be made when we have a special pages
+                       SpecialPageFactory::executePath( $title, $this->context );
+               } else {
+                       // ...otherwise treat it as an article view. The article
+                       // may be a redirect to another article or URL.
+                       $article = $this->initializeArticle();
+                       if ( is_object( $article ) ) {
+                               $pageView = true;
+                               $this->performAction( $article, $requestTitle );
+                       } elseif ( is_string( $article ) ) {
+                               $output->redirect( $article );
+                       } else {
+                               wfProfileOut( __METHOD__ );
+                               throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle()"
+                                       . " returned neither an object nor a URL" );
+                       }
+               }
+
+               if ( $pageView ) {
+                       // Promote user to any groups they meet the criteria for
+                       $user->addAutopromoteOnceGroups( 'onView' );
+               }
+
+               wfProfileOut( __METHOD__ );
+       }
+
+       /**
+        * Initialize the main Article object for "standard" actions (view, etc)
+        * Create an Article object for the page, following redirects if needed.
+        *
+        * @return mixed An Article, or a string to redirect to another URL
+        */
+       private function initializeArticle() {
+               global $wgDisableHardRedirects;
+
+               wfProfileIn( __METHOD__ );
+
+               $title = $this->context->getTitle();
+               if ( $this->context->canUseWikiPage() ) {
+                       // Try to use request context wiki page, as there
+                       // is already data from db saved in per process
+                       // cache there from this->getAction() call.
+                       $page = $this->context->getWikiPage();
+                       $article = Article::newFromWikiPage( $page, $this->context );
+               } else {
+                       // This case should not happen, but just in case.
+                       $article = Article::newFromTitle( $title, $this->context );
+                       $this->context->setWikiPage( $article->getPage() );
+               }
+
+               // NS_MEDIAWIKI has no redirects.
+               // It is also used for CSS/JS, so performance matters here...
+               if ( $title->getNamespace() == NS_MEDIAWIKI ) {
+                       wfProfileOut( __METHOD__ );
+                       return $article;
+               }
+
+               $request = $this->context->getRequest();
+
+               // Namespace might change when using redirects
+               // Check for redirects ...
+               $action = $request->getVal( 'action', 'view' );
+               $file = ( $title->getNamespace() == NS_FILE ) ? $article->getFile() : null;
+               if ( ( $action == 'view' || $action == 'render' ) // ... for actions that show content
+                       && !$request->getVal( 'oldid' ) // ... and are not old revisions
+                       && !$request->getVal( 'diff' ) // ... and not when showing diff
+                       && $request->getVal( 'redirect' ) != 'no' // ... unless explicitly told not to
+                       // ... and the article is not a non-redirect image page with associated file
+                       && !( is_object( $file ) && $file->exists() && !$file->getRedirected() )
+               ) {
+                       // Give extensions a change to ignore/handle redirects as needed
+                       $ignoreRedirect = $target = false;
+
+                       wfRunHooks( 'InitializeArticleMaybeRedirect',
+                               array( &$title, &$request, &$ignoreRedirect, &$target, &$article ) );
+
+                       // Follow redirects only for... redirects.
+                       // If $target is set, then a hook wanted to redirect.
+                       if ( !$ignoreRedirect && ( $target || $article->isRedirect() ) ) {
+                               // Is the target already set by an extension?
+                               $target = $target ? $target : $article->followRedirect();
+                               if ( is_string( $target ) ) {
+                                       if ( !$wgDisableHardRedirects ) {
+                                               // we'll need to redirect
+                                               wfProfileOut( __METHOD__ );
+                                               return $target;
+                                       }
+                               }
+                               if ( is_object( $target ) ) {
+                                       // Rewrite environment to redirected article
+                                       $rarticle = Article::newFromTitle( $target, $this->context );
+                                       $rarticle->loadPageData();
+                                       if ( $rarticle->exists() || ( is_object( $file ) && !$file->isLocal() ) ) {
+                                               $rarticle->setRedirectedFrom( $title );
+                                               $article = $rarticle;
+                                               $this->context->setTitle( $target );
+                                               $this->context->setWikiPage( $article->getPage() );
+                                       }
+                               }
+                       } else {
+                               $this->context->setTitle( $article->getTitle() );
+                               $this->context->setWikiPage( $article->getPage() );
+                       }
+               }
+
+               wfProfileOut( __METHOD__ );
+               return $article;
+       }
+
+       /**
+        * Perform one of the "standard" actions
+        *
+        * @param Page $page
+        * @param Title $requestTitle The original title, before any redirects were applied
+        */
+       private function performAction( Page $page, Title $requestTitle ) {
+               global $wgUseSquid, $wgSquidMaxage;
+
+               wfProfileIn( __METHOD__ );
+
+               $request = $this->context->getRequest();
+               $output = $this->context->getOutput();
+               $title = $this->context->getTitle();
+               $user = $this->context->getUser();
+
+               if ( !wfRunHooks( 'MediaWikiPerformAction',
+                               array( $output, $page, $title, $user, $request, $this ) )
+               ) {
+                       wfProfileOut( __METHOD__ );
+                       return;
+               }
+
+               $act = $this->getAction();
+
+               $action = Action::factory( $act, $page, $this->context );
+
+               if ( $action instanceof Action ) {
+                       # Let Squid cache things if we can purge them.
+                       if ( $wgUseSquid &&
+                               in_array( $request->getFullRequestURL(), $requestTitle->getSquidURLs() )
+                       ) {
+                               $output->setSquidMaxage( $wgSquidMaxage );
+                       }
+
+                       $action->show();
+                       wfProfileOut( __METHOD__ );
+                       return;
+               }
+
+               if ( wfRunHooks( 'UnknownAction', array( $request->getVal( 'action', 'view' ), $page ) ) ) {
+                       $output->setStatusCode( 404 );
+                       $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
+               }
+
+               wfProfileOut( __METHOD__ );
+       }
+
+       /**
+        * Run the current MediaWiki instance
+        * index.php just calls this
+        */
+       public function run() {
+               try {
+                       $this->checkMaxLag();
+                       try {
+                               $this->main();
+                       } catch ( ErrorPageError $e ) {
+                               // Bug 62091: while exceptions are convenient to bubble up GUI errors,
+                               // they are not internal application faults. As with normal requests, this
+                               // should commit, print the output, do deferred updates, jobs, and profiling.
+                               wfGetLBFactory()->commitMasterChanges();
+                               $e->report(); // display the GUI error
+                       }
+                       if ( function_exists( 'fastcgi_finish_request' ) ) {
+                               fastcgi_finish_request();
+                       }
+                       $this->triggerJobs();
+                       $this->restInPeace();
+               } catch ( Exception $e ) {
+                       MWExceptionHandler::handle( $e );
+               }
+       }
+
+       /**
+        * Checks if the request should abort due to a lagged server,
+        * for given maxlag parameter.
+        * @return bool
+        */
+       private function checkMaxLag() {
+               global $wgShowHostnames;
+
+               wfProfileIn( __METHOD__ );
+               $maxLag = $this->context->getRequest()->getVal( 'maxlag' );
+               if ( !is_null( $maxLag ) ) {
+                       list( $host, $lag ) = wfGetLB()->getMaxLag();
+                       if ( $lag > $maxLag ) {
+                               $resp = $this->context->getRequest()->response();
+                               $resp->header( 'HTTP/1.1 503 Service Unavailable' );
+                               $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
+                               $resp->header( 'X-Database-Lag: ' . intval( $lag ) );
+                               $resp->header( 'Content-Type: text/plain' );
+                               if ( $wgShowHostnames ) {
+                                       echo "Waiting for $host: $lag seconds lagged\n";
+                               } else {
+                                       echo "Waiting for a database server: $lag seconds lagged\n";
+                               }
+
+                               wfProfileOut( __METHOD__ );
+
+                               exit;
+                       }
+               }
+               wfProfileOut( __METHOD__ );
+               return true;
+       }
+
+       private function main() {
+               global $wgUseFileCache, $wgTitle, $wgUseAjax;
+
+               wfProfileIn( __METHOD__ );
+
+               $request = $this->context->getRequest();
+
+               // Send Ajax requests to the Ajax dispatcher.
+               if ( $wgUseAjax && $request->getVal( 'action', 'view' ) == 'ajax' ) {
+
+                       // Set a dummy title, because $wgTitle == null might break things
+                       $title = Title::makeTitle( NS_MAIN, 'AJAX' );
+                       $this->context->setTitle( $title );
+                       $wgTitle = $title;
+
+                       $dispatcher = new AjaxDispatcher();
+                       $dispatcher->performAction();
+                       wfProfileOut( __METHOD__ );
+                       return;
+               }
+
+               // Get title from request parameters,
+               // is set on the fly by parseTitle the first time.
+               $title = $this->getTitle();
+               $action = $this->getAction();
+               $wgTitle = $title;
+
+               // If the user has forceHTTPS set to true, or if the user
+               // is in a group requiring HTTPS, or if they have the HTTPS
+               // preference set, redirect them to HTTPS.
+               // Note: Do this after $wgTitle is setup, otherwise the hooks run from
+               // isLoggedIn() will do all sorts of weird stuff.
+               if (
+                       $request->getProtocol() == 'http' &&
+                       (
+                               $request->getCookie( 'forceHTTPS', '' ) ||
+                               // check for prefixed version for currently logged in users
+                               $request->getCookie( 'forceHTTPS' ) ||
+                               // Avoid checking the user and groups unless it's enabled.
+                               (
+                                       $this->context->getUser()->isLoggedIn()
+                                       && $this->context->getUser()->requiresHTTPS()
+                               )
+                       )
+               ) {
+                       $oldUrl = $request->getFullRequestURL();
+                       $redirUrl = preg_replace( '#^http://#', 'https://', $oldUrl );
+
+                       // ATTENTION: This hook is likely to be removed soon due to overall design of the system.
+                       if ( wfRunHooks( 'BeforeHttpsRedirect', array( $this->context, &$redirUrl ) ) ) {
+
+                               if ( $request->wasPosted() ) {
+                                       // This is weird and we'd hope it almost never happens. This
+                                       // means that a POST came in via HTTP and policy requires us
+                                       // redirecting to HTTPS. It's likely such a request is going
+                                       // to fail due to post data being lost, but let's try anyway
+                                       // and just log the instance.
+                                       //
+                                       // @todo @fixme See if we could issue a 307 or 308 here, need
+                                       // to see how clients (automated & browser) behave when we do
+                                       wfDebugLog( 'RedirectedPosts', "Redirected from HTTP to HTTPS: $oldUrl" );
+                               }
+                               // Setup dummy Title, otherwise OutputPage::redirect will fail
+                               $title = Title::newFromText( NS_MAIN, 'REDIR' );
+                               $this->context->setTitle( $title );
+                               $output = $this->context->getOutput();
+                               // Since we only do this redir to change proto, always send a vary header
+                               $output->addVaryHeader( 'X-Forwarded-Proto' );
+                               $output->redirect( $redirUrl );
+                               $output->output();
+                               wfProfileOut( __METHOD__ );
+                               return;
+                       }
+               }
+
+               if ( $wgUseFileCache && $title->getNamespace() >= 0 ) {
+                       wfProfileIn( 'main-try-filecache' );
+                       if ( HTMLFileCache::useFileCache( $this->context ) ) {
+                               // Try low-level file cache hit
+                               $cache = HTMLFileCache::newFromTitle( $title, $action );
+                               if ( $cache->isCacheGood( /* Assume up to date */ ) ) {
+                                       // Check incoming headers to see if client has this cached
+                                       $timestamp = $cache->cacheTimestamp();
+                                       if ( !$this->context->getOutput()->checkLastModified( $timestamp ) ) {
+                                               $cache->loadFromFileCache( $this->context );
+                                       }
+                                       // Do any stats increment/watchlist stuff
+                                       // Assume we're viewing the latest revision (this should always be the case with file cache)
+                                       $this->context->getWikiPage()->doViewUpdates( $this->context->getUser() );
+                                       // Tell OutputPage that output is taken care of
+                                       $this->context->getOutput()->disable();
+                                       wfProfileOut( 'main-try-filecache' );
+                                       wfProfileOut( __METHOD__ );
+                                       return;
+                               }
+                       }
+                       wfProfileOut( 'main-try-filecache' );
+               }
+
+               // Actually do the work of the request and build up any output
+               $this->performRequest();
+
+               // Either all DB and deferred updates should happen or none.
+               // The later should not be cancelled due to client disconnect.
+               ignore_user_abort( true );
+               // Now commit any transactions, so that unreported errors after
+               // output() don't roll back the whole DB transaction
+               wfGetLBFactory()->commitMasterChanges();
+
+               // Output everything!
+               $this->context->getOutput()->output();
+
+               wfProfileOut( __METHOD__ );
+       }
+
+       /**
+        * Ends this task peacefully
+        */
+       public function restInPeace() {
+               // Do any deferred jobs
+               DeferredUpdates::doUpdates( 'commit' );
+
+               // Log profiling data, e.g. in the database or UDP
+               wfLogProfilingData();
+
+               // Commit and close up!
+               $factory = wfGetLBFactory();
+               $factory->commitMasterChanges();
+               $factory->shutdown();
+
+               wfDebug( "Request ended normally\n" );
+       }
+
+       /**
+        * Potentially open a socket and sent an HTTP request back to the server
+        * to run a specified number of jobs. This registers a callback to cleanup
+        * the socket once it's done.
+        */
+       protected function triggerJobs() {
+               global $wgJobRunRate, $wgServer, $wgRunJobsAsync;
+
+               if ( $wgJobRunRate <= 0 || wfReadOnly() ) {
+                       return;
+               } elseif ( $this->getTitle()->isSpecial( 'RunJobs' ) ) {
+                       return; // recursion guard
+               }
+
+               $section = new ProfileSection( __METHOD__ );
+
+               if ( $wgJobRunRate < 1 ) {
+                       $max = mt_getrandmax();
+                       if ( mt_rand( 0, $max ) > $max * $wgJobRunRate ) {
+                               return; // the higher $wgJobRunRate, the less likely we return here
+                       }
+                       $n = 1;
+               } else {
+                       $n = intval( $wgJobRunRate );
+               }
+
+               if ( !$wgRunJobsAsync ) {
+                       // If running jobs asynchronously has been disabled, run the job here
+                       // while the user waits
+                       SpecialRunJobs::executeJobs( $n );
+                       return;
+               }
+
+               try {
+                       if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) {
+                               return; // do not send request if there are probably no jobs
+                       }
+               } catch ( JobQueueError $e ) {
+                       MWExceptionHandler::logException( $e );
+                       return; // do not make the site unavailable
+               }
+
+               $query = array( 'title' => 'Special:RunJobs',
+                       'tasks' => 'jobs', 'maxjobs' => $n, 'sigexpiry' => time() + 5 );
+               $query['signature'] = SpecialRunJobs::getQuerySignature( $query );
+
+               $errno = $errstr = null;
+               $info = wfParseUrl( $wgServer );
+               wfSuppressWarnings();
+               $sock = fsockopen(
+                       $info['host'],
+                       isset( $info['port'] ) ? $info['port'] : 80,
+                       $errno,
+                       $errstr,
+                       // If it takes more than 100ms to connect to ourselves there
+                       // is a problem elsewhere.
+                       0.1
+               );
+               wfRestoreWarnings();
+               if ( !$sock ) {
+                       wfDebugLog( 'runJobs', "Failed to start cron API (socket error $errno): $errstr\n" );
+                       // Fall back to running the job here while the user waits
+                       SpecialRunJobs::executeJobs( $n );
+                       return;
+               }
+
+               $url = wfAppendQuery( wfScript( 'index' ), $query );
+               $req = "POST $url HTTP/1.1\r\nHost: {$info['host']}\r\nConnection: Close\r\n\r\n";
+
+               wfDebugLog( 'runJobs', "Running $n job(s) via '$url'\n" );
+               // Send a cron API request to be performed in the background.
+               // Give up if this takes too long to send (which should be rare).
+               stream_set_timeout( $sock, 1 );
+               $bytes = fwrite( $sock, $req );
+               if ( $bytes !== strlen( $req ) ) {
+                       wfDebugLog( 'runJobs', "Failed to start cron API (socket write error)\n" );
+               } else {
+                       // Do not wait for the response (the script should handle client aborts).
+                       // Make sure that we don't close before that script reaches ignore_user_abort().
+                       $status = fgets( $sock );
+                       if ( !preg_match( '#^HTTP/\d\.\d 202 #', $status ) ) {
+                               wfDebugLog( 'runJobs', "Failed to start cron API: received '$status'\n" );
+                       }
+               }
+               fclose( $sock );
+       }
+}
diff --git a/includes/Namespace.php b/includes/Namespace.php
deleted file mode 100644 (file)
index 392f558..0000000
+++ /dev/null
@@ -1,496 +0,0 @@
-<?php
-/**
- * Provide things related to namespaces.
- *
- * 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
- */
-
-/**
- * This is a utility class with only static functions
- * for dealing with namespaces that encodes all the
- * "magic" behaviors of them based on index.  The textual
- * names of the namespaces are handled by Language.php.
- *
- * These are synonyms for the names given in the language file
- * Users and translators should not change them
- *
- */
-class MWNamespace {
-
-       /**
-        * These namespaces should always be first-letter capitalized, now and
-        * forevermore. Historically, they could've probably been lowercased too,
-        * but some things are just too ingrained now. :)
-        */
-       private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_USER, NS_MEDIAWIKI );
-
-       /**
-        * Throw an exception when trying to get the subject or talk page
-        * for a given namespace where it does not make sense.
-        * Special namespaces are defined in includes/Defines.php and have
-        * a value below 0 (ex: NS_SPECIAL = -1 , NS_MEDIA = -2)
-        *
-        * @param int $index
-        * @param string $method
-        *
-        * @throws MWException
-        * @return bool
-        */
-       private static function isMethodValidFor( $index, $method ) {
-               if ( $index < NS_MAIN ) {
-                       throw new MWException( "$method does not make any sense for given namespace $index" );
-               }
-               return true;
-       }
-
-       /**
-        * Can pages in the given namespace be moved?
-        *
-        * @param int $index Namespace index
-        * @return bool
-        */
-       public static function isMovable( $index ) {
-               global $wgAllowImageMoving;
-
-               $result = !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving ) );
-
-               /**
-                * @since 1.20
-                */
-               wfRunHooks( 'NamespaceIsMovable', array( $index, &$result ) );
-
-               return $result;
-       }
-
-       /**
-        * Is the given namespace is a subject (non-talk) namespace?
-        *
-        * @param int $index Namespace index
-        * @return bool
-        * @since 1.19
-        */
-       public static function isSubject( $index ) {
-               return !self::isTalk( $index );
-       }
-
-       /**
-        * Is the given namespace a talk namespace?
-        *
-        * @param int $index Namespace index
-        * @return bool
-        */
-       public static function isTalk( $index ) {
-               return $index > NS_MAIN
-                       && $index % 2;
-       }
-
-       /**
-        * Get the talk namespace index for a given namespace
-        *
-        * @param int $index Namespace index
-        * @return int
-        */
-       public static function getTalk( $index ) {
-               self::isMethodValidFor( $index, __METHOD__ );
-               return self::isTalk( $index )
-                       ? $index
-                       : $index + 1;
-       }
-
-       /**
-        * Get the subject namespace index for a given namespace
-        * Special namespaces (NS_MEDIA, NS_SPECIAL) are always the subject.
-        *
-        * @param int $index Namespace index
-        * @return int
-        */
-       public static function getSubject( $index ) {
-               # Handle special namespaces
-               if ( $index < NS_MAIN ) {
-                       return $index;
-               }
-
-               return self::isTalk( $index )
-                       ? $index - 1
-                       : $index;
-       }
-
-       /**
-        * Get the associated namespace.
-        * For talk namespaces, returns the subject (non-talk) namespace
-        * For subject (non-talk) namespaces, returns the talk namespace
-        *
-        * @param int $index Namespace index
-        * @return int|null If no associated namespace could be found
-        */
-       public static function getAssociated( $index ) {
-               self::isMethodValidFor( $index, __METHOD__ );
-
-               if ( self::isSubject( $index ) ) {
-                       return self::getTalk( $index );
-               } elseif ( self::isTalk( $index ) ) {
-                       return self::getSubject( $index );
-               } else {
-                       return null;
-               }
-       }
-
-       /**
-        * Returns whether the specified namespace exists
-        *
-        * @param int $index
-        *
-        * @return bool
-        * @since 1.19
-        */
-       public static function exists( $index ) {
-               $nslist = self::getCanonicalNamespaces();
-               return isset( $nslist[$index] );
-       }
-
-       /**
-        * Returns whether the specified namespaces are the same namespace
-        *
-        * @note It's possible that in the future we may start using something
-        * other than just namespace indexes. Under that circumstance making use
-        * of this function rather than directly doing comparison will make
-        * sure that code will not potentially break.
-        *
-        * @param int $ns1 The first namespace index
-        * @param int $ns2 The second namespace index
-        *
-        * @return bool
-        * @since 1.19
-        */
-       public static function equals( $ns1, $ns2 ) {
-               return $ns1 == $ns2;
-       }
-
-       /**
-        * Returns whether the specified namespaces share the same subject.
-        * eg: NS_USER and NS_USER wil return true, as well
-        *     NS_USER and NS_USER_TALK will return true.
-        *
-        * @param int $ns1 The first namespace index
-        * @param int $ns2 The second namespace index
-        *
-        * @return bool
-        * @since 1.19
-        */
-       public static function subjectEquals( $ns1, $ns2 ) {
-               return self::getSubject( $ns1 ) == self::getSubject( $ns2 );
-       }
-
-       /**
-        * Returns array of all defined namespaces with their canonical
-        * (English) names.
-        *
-        * @param bool $rebuild Rebuild namespace list (default = false). Used for testing.
-        *
-        * @return array
-        * @since 1.17
-        */
-       public static function getCanonicalNamespaces( $rebuild = false ) {
-               static $namespaces = null;
-               if ( $namespaces === null || $rebuild ) {
-                       global $wgExtraNamespaces, $wgCanonicalNamespaceNames;
-                       $namespaces = array( NS_MAIN => '' ) + $wgCanonicalNamespaceNames;
-                       if ( is_array( $wgExtraNamespaces ) ) {
-                               $namespaces += $wgExtraNamespaces;
-                       }
-                       wfRunHooks( 'CanonicalNamespaces', array( &$namespaces ) );
-               }
-               return $namespaces;
-       }
-
-       /**
-        * Returns the canonical (English) name for a given index
-        *
-        * @param int $index Namespace index
-        * @return string|bool If no canonical definition.
-        */
-       public static function getCanonicalName( $index ) {
-               $nslist = self::getCanonicalNamespaces();
-               if ( isset( $nslist[$index] ) ) {
-                       return $nslist[$index];
-               } else {
-                       return false;
-               }
-       }
-
-       /**
-        * Returns the index for a given canonical name, or NULL
-        * The input *must* be converted to lower case first
-        *
-        * @param string $name Namespace name
-        * @return int
-        */
-       public static function getCanonicalIndex( $name ) {
-               static $xNamespaces = false;
-               if ( $xNamespaces === false ) {
-                       $xNamespaces = array();
-                       foreach ( self::getCanonicalNamespaces() as $i => $text ) {
-                               $xNamespaces[strtolower( $text )] = $i;
-                       }
-               }
-               if ( array_key_exists( $name, $xNamespaces ) ) {
-                       return $xNamespaces[$name];
-               } else {
-                       return null;
-               }
-       }
-
-       /**
-        * Returns an array of the namespaces (by integer id) that exist on the
-        * wiki. Used primarily by the api in help documentation.
-        * @return array
-        */
-       public static function getValidNamespaces() {
-               static $mValidNamespaces = null;
-
-               if ( is_null( $mValidNamespaces ) ) {
-                       foreach ( array_keys( self::getCanonicalNamespaces() ) as $ns ) {
-                               if ( $ns >= 0 ) {
-                                       $mValidNamespaces[] = $ns;
-                               }
-                       }
-               }
-
-               return $mValidNamespaces;
-       }
-
-       /**
-        * Can this namespace ever have a talk namespace?
-        *
-        * @param int $index Namespace index
-        * @return bool
-        */
-       public static function canTalk( $index ) {
-               return $index >= NS_MAIN;
-       }
-
-       /**
-        * Does this namespace contain content, for the purposes of calculating
-        * statistics, etc?
-        *
-        * @param int $index Index to check
-        * @return bool
-        */
-       public static function isContent( $index ) {
-               global $wgContentNamespaces;
-               return $index == NS_MAIN || in_array( $index, $wgContentNamespaces );
-       }
-
-       /**
-        * Can pages in a namespace be watched?
-        *
-        * @param int $index
-        * @return bool
-        */
-       public static function isWatchable( $index ) {
-               return $index >= NS_MAIN;
-       }
-
-       /**
-        * Does the namespace allow subpages?
-        *
-        * @param int $index Index to check
-        * @return bool
-        */
-       public static function hasSubpages( $index ) {
-               global $wgNamespacesWithSubpages;
-               return !empty( $wgNamespacesWithSubpages[$index] );
-       }
-
-       /**
-        * Get a list of all namespace indices which are considered to contain content
-        * @return array Array of namespace indices
-        */
-       public static function getContentNamespaces() {
-               global $wgContentNamespaces;
-               if ( !is_array( $wgContentNamespaces ) || $wgContentNamespaces === array() ) {
-                       return array( NS_MAIN );
-               } elseif ( !in_array( NS_MAIN, $wgContentNamespaces ) ) {
-                       // always force NS_MAIN to be part of array (to match the algorithm used by isContent)
-                       return array_merge( array( NS_MAIN ), $wgContentNamespaces );
-               } else {
-                       return $wgContentNamespaces;
-               }
-       }
-
-       /**
-        * List all namespace indices which are considered subject, aka not a talk
-        * or special namespace. See also MWNamespace::isSubject
-        *
-        * @return array Array of namespace indices
-        */
-       public static function getSubjectNamespaces() {
-               return array_filter(
-                       MWNamespace::getValidNamespaces(),
-                       'MWNamespace::isSubject'
-               );
-       }
-
-       /**
-        * List all namespace indices which are considered talks, aka not a subject
-        * or special namespace. See also MWNamespace::isTalk
-        *
-        * @return array Array of namespace indices
-        */
-       public static function getTalkNamespaces() {
-               return array_filter(
-                       MWNamespace::getValidNamespaces(),
-                       'MWNamespace::isTalk'
-               );
-       }
-
-       /**
-        * Is the namespace first-letter capitalized?
-        *
-        * @param int $index Index to check
-        * @return bool
-        */
-       public static function isCapitalized( $index ) {
-               global $wgCapitalLinks, $wgCapitalLinkOverrides;
-               // Turn NS_MEDIA into NS_FILE
-               $index = $index === NS_MEDIA ? NS_FILE : $index;
-
-               // Make sure to get the subject of our namespace
-               $index = self::getSubject( $index );
-
-               // Some namespaces are special and should always be upper case
-               if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
-                       return true;
-               }
-               if ( isset( $wgCapitalLinkOverrides[$index] ) ) {
-                       // $wgCapitalLinkOverrides is explicitly set
-                       return $wgCapitalLinkOverrides[$index];
-               }
-               // Default to the global setting
-               return $wgCapitalLinks;
-       }
-
-       /**
-        * Does the namespace (potentially) have different aliases for different
-        * genders. Not all languages make a distinction here.
-        *
-        * @since 1.18
-        * @param int $index Index to check
-        * @return bool
-        */
-       public static function hasGenderDistinction( $index ) {
-               return $index == NS_USER || $index == NS_USER_TALK;
-       }
-
-       /**
-        * It is not possible to use pages from this namespace as template?
-        *
-        * @since 1.20
-        * @param int $index Index to check
-        * @return bool
-        */
-       public static function isNonincludable( $index ) {
-               global $wgNonincludableNamespaces;
-               return $wgNonincludableNamespaces && in_array( $index, $wgNonincludableNamespaces );
-       }
-
-       /**
-        * Get the default content model for a namespace
-        * This does not mean that all pages in that namespace have the model
-        *
-        * @since 1.21
-        * @param int $index Index to check
-        * @return null|string Default model name for the given namespace, if set
-        */
-       public static function getNamespaceContentModel( $index ) {
-               global $wgNamespaceContentModels;
-               return isset( $wgNamespaceContentModels[$index] )
-                       ? $wgNamespaceContentModels[$index]
-                       : null;
-       }
-
-       /**
-        * Determine which restriction levels it makes sense to use in a namespace,
-        * optionally filtered by a user's rights.
-        *
-        * @since 1.23
-        * @param int $index Index to check
-        * @param User $user User to check
-        * @return array
-        */
-       public static function getRestrictionLevels( $index, User $user = null ) {
-               global $wgNamespaceProtection, $wgRestrictionLevels;
-
-               if ( !isset( $wgNamespaceProtection[$index] ) ) {
-                       // All levels are valid if there's no namespace restriction.
-                       // But still filter by user, if necessary
-                       $levels = $wgRestrictionLevels;
-                       if ( $user ) {
-                               $levels = array_values( array_filter( $levels, function ( $level ) use ( $user ) {
-                                       $right = $level;
-                                       if ( $right == 'sysop' ) {
-                                               $right = 'editprotected'; // BC
-                                       }
-                                       if ( $right == 'autoconfirmed' ) {
-                                               $right = 'editsemiprotected'; // BC
-                                       }
-                                       return ( $right == '' || $user->isAllowed( $right ) );
-                               } ) );
-                       }
-                       return $levels;
-               }
-
-               // First, get the list of groups that can edit this namespace.
-               $namespaceGroups = array();
-               $combine = 'array_merge';
-               foreach ( (array)$wgNamespaceProtection[$index] as $right ) {
-                       if ( $right == 'sysop' ) {
-                               $right = 'editprotected'; // BC
-                       }
-                       if ( $right == 'autoconfirmed' ) {
-                               $right = 'editsemiprotected'; // BC
-                       }
-                       if ( $right != '' ) {
-                               $namespaceGroups = call_user_func( $combine, $namespaceGroups,
-                                       User::getGroupsWithPermission( $right ) );
-                               $combine = 'array_intersect';
-                       }
-               }
-
-               // Now, keep only those restriction levels where there is at least one
-               // group that can edit the namespace but would be blocked by the
-               // restriction.
-               $usableLevels = array( '' );
-               foreach ( $wgRestrictionLevels as $level ) {
-                       $right = $level;
-                       if ( $right == 'sysop' ) {
-                               $right = 'editprotected'; // BC
-                       }
-                       if ( $right == 'autoconfirmed' ) {
-                               $right = 'editsemiprotected'; // BC
-                       }
-                       if ( $right != '' && ( !$user || $user->isAllowed( $right ) ) &&
-                               array_diff( $namespaceGroups, User::getGroupsWithPermission( $right ) )
-                       ) {
-                               $usableLevels[] = $level;
-                       }
-               }
-
-               return $usableLevels;
-       }
-}
diff --git a/includes/Wiki.php b/includes/Wiki.php
deleted file mode 100644 (file)
index a8bafa3..0000000
+++ /dev/null
@@ -1,722 +0,0 @@
-<?php
-/**
- * Helper class for the index.php entry point.
- *
- * 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
- */
-
-/**
- * The MediaWiki class is the helper class for the index.php entry point.
- *
- * @internal documentation reviewed 15 Mar 2010
- */
-class MediaWiki {
-       /**
-        * @todo Fold $output, etc, into this
-        * @var IContextSource
-        */
-       private $context;
-
-       /**
-        * @param null|WebRequest $x
-        * @return WebRequest
-        */
-       public function request( WebRequest $x = null ) {
-               $old = $this->context->getRequest();
-               $this->context->setRequest( $x );
-               return $old;
-       }
-
-       /**
-        * @param null|OutputPage $x
-        * @return OutputPage
-        */
-       public function output( OutputPage $x = null ) {
-               $old = $this->context->getOutput();
-               $this->context->setOutput( $x );
-               return $old;
-       }
-
-       /**
-        * @param IContextSource|null $context
-        */
-       public function __construct( IContextSource $context = null ) {
-               if ( !$context ) {
-                       $context = RequestContext::getMain();
-               }
-
-               $this->context = $context;
-       }
-
-       /**
-        * Parse the request to get the Title object
-        *
-        * @return Title Title object to be $wgTitle
-        */
-       private function parseTitle() {
-               global $wgContLang;
-
-               $request = $this->context->getRequest();
-               $curid = $request->getInt( 'curid' );
-               $title = $request->getVal( 'title' );
-               $action = $request->getVal( 'action', 'view' );
-
-               if ( $request->getCheck( 'search' ) ) {
-                       // Compatibility with old search URLs which didn't use Special:Search
-                       // Just check for presence here, so blank requests still
-                       // show the search page when using ugly URLs (bug 8054).
-                       $ret = SpecialPage::getTitleFor( 'Search' );
-               } elseif ( $curid ) {
-                       // URLs like this are generated by RC, because rc_title isn't always accurate
-                       $ret = Title::newFromID( $curid );
-               } else {
-                       $ret = Title::newFromURL( $title );
-                       // Alias NS_MEDIA page URLs to NS_FILE...we only use NS_MEDIA
-                       // in wikitext links to tell Parser to make a direct file link
-                       if ( !is_null( $ret ) && $ret->getNamespace() == NS_MEDIA ) {
-                               $ret = Title::makeTitle( NS_FILE, $ret->getDBkey() );
-                       }
-                       // Check variant links so that interwiki links don't have to worry
-                       // about the possible different language variants
-                       if ( count( $wgContLang->getVariants() ) > 1
-                               && !is_null( $ret ) && $ret->getArticleID() == 0
-                       ) {
-                               $wgContLang->findVariantLink( $title, $ret );
-                       }
-               }
-
-               // If title is not provided, always allow oldid and diff to set the title.
-               // If title is provided, allow oldid and diff to override the title, unless
-               // we are talking about a special page which might use these parameters for
-               // other purposes.
-               if ( $ret === null || !$ret->isSpecialPage() ) {
-                       // We can have urls with just ?diff=,?oldid= or even just ?diff=
-                       $oldid = $request->getInt( 'oldid' );
-                       $oldid = $oldid ? $oldid : $request->getInt( 'diff' );
-                       // Allow oldid to override a changed or missing title
-                       if ( $oldid ) {
-                               $rev = Revision::newFromId( $oldid );
-                               $ret = $rev ? $rev->getTitle() : $ret;
-                       }
-               }
-
-               // Use the main page as default title if nothing else has been provided
-               if ( $ret === null
-                       && strval( $title ) === ''
-                       && !$request->getCheck( 'curid' )
-                       && $action !== 'delete'
-               ) {
-                       $ret = Title::newMainPage();
-               }
-
-               if ( $ret === null || ( $ret->getDBkey() == '' && !$ret->isExternal() ) ) {
-                       $ret = SpecialPage::getTitleFor( 'Badtitle' );
-               }
-
-               return $ret;
-       }
-
-       /**
-        * Get the Title object that we'll be acting on, as specified in the WebRequest
-        * @return Title
-        */
-       public function getTitle() {
-               if ( $this->context->getTitle() === null ) {
-                       $this->context->setTitle( $this->parseTitle() );
-               }
-               return $this->context->getTitle();
-       }
-
-       /**
-        * Returns the name of the action that will be executed.
-        *
-        * @return string Action
-        */
-       public function getAction() {
-               static $action = null;
-
-               if ( $action === null ) {
-                       $action = Action::getActionName( $this->context );
-               }
-
-               return $action;
-       }
-
-       /**
-        * Performs the request.
-        * - bad titles
-        * - read restriction
-        * - local interwiki redirects
-        * - redirect loop
-        * - special pages
-        * - normal pages
-        *
-        * @throws MWException|PermissionsError|BadTitleError|HttpError
-        * @return void
-        */
-       private function performRequest() {
-               global $wgServer, $wgUsePathInfo, $wgTitle;
-
-               wfProfileIn( __METHOD__ );
-
-               $request = $this->context->getRequest();
-               $requestTitle = $title = $this->context->getTitle();
-               $output = $this->context->getOutput();
-               $user = $this->context->getUser();
-
-               if ( $request->getVal( 'printable' ) === 'yes' ) {
-                       $output->setPrintable();
-               }
-
-               $unused = null; // To pass it by reference
-               wfRunHooks( 'BeforeInitialize', array( &$title, &$unused, &$output, &$user, $request, $this ) );
-
-               // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
-               if ( is_null( $title ) || ( $title->getDBkey() == '' && !$title->isExternal() )
-                       || $title->isSpecial( 'Badtitle' )
-               ) {
-                       $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
-                       wfProfileOut( __METHOD__ );
-                       throw new BadTitleError();
-               }
-
-               // Check user's permissions to read this page.
-               // We have to check here to catch special pages etc.
-               // We will check again in Article::view().
-               $permErrors = $title->getUserPermissionsErrors( 'read', $user );
-               if ( count( $permErrors ) ) {
-                       // Bug 32276: allowing the skin to generate output with $wgTitle or
-                       // $this->context->title set to the input title would allow anonymous users to
-                       // determine whether a page exists, potentially leaking private data. In fact, the
-                       // curid and oldid request  parameters would allow page titles to be enumerated even
-                       // when they are not guessable. So we reset the title to Special:Badtitle before the
-                       // permissions error is displayed.
-                       //
-                       // The skin mostly uses $this->context->getTitle() these days, but some extensions
-                       // still use $wgTitle.
-
-                       $badTitle = SpecialPage::getTitleFor( 'Badtitle' );
-                       $this->context->setTitle( $badTitle );
-                       $wgTitle = $badTitle;
-
-                       wfProfileOut( __METHOD__ );
-                       throw new PermissionsError( 'read', $permErrors );
-               }
-
-               $pageView = false; // was an article or special page viewed?
-
-               // Interwiki redirects
-               if ( $title->isExternal() ) {
-                       $rdfrom = $request->getVal( 'rdfrom' );
-                       if ( $rdfrom ) {
-                               $url = $title->getFullURL( array( 'rdfrom' => $rdfrom ) );
-                       } else {
-                               $query = $request->getValues();
-                               unset( $query['title'] );
-                               $url = $title->getFullURL( $query );
-                       }
-                       // Check for a redirect loop
-                       if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url )
-                               && $title->isLocal()
-                       ) {
-                               // 301 so google et al report the target as the actual url.
-                               $output->redirect( $url, 301 );
-                       } else {
-                               $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
-                               wfProfileOut( __METHOD__ );
-                               throw new BadTitleError();
-                       }
-               // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
-               } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()
-                       && ( $request->getVal( 'title' ) === null
-                               || $title->getPrefixedDBkey() != $request->getVal( 'title' ) )
-                       && !count( $request->getValueNames( array( 'action', 'title' ) ) )
-                       && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) )
-               ) {
-                       if ( $title->isSpecialPage() ) {
-                               list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
-                               if ( $name ) {
-                                       $title = SpecialPage::getTitleFor( $name, $subpage );
-                               }
-                       }
-                       $targetUrl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
-                       // Redirect to canonical url, make it a 301 to allow caching
-                       if ( $targetUrl == $request->getFullRequestURL() ) {
-                               $message = "Redirect loop detected!\n\n" .
-                                       "This means the wiki got confused about what page was " .
-                                       "requested; this sometimes happens when moving a wiki " .
-                                       "to a new server or changing the server configuration.\n\n";
-
-                               if ( $wgUsePathInfo ) {
-                                       $message .= "The wiki is trying to interpret the page " .
-                                               "title from the URL path portion (PATH_INFO), which " .
-                                               "sometimes fails depending on the web server. Try " .
-                                               "setting \"\$wgUsePathInfo = false;\" in your " .
-                                               "LocalSettings.php, or check that \$wgArticlePath " .
-                                               "is correct.";
-                               } else {
-                                       $message .= "Your web server was detected as possibly not " .
-                                               "supporting URL path components (PATH_INFO) correctly; " .
-                                               "check your LocalSettings.php for a customized " .
-                                               "\$wgArticlePath setting and/or toggle \$wgUsePathInfo " .
-                                               "to true.";
-                               }
-                               throw new HttpError( 500, $message );
-                       } else {
-                               $output->setSquidMaxage( 1200 );
-                               $output->redirect( $targetUrl, '301' );
-                       }
-               // Special pages
-               } elseif ( NS_SPECIAL == $title->getNamespace() ) {
-                       $pageView = true;
-                       // Actions that need to be made when we have a special pages
-                       SpecialPageFactory::executePath( $title, $this->context );
-               } else {
-                       // ...otherwise treat it as an article view. The article
-                       // may be a redirect to another article or URL.
-                       $article = $this->initializeArticle();
-                       if ( is_object( $article ) ) {
-                               $pageView = true;
-                               $this->performAction( $article, $requestTitle );
-                       } elseif ( is_string( $article ) ) {
-                               $output->redirect( $article );
-                       } else {
-                               wfProfileOut( __METHOD__ );
-                               throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle()"
-                                       . " returned neither an object nor a URL" );
-                       }
-               }
-
-               if ( $pageView ) {
-                       // Promote user to any groups they meet the criteria for
-                       $user->addAutopromoteOnceGroups( 'onView' );
-               }
-
-               wfProfileOut( __METHOD__ );
-       }
-
-       /**
-        * Initialize the main Article object for "standard" actions (view, etc)
-        * Create an Article object for the page, following redirects if needed.
-        *
-        * @return mixed An Article, or a string to redirect to another URL
-        */
-       private function initializeArticle() {
-               global $wgDisableHardRedirects;
-
-               wfProfileIn( __METHOD__ );
-
-               $title = $this->context->getTitle();
-               if ( $this->context->canUseWikiPage() ) {
-                       // Try to use request context wiki page, as there
-                       // is already data from db saved in per process
-                       // cache there from this->getAction() call.
-                       $page = $this->context->getWikiPage();
-                       $article = Article::newFromWikiPage( $page, $this->context );
-               } else {
-                       // This case should not happen, but just in case.
-                       $article = Article::newFromTitle( $title, $this->context );
-                       $this->context->setWikiPage( $article->getPage() );
-               }
-
-               // NS_MEDIAWIKI has no redirects.
-               // It is also used for CSS/JS, so performance matters here...
-               if ( $title->getNamespace() == NS_MEDIAWIKI ) {
-                       wfProfileOut( __METHOD__ );
-                       return $article;
-               }
-
-               $request = $this->context->getRequest();
-
-               // Namespace might change when using redirects
-               // Check for redirects ...
-               $action = $request->getVal( 'action', 'view' );
-               $file = ( $title->getNamespace() == NS_FILE ) ? $article->getFile() : null;
-               if ( ( $action == 'view' || $action == 'render' ) // ... for actions that show content
-                       && !$request->getVal( 'oldid' ) // ... and are not old revisions
-                       && !$request->getVal( 'diff' ) // ... and not when showing diff
-                       && $request->getVal( 'redirect' ) != 'no' // ... unless explicitly told not to
-                       // ... and the article is not a non-redirect image page with associated file
-                       && !( is_object( $file ) && $file->exists() && !$file->getRedirected() )
-               ) {
-                       // Give extensions a change to ignore/handle redirects as needed
-                       $ignoreRedirect = $target = false;
-
-                       wfRunHooks( 'InitializeArticleMaybeRedirect',
-                               array( &$title, &$request, &$ignoreRedirect, &$target, &$article ) );
-
-                       // Follow redirects only for... redirects.
-                       // If $target is set, then a hook wanted to redirect.
-                       if ( !$ignoreRedirect && ( $target || $article->isRedirect() ) ) {
-                               // Is the target already set by an extension?
-                               $target = $target ? $target : $article->followRedirect();
-                               if ( is_string( $target ) ) {
-                                       if ( !$wgDisableHardRedirects ) {
-                                               // we'll need to redirect
-                                               wfProfileOut( __METHOD__ );
-                                               return $target;
-                                       }
-                               }
-                               if ( is_object( $target ) ) {
-                                       // Rewrite environment to redirected article
-                                       $rarticle = Article::newFromTitle( $target, $this->context );
-                                       $rarticle->loadPageData();
-                                       if ( $rarticle->exists() || ( is_object( $file ) && !$file->isLocal() ) ) {
-                                               $rarticle->setRedirectedFrom( $title );
-                                               $article = $rarticle;
-                                               $this->context->setTitle( $target );
-                                               $this->context->setWikiPage( $article->getPage() );
-                                       }
-                               }
-                       } else {
-                               $this->context->setTitle( $article->getTitle() );
-                               $this->context->setWikiPage( $article->getPage() );
-                       }
-               }
-
-               wfProfileOut( __METHOD__ );
-               return $article;
-       }
-
-       /**
-        * Perform one of the "standard" actions
-        *
-        * @param Page $page
-        * @param Title $requestTitle The original title, before any redirects were applied
-        */
-       private function performAction( Page $page, Title $requestTitle ) {
-               global $wgUseSquid, $wgSquidMaxage;
-
-               wfProfileIn( __METHOD__ );
-
-               $request = $this->context->getRequest();
-               $output = $this->context->getOutput();
-               $title = $this->context->getTitle();
-               $user = $this->context->getUser();
-
-               if ( !wfRunHooks( 'MediaWikiPerformAction',
-                               array( $output, $page, $title, $user, $request, $this ) )
-               ) {
-                       wfProfileOut( __METHOD__ );
-                       return;
-               }
-
-               $act = $this->getAction();
-
-               $action = Action::factory( $act, $page, $this->context );
-
-               if ( $action instanceof Action ) {
-                       # Let Squid cache things if we can purge them.
-                       if ( $wgUseSquid &&
-                               in_array( $request->getFullRequestURL(), $requestTitle->getSquidURLs() )
-                       ) {
-                               $output->setSquidMaxage( $wgSquidMaxage );
-                       }
-
-                       $action->show();
-                       wfProfileOut( __METHOD__ );
-                       return;
-               }
-
-               if ( wfRunHooks( 'UnknownAction', array( $request->getVal( 'action', 'view' ), $page ) ) ) {
-                       $output->setStatusCode( 404 );
-                       $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
-               }
-
-               wfProfileOut( __METHOD__ );
-       }
-
-       /**
-        * Run the current MediaWiki instance
-        * index.php just calls this
-        */
-       public function run() {
-               try {
-                       $this->checkMaxLag();
-                       try {
-                               $this->main();
-                       } catch ( ErrorPageError $e ) {
-                               // Bug 62091: while exceptions are convenient to bubble up GUI errors,
-                               // they are not internal application faults. As with normal requests, this
-                               // should commit, print the output, do deferred updates, jobs, and profiling.
-                               wfGetLBFactory()->commitMasterChanges();
-                               $e->report(); // display the GUI error
-                       }
-                       if ( function_exists( 'fastcgi_finish_request' ) ) {
-                               fastcgi_finish_request();
-                       }
-                       $this->triggerJobs();
-                       $this->restInPeace();
-               } catch ( Exception $e ) {
-                       MWExceptionHandler::handle( $e );
-               }
-       }
-
-       /**
-        * Checks if the request should abort due to a lagged server,
-        * for given maxlag parameter.
-        * @return bool
-        */
-       private function checkMaxLag() {
-               global $wgShowHostnames;
-
-               wfProfileIn( __METHOD__ );
-               $maxLag = $this->context->getRequest()->getVal( 'maxlag' );
-               if ( !is_null( $maxLag ) ) {
-                       list( $host, $lag ) = wfGetLB()->getMaxLag();
-                       if ( $lag > $maxLag ) {
-                               $resp = $this->context->getRequest()->response();
-                               $resp->header( 'HTTP/1.1 503 Service Unavailable' );
-                               $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
-                               $resp->header( 'X-Database-Lag: ' . intval( $lag ) );
-                               $resp->header( 'Content-Type: text/plain' );
-                               if ( $wgShowHostnames ) {
-                                       echo "Waiting for $host: $lag seconds lagged\n";
-                               } else {
-                                       echo "Waiting for a database server: $lag seconds lagged\n";
-                               }
-
-                               wfProfileOut( __METHOD__ );
-
-                               exit;
-                       }
-               }
-               wfProfileOut( __METHOD__ );
-               return true;
-       }
-
-       private function main() {
-               global $wgUseFileCache, $wgTitle, $wgUseAjax;
-
-               wfProfileIn( __METHOD__ );
-
-               $request = $this->context->getRequest();
-
-               // Send Ajax requests to the Ajax dispatcher.
-               if ( $wgUseAjax && $request->getVal( 'action', 'view' ) == 'ajax' ) {
-
-                       // Set a dummy title, because $wgTitle == null might break things
-                       $title = Title::makeTitle( NS_MAIN, 'AJAX' );
-                       $this->context->setTitle( $title );
-                       $wgTitle = $title;
-
-                       $dispatcher = new AjaxDispatcher();
-                       $dispatcher->performAction();
-                       wfProfileOut( __METHOD__ );
-                       return;
-               }
-
-               // Get title from request parameters,
-               // is set on the fly by parseTitle the first time.
-               $title = $this->getTitle();
-               $action = $this->getAction();
-               $wgTitle = $title;
-
-               // If the user has forceHTTPS set to true, or if the user
-               // is in a group requiring HTTPS, or if they have the HTTPS
-               // preference set, redirect them to HTTPS.
-               // Note: Do this after $wgTitle is setup, otherwise the hooks run from
-               // isLoggedIn() will do all sorts of weird stuff.
-               if (
-                       $request->getProtocol() == 'http' &&
-                       (
-                               $request->getCookie( 'forceHTTPS', '' ) ||
-                               // check for prefixed version for currently logged in users
-                               $request->getCookie( 'forceHTTPS' ) ||
-                               // Avoid checking the user and groups unless it's enabled.
-                               (
-                                       $this->context->getUser()->isLoggedIn()
-                                       && $this->context->getUser()->requiresHTTPS()
-                               )
-                       )
-               ) {
-                       $oldUrl = $request->getFullRequestURL();
-                       $redirUrl = preg_replace( '#^http://#', 'https://', $oldUrl );
-
-                       // ATTENTION: This hook is likely to be removed soon due to overall design of the system.
-                       if ( wfRunHooks( 'BeforeHttpsRedirect', array( $this->context, &$redirUrl ) ) ) {
-
-                               if ( $request->wasPosted() ) {
-                                       // This is weird and we'd hope it almost never happens. This
-                                       // means that a POST came in via HTTP and policy requires us
-                                       // redirecting to HTTPS. It's likely such a request is going
-                                       // to fail due to post data being lost, but let's try anyway
-                                       // and just log the instance.
-                                       //
-                                       // @todo @fixme See if we could issue a 307 or 308 here, need
-                                       // to see how clients (automated & browser) behave when we do
-                                       wfDebugLog( 'RedirectedPosts', "Redirected from HTTP to HTTPS: $oldUrl" );
-                               }
-                               // Setup dummy Title, otherwise OutputPage::redirect will fail
-                               $title = Title::newFromText( NS_MAIN, 'REDIR' );
-                               $this->context->setTitle( $title );
-                               $output = $this->context->getOutput();
-                               // Since we only do this redir to change proto, always send a vary header
-                               $output->addVaryHeader( 'X-Forwarded-Proto' );
-                               $output->redirect( $redirUrl );
-                               $output->output();
-                               wfProfileOut( __METHOD__ );
-                               return;
-                       }
-               }
-
-               if ( $wgUseFileCache && $title->getNamespace() >= 0 ) {
-                       wfProfileIn( 'main-try-filecache' );
-                       if ( HTMLFileCache::useFileCache( $this->context ) ) {
-                               // Try low-level file cache hit
-                               $cache = HTMLFileCache::newFromTitle( $title, $action );
-                               if ( $cache->isCacheGood( /* Assume up to date */ ) ) {
-                                       // Check incoming headers to see if client has this cached
-                                       $timestamp = $cache->cacheTimestamp();
-                                       if ( !$this->context->getOutput()->checkLastModified( $timestamp ) ) {
-                                               $cache->loadFromFileCache( $this->context );
-                                       }
-                                       // Do any stats increment/watchlist stuff
-                                       // Assume we're viewing the latest revision (this should always be the case with file cache)
-                                       $this->context->getWikiPage()->doViewUpdates( $this->context->getUser() );
-                                       // Tell OutputPage that output is taken care of
-                                       $this->context->getOutput()->disable();
-                                       wfProfileOut( 'main-try-filecache' );
-                                       wfProfileOut( __METHOD__ );
-                                       return;
-                               }
-                       }
-                       wfProfileOut( 'main-try-filecache' );
-               }
-
-               // Actually do the work of the request and build up any output
-               $this->performRequest();
-
-               // Either all DB and deferred updates should happen or none.
-               // The later should not be cancelled due to client disconnect.
-               ignore_user_abort( true );
-               // Now commit any transactions, so that unreported errors after
-               // output() don't roll back the whole DB transaction
-               wfGetLBFactory()->commitMasterChanges();
-
-               // Output everything!
-               $this->context->getOutput()->output();
-
-               wfProfileOut( __METHOD__ );
-       }
-
-       /**
-        * Ends this task peacefully
-        */
-       public function restInPeace() {
-               // Do any deferred jobs
-               DeferredUpdates::doUpdates( 'commit' );
-
-               // Log profiling data, e.g. in the database or UDP
-               wfLogProfilingData();
-
-               // Commit and close up!
-               $factory = wfGetLBFactory();
-               $factory->commitMasterChanges();
-               $factory->shutdown();
-
-               wfDebug( "Request ended normally\n" );
-       }
-
-       /**
-        * Potentially open a socket and sent an HTTP request back to the server
-        * to run a specified number of jobs. This registers a callback to cleanup
-        * the socket once it's done.
-        */
-       protected function triggerJobs() {
-               global $wgJobRunRate, $wgServer, $wgRunJobsAsync;
-
-               if ( $wgJobRunRate <= 0 || wfReadOnly() ) {
-                       return;
-               } elseif ( $this->getTitle()->isSpecial( 'RunJobs' ) ) {
-                       return; // recursion guard
-               }
-
-               $section = new ProfileSection( __METHOD__ );
-
-               if ( $wgJobRunRate < 1 ) {
-                       $max = mt_getrandmax();
-                       if ( mt_rand( 0, $max ) > $max * $wgJobRunRate ) {
-                               return; // the higher $wgJobRunRate, the less likely we return here
-                       }
-                       $n = 1;
-               } else {
-                       $n = intval( $wgJobRunRate );
-               }
-
-               if ( !$wgRunJobsAsync ) {
-                       // If running jobs asynchronously has been disabled, run the job here
-                       // while the user waits
-                       SpecialRunJobs::executeJobs( $n );
-                       return;
-               }
-
-               try {
-                       if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) {
-                               return; // do not send request if there are probably no jobs
-                       }
-               } catch ( JobQueueError $e ) {
-                       MWExceptionHandler::logException( $e );
-                       return; // do not make the site unavailable
-               }
-
-               $query = array( 'title' => 'Special:RunJobs',
-                       'tasks' => 'jobs', 'maxjobs' => $n, 'sigexpiry' => time() + 5 );
-               $query['signature'] = SpecialRunJobs::getQuerySignature( $query );
-
-               $errno = $errstr = null;
-               $info = wfParseUrl( $wgServer );
-               wfSuppressWarnings();
-               $sock = fsockopen(
-                       $info['host'],
-                       isset( $info['port'] ) ? $info['port'] : 80,
-                       $errno,
-                       $errstr,
-                       // If it takes more than 100ms to connect to ourselves there
-                       // is a problem elsewhere.
-                       0.1
-               );
-               wfRestoreWarnings();
-               if ( !$sock ) {
-                       wfDebugLog( 'runJobs', "Failed to start cron API (socket error $errno): $errstr\n" );
-                       // Fall back to running the job here while the user waits
-                       SpecialRunJobs::executeJobs( $n );
-                       return;
-               }
-
-               $url = wfAppendQuery( wfScript( 'index' ), $query );
-               $req = "POST $url HTTP/1.1\r\nHost: {$info['host']}\r\nConnection: Close\r\n\r\n";
-
-               wfDebugLog( 'runJobs', "Running $n job(s) via '$url'\n" );
-               // Send a cron API request to be performed in the background.
-               // Give up if this takes too long to send (which should be rare).
-               stream_set_timeout( $sock, 1 );
-               $bytes = fwrite( $sock, $req );
-               if ( $bytes !== strlen( $req ) ) {
-                       wfDebugLog( 'runJobs', "Failed to start cron API (socket write error)\n" );
-               } else {
-                       // Do not wait for the response (the script should handle client aborts).
-                       // Make sure that we don't close before that script reaches ignore_user_abort().
-                       $status = fgets( $sock );
-                       if ( !preg_match( '#^HTTP/\d\.\d 202 #', $status ) ) {
-                               wfDebugLog( 'runJobs', "Failed to start cron API: received '$status'\n" );
-                       }
-               }
-               fclose( $sock );
-       }
-}
diff --git a/includes/debug/Debug.php b/includes/debug/Debug.php
deleted file mode 100644 (file)
index 0cea658..0000000
+++ /dev/null
@@ -1,562 +0,0 @@
-<?php
-/**
- * Debug toolbar related code.
- *
- * 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
- */
-
-/**
- * New debugger system that outputs a toolbar on page view.
- *
- * By default, most methods do nothing ( self::$enabled = false ). You have
- * to explicitly call MWDebug::init() to enabled them.
- *
- * @todo Profiler support
- *
- * @since 1.19
- */
-class MWDebug {
-       /**
-        * Log lines
-        *
-        * @var array $log
-        */
-       protected static $log = array();
-
-       /**
-        * Debug messages from wfDebug().
-        *
-        * @var array $debug
-        */
-       protected static $debug = array();
-
-       /**
-        * SQL statements of the databses queries.
-        *
-        * @var array $query
-        */
-       protected static $query = array();
-
-       /**
-        * Is the debugger enabled?
-        *
-        * @var bool $enabled
-        */
-       protected static $enabled = false;
-
-       /**
-        * Array of functions that have already been warned, formatted
-        * function-caller to prevent a buttload of warnings
-        *
-        * @var array $deprecationWarnings
-        */
-       protected static $deprecationWarnings = array();
-
-       /**
-        * Enabled the debugger and load resource module.
-        * This is called by Setup.php when $wgDebugToolbar is true.
-        *
-        * @since 1.19
-        */
-       public static function init() {
-               self::$enabled = true;
-       }
-
-       /**
-        * Add ResourceLoader modules to the OutputPage object if debugging is
-        * enabled.
-        *
-        * @since 1.19
-        * @param OutputPage $out
-        */
-       public static function addModules( OutputPage $out ) {
-               if ( self::$enabled ) {
-                       $out->addModules( 'mediawiki.debug.init' );
-               }
-       }
-
-       /**
-        * Adds a line to the log
-        *
-        * @todo Add support for passing objects
-        *
-        * @since 1.19
-        * @param string $str
-        */
-       public static function log( $str ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
-
-               self::$log[] = array(
-                       'msg' => htmlspecialchars( $str ),
-                       'type' => 'log',
-                       'caller' => wfGetCaller(),
-               );
-       }
-
-       /**
-        * Returns internal log array
-        * @since 1.19
-        * @return array
-        */
-       public static function getLog() {
-               return self::$log;
-       }
-
-       /**
-        * Clears internal log array and deprecation tracking
-        * @since 1.19
-        */
-       public static function clearLog() {
-               self::$log = array();
-               self::$deprecationWarnings = array();
-       }
-
-       /**
-        * Adds a warning entry to the log
-        *
-        * @since 1.19
-        * @param string $msg
-        * @param int $callerOffset
-        * @param int $level A PHP error level. See sendMessage()
-        * @param string $log 'production' will always trigger a php error, 'auto'
-        *    will trigger an error if $wgDevelopmentWarnings is true, and 'debug'
-        *    will only write to the debug log(s).
-        *
-        * @return mixed
-        */
-       public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE, $log = 'auto' ) {
-               global $wgDevelopmentWarnings;
-
-               if ( $log === 'auto' && !$wgDevelopmentWarnings ) {
-                       $log = 'debug';
-               }
-
-               if ( $log === 'debug' ) {
-                       $level = false;
-               }
-
-               $callerDescription = self::getCallerDescription( $callerOffset );
-
-               self::sendMessage( $msg, $callerDescription, 'warning', $level );
-
-               if ( self::$enabled ) {
-                       self::$log[] = array(
-                               'msg' => htmlspecialchars( $msg ),
-                               'type' => 'warn',
-                               'caller' => $callerDescription['func'],
-                       );
-               }
-       }
-
-       /**
-        * Show a warning that $function is deprecated.
-        * This will send it to the following locations:
-        * - Debug toolbar, with one item per function and caller, if $wgDebugToolbar
-        *   is set to true.
-        * - PHP's error log, with level E_USER_DEPRECATED, if $wgDevelopmentWarnings
-        *   is set to true.
-        * - MediaWiki's debug log, if $wgDevelopmentWarnings is set to false.
-        *
-        * @since 1.19
-        * @param string $function Function that is deprecated.
-        * @param string|bool $version Version in which the function was deprecated.
-        * @param string|bool $component Component to which the function belongs.
-        *    If false, it is assumbed the function is in MediaWiki core.
-        * @param int $callerOffset How far up the callstack is the original
-        *    caller. 2 = function that called the function that called
-        *    MWDebug::deprecated() (Added in 1.20).
-        * @return mixed
-        */
-       public static function deprecated( $function, $version = false,
-               $component = false, $callerOffset = 2
-       ) {
-               $callerDescription = self::getCallerDescription( $callerOffset );
-               $callerFunc = $callerDescription['func'];
-
-               $sendToLog = true;
-
-               // Check to see if there already was a warning about this function
-               if ( isset( self::$deprecationWarnings[$function][$callerFunc] ) ) {
-                       return;
-               } elseif ( isset( self::$deprecationWarnings[$function] ) ) {
-                       if ( self::$enabled ) {
-                               $sendToLog = false;
-                       } else {
-                               return;
-                       }
-               }
-
-               self::$deprecationWarnings[$function][$callerFunc] = true;
-
-               if ( $version ) {
-                       global $wgDeprecationReleaseLimit;
-                       if ( $wgDeprecationReleaseLimit && $component === false ) {
-                               # Strip -* off the end of $version so that branches can use the
-                               # format #.##-branchname to avoid issues if the branch is merged into
-                               # a version of MediaWiki later than what it was branched from
-                               $comparableVersion = preg_replace( '/-.*$/', '', $version );
-
-                               # If the comparableVersion is larger than our release limit then
-                               # skip the warning message for the deprecation
-                               if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
-                                       $sendToLog = false;
-                               }
-                       }
-
-                       $component = $component === false ? 'MediaWiki' : $component;
-                       $msg = "Use of $function was deprecated in $component $version.";
-               } else {
-                       $msg = "Use of $function is deprecated.";
-               }
-
-               if ( $sendToLog ) {
-                       global $wgDevelopmentWarnings; // we could have a more specific $wgDeprecationWarnings setting.
-                       self::sendMessage(
-                               $msg,
-                               $callerDescription,
-                               'deprecated',
-                               $wgDevelopmentWarnings ? E_USER_DEPRECATED : false
-                       );
-               }
-
-               if ( self::$enabled ) {
-                       $logMsg = htmlspecialchars( $msg ) .
-                               Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
-                                       Html::element( 'span', array(), 'Backtrace:' ) . wfBacktrace()
-                               );
-
-                       self::$log[] = array(
-                               'msg' => $logMsg,
-                               'type' => 'deprecated',
-                               'caller' => $callerFunc,
-                       );
-               }
-       }
-
-       /**
-        * Get an array describing the calling function at a specified offset.
-        *
-        * @param int $callerOffset How far up the callstack is the original
-        *    caller. 0 = function that called getCallerDescription()
-        * @return array Array with two keys: 'file' and 'func'
-        */
-       private static function getCallerDescription( $callerOffset ) {
-               $callers = wfDebugBacktrace();
-
-               if ( isset( $callers[$callerOffset] ) ) {
-                       $callerfile = $callers[$callerOffset];
-                       if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
-                               $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
-                       } else {
-                               $file = '(internal function)';
-                       }
-               } else {
-                       $file = '(unknown location)';
-               }
-
-               if ( isset( $callers[$callerOffset + 1] ) ) {
-                       $callerfunc = $callers[$callerOffset + 1];
-                       $func = '';
-                       if ( isset( $callerfunc['class'] ) ) {
-                               $func .= $callerfunc['class'] . '::';
-                       }
-                       if ( isset( $callerfunc['function'] ) ) {
-                               $func .= $callerfunc['function'];
-                       }
-               } else {
-                       $func = 'unknown';
-               }
-
-               return array( 'file' => $file, 'func' => $func );
-       }
-
-       /**
-        * Send a message to the debug log and optionally also trigger a PHP
-        * error, depending on the $level argument.
-        *
-        * @param string $msg Message to send
-        * @param array $caller Caller description get from getCallerDescription()
-        * @param string $group Log group on which to send the message
-        * @param int|bool $level Error level to use; set to false to not trigger an error
-        */
-       private static function sendMessage( $msg, $caller, $group, $level ) {
-               $msg .= ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
-
-               if ( $level !== false ) {
-                       trigger_error( $msg, $level );
-               }
-
-               wfDebugLog( $group, $msg, 'log' );
-       }
-
-       /**
-        * This is a method to pass messages from wfDebug to the pretty debugger.
-        * Do NOT use this method, use MWDebug::log or wfDebug()
-        *
-        * @since 1.19
-        * @param string $str
-        */
-       public static function debugMsg( $str ) {
-               global $wgDebugComments, $wgShowDebug;
-
-               if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
-                       self::$debug[] = rtrim( UtfNormal::cleanUp( $str ) );
-               }
-       }
-
-       /**
-        * Begins profiling on a database query
-        *
-        * @since 1.19
-        * @param string $sql
-        * @param string $function
-        * @param bool $isMaster
-        * @return int ID number of the query to pass to queryTime or -1 if the
-        *  debugger is disabled
-        */
-       public static function query( $sql, $function, $isMaster ) {
-               if ( !self::$enabled ) {
-                       return -1;
-               }
-
-               self::$query[] = array(
-                       'sql' => $sql,
-                       'function' => $function,
-                       'master' => (bool)$isMaster,
-                       'time' => 0.0,
-                       '_start' => microtime( true ),
-               );
-
-               return count( self::$query ) - 1;
-       }
-
-       /**
-        * Calculates how long a query took.
-        *
-        * @since 1.19
-        * @param int $id
-        */
-       public static function queryTime( $id ) {
-               if ( $id === -1 || !self::$enabled ) {
-                       return;
-               }
-
-               self::$query[$id]['time'] = microtime( true ) - self::$query[$id]['_start'];
-               unset( self::$query[$id]['_start'] );
-       }
-
-       /**
-        * Returns a list of files included, along with their size
-        *
-        * @param IContextSource $context
-        * @return array
-        */
-       protected static function getFilesIncluded( IContextSource $context ) {
-               $files = get_included_files();
-               $fileList = array();
-               foreach ( $files as $file ) {
-                       $size = filesize( $file );
-                       $fileList[] = array(
-                               'name' => $file,
-                               'size' => $context->getLanguage()->formatSize( $size ),
-                       );
-               }
-
-               return $fileList;
-       }
-
-       /**
-        * Returns the HTML to add to the page for the toolbar
-        *
-        * @since 1.19
-        * @param IContextSource $context
-        * @return string
-        */
-       public static function getDebugHTML( IContextSource $context ) {
-               global $wgDebugComments;
-
-               $html = '';
-
-               if ( self::$enabled ) {
-                       MWDebug::log( 'MWDebug output complete' );
-                       $debugInfo = self::getDebugInfo( $context );
-
-                       // Cannot use OutputPage::addJsConfigVars because those are already outputted
-                       // by the time this method is called.
-                       $html = Html::inlineScript(
-                               ResourceLoader::makeLoaderConditionalScript(
-                                       ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
-                               )
-                       );
-               }
-
-               if ( $wgDebugComments ) {
-                       $html .= "<!-- Debug output:\n" .
-                               htmlspecialchars( implode( "\n", self::$debug ) ) .
-                               "\n\n-->";
-               }
-
-               return $html;
-       }
-
-       /**
-        * Generate debug log in HTML for displaying at the bottom of the main
-        * content area.
-        * If $wgShowDebug is false, an empty string is always returned.
-        *
-        * @since 1.20
-        * @return string HTML fragment
-        */
-       public static function getHTMLDebugLog() {
-               global $wgDebugTimestamps, $wgShowDebug;
-
-               if ( !$wgShowDebug ) {
-                       return '';
-               }
-
-               $curIdent = 0;
-               $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n<li>";
-
-               foreach ( self::$debug as $line ) {
-                       $pre = '';
-                       if ( $wgDebugTimestamps ) {
-                               $matches = array();
-                               if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
-                                       $pre = $matches[1];
-                                       $line = substr( $line, strlen( $pre ) );
-                               }
-                       }
-                       $display = ltrim( $line );
-                       $ident = strlen( $line ) - strlen( $display );
-                       $diff = $ident - $curIdent;
-
-                       $display = $pre . $display;
-                       if ( $display == '' ) {
-                               $display = "\xc2\xa0";
-                       }
-
-                       if ( !$ident
-                               && $diff < 0
-                               && substr( $display, 0, 9 ) != 'Entering '
-                               && substr( $display, 0, 8 ) != 'Exiting '
-                       ) {
-                               $ident = $curIdent;
-                               $diff = 0;
-                               $display = '<span style="background:yellow;">' .
-                                       nl2br( htmlspecialchars( $display ) ) . '</span>';
-                       } else {
-                               $display = nl2br( htmlspecialchars( $display ) );
-                       }
-
-                       if ( $diff < 0 ) {
-                               $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
-                       } elseif ( $diff == 0 ) {
-                               $ret .= "</li><li>\n";
-                       } else {
-                               $ret .= str_repeat( "<ul><li>\n", $diff );
-                       }
-                       $ret .= "<code>$display</code>\n";
-
-                       $curIdent = $ident;
-               }
-
-               $ret .= str_repeat( '</li></ul>', $curIdent ) . "</li>\n</ul>\n";
-
-               return $ret;
-       }
-
-       /**
-        * Append the debug info to given ApiResult
-        *
-        * @param IContextSource $context
-        * @param ApiResult $result
-        */
-       public static function appendDebugInfoToApiResult( IContextSource $context, ApiResult $result ) {
-               if ( !self::$enabled ) {
-                       return;
-               }
-
-               // output errors as debug info, when display_errors is on
-               // this is necessary for all non html output of the api, because that clears all errors first
-               $obContents = ob_get_contents();
-               if ( $obContents ) {
-                       $obContentArray = explode( '<br />', $obContents );
-                       foreach ( $obContentArray as $obContent ) {
-                               if ( trim( $obContent ) ) {
-                                       self::debugMsg( Sanitizer::stripAllTags( $obContent ) );
-                               }
-                       }
-               }
-
-               MWDebug::log( 'MWDebug output complete' );
-               $debugInfo = self::getDebugInfo( $context );
-
-               $result->setIndexedTagName( $debugInfo, 'debuginfo' );
-               $result->setIndexedTagName( $debugInfo['log'], 'line' );
-               $result->setIndexedTagName( $debugInfo['debugLog'], 'msg' );
-               $result->setIndexedTagName( $debugInfo['queries'], 'query' );
-               $result->setIndexedTagName( $debugInfo['includes'], 'queries' );
-               $result->setIndexedTagName( $debugInfo['profile'], 'function' );
-               $result->addValue( null, 'debuginfo', $debugInfo );
-       }
-
-       /**
-        * Returns the HTML to add to the page for the toolbar
-        *
-        * @param IContextSource $context
-        * @return array
-        */
-       public static function getDebugInfo( IContextSource $context ) {
-               if ( !self::$enabled ) {
-                       return array();
-               }
-
-               global $wgVersion, $wgRequestTime;
-               $request = $context->getRequest();
-
-               // HHVM's reported memory usage from memory_get_peak_usage()
-               // is not useful when passing false, but we continue passing
-               // false for consistency of historical data in zend.
-               // see: https://github.com/facebook/hhvm/issues/2257#issuecomment-39362246
-               $realMemoryUsage = wfIsHHVM();
-
-               return array(
-                       'mwVersion' => $wgVersion,
-                       'phpVersion' => PHP_VERSION,
-                       'gitRevision' => GitInfo::headSHA1(),
-                       'gitBranch' => GitInfo::currentBranch(),
-                       'gitViewUrl' => GitInfo::headViewUrl(),
-                       'time' => microtime( true ) - $wgRequestTime,
-                       'log' => self::$log,
-                       'debugLog' => self::$debug,
-                       'queries' => self::$query,
-                       'request' => array(
-                               'method' => $request->getMethod(),
-                               'url' => $request->getRequestURL(),
-                               'headers' => $request->getAllHeaders(),
-                               'params' => $request->getValues(),
-                       ),
-                       'memory' => $context->getLanguage()->formatSize( memory_get_usage( $realMemoryUsage ) ),
-                       'memoryPeak' => $context->getLanguage()->formatSize( memory_get_peak_usage( $realMemoryUsage ) ),
-                       'includes' => self::getFilesIncluded( $context ),
-                       'profile' => Profiler::instance()->getRawData(),
-               );
-       }
-}
diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php
new file mode 100644 (file)
index 0000000..0cea658
--- /dev/null
@@ -0,0 +1,562 @@
+<?php
+/**
+ * Debug toolbar related code.
+ *
+ * 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
+ */
+
+/**
+ * New debugger system that outputs a toolbar on page view.
+ *
+ * By default, most methods do nothing ( self::$enabled = false ). You have
+ * to explicitly call MWDebug::init() to enabled them.
+ *
+ * @todo Profiler support
+ *
+ * @since 1.19
+ */
+class MWDebug {
+       /**
+        * Log lines
+        *
+        * @var array $log
+        */
+       protected static $log = array();
+
+       /**
+        * Debug messages from wfDebug().
+        *
+        * @var array $debug
+        */
+       protected static $debug = array();
+
+       /**
+        * SQL statements of the databses queries.
+        *
+        * @var array $query
+        */
+       protected static $query = array();
+
+       /**
+        * Is the debugger enabled?
+        *
+        * @var bool $enabled
+        */
+       protected static $enabled = false;
+
+       /**
+        * Array of functions that have already been warned, formatted
+        * function-caller to prevent a buttload of warnings
+        *
+        * @var array $deprecationWarnings
+        */
+       protected static $deprecationWarnings = array();
+
+       /**
+        * Enabled the debugger and load resource module.
+        * This is called by Setup.php when $wgDebugToolbar is true.
+        *
+        * @since 1.19
+        */
+       public static function init() {
+               self::$enabled = true;
+       }
+
+       /**
+        * Add ResourceLoader modules to the OutputPage object if debugging is
+        * enabled.
+        *
+        * @since 1.19
+        * @param OutputPage $out
+        */
+       public static function addModules( OutputPage $out ) {
+               if ( self::$enabled ) {
+                       $out->addModules( 'mediawiki.debug.init' );
+               }
+       }
+
+       /**
+        * Adds a line to the log
+        *
+        * @todo Add support for passing objects
+        *
+        * @since 1.19
+        * @param string $str
+        */
+       public static function log( $str ) {
+               if ( !self::$enabled ) {
+                       return;
+               }
+
+               self::$log[] = array(
+                       'msg' => htmlspecialchars( $str ),
+                       'type' => 'log',
+                       'caller' => wfGetCaller(),
+               );
+       }
+
+       /**
+        * Returns internal log array
+        * @since 1.19
+        * @return array
+        */
+       public static function getLog() {
+               return self::$log;
+       }
+
+       /**
+        * Clears internal log array and deprecation tracking
+        * @since 1.19
+        */
+       public static function clearLog() {
+               self::$log = array();
+               self::$deprecationWarnings = array();
+       }
+
+       /**
+        * Adds a warning entry to the log
+        *
+        * @since 1.19
+        * @param string $msg
+        * @param int $callerOffset
+        * @param int $level A PHP error level. See sendMessage()
+        * @param string $log 'production' will always trigger a php error, 'auto'
+        *    will trigger an error if $wgDevelopmentWarnings is true, and 'debug'
+        *    will only write to the debug log(s).
+        *
+        * @return mixed
+        */
+       public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE, $log = 'auto' ) {
+               global $wgDevelopmentWarnings;
+
+               if ( $log === 'auto' && !$wgDevelopmentWarnings ) {
+                       $log = 'debug';
+               }
+
+               if ( $log === 'debug' ) {
+                       $level = false;
+               }
+
+               $callerDescription = self::getCallerDescription( $callerOffset );
+
+               self::sendMessage( $msg, $callerDescription, 'warning', $level );
+
+               if ( self::$enabled ) {
+                       self::$log[] = array(
+                               'msg' => htmlspecialchars( $msg ),
+                               'type' => 'warn',
+                               'caller' => $callerDescription['func'],
+                       );
+               }
+       }
+
+       /**
+        * Show a warning that $function is deprecated.
+        * This will send it to the following locations:
+        * - Debug toolbar, with one item per function and caller, if $wgDebugToolbar
+        *   is set to true.
+        * - PHP's error log, with level E_USER_DEPRECATED, if $wgDevelopmentWarnings
+        *   is set to true.
+        * - MediaWiki's debug log, if $wgDevelopmentWarnings is set to false.
+        *
+        * @since 1.19
+        * @param string $function Function that is deprecated.
+        * @param string|bool $version Version in which the function was deprecated.
+        * @param string|bool $component Component to which the function belongs.
+        *    If false, it is assumbed the function is in MediaWiki core.
+        * @param int $callerOffset How far up the callstack is the original
+        *    caller. 2 = function that called the function that called
+        *    MWDebug::deprecated() (Added in 1.20).
+        * @return mixed
+        */
+       public static function deprecated( $function, $version = false,
+               $component = false, $callerOffset = 2
+       ) {
+               $callerDescription = self::getCallerDescription( $callerOffset );
+               $callerFunc = $callerDescription['func'];
+
+               $sendToLog = true;
+
+               // Check to see if there already was a warning about this function
+               if ( isset( self::$deprecationWarnings[$function][$callerFunc] ) ) {
+                       return;
+               } elseif ( isset( self::$deprecationWarnings[$function] ) ) {
+                       if ( self::$enabled ) {
+                               $sendToLog = false;
+                       } else {
+                               return;
+                       }
+               }
+
+               self::$deprecationWarnings[$function][$callerFunc] = true;
+
+               if ( $version ) {
+                       global $wgDeprecationReleaseLimit;
+                       if ( $wgDeprecationReleaseLimit && $component === false ) {
+                               # Strip -* off the end of $version so that branches can use the
+                               # format #.##-branchname to avoid issues if the branch is merged into
+                               # a version of MediaWiki later than what it was branched from
+                               $comparableVersion = preg_replace( '/-.*$/', '', $version );
+
+                               # If the comparableVersion is larger than our release limit then
+                               # skip the warning message for the deprecation
+                               if ( version_compare( $wgDeprecationReleaseLimit, $comparableVersion, '<' ) ) {
+                                       $sendToLog = false;
+                               }
+                       }
+
+                       $component = $component === false ? 'MediaWiki' : $component;
+                       $msg = "Use of $function was deprecated in $component $version.";
+               } else {
+                       $msg = "Use of $function is deprecated.";
+               }
+
+               if ( $sendToLog ) {
+                       global $wgDevelopmentWarnings; // we could have a more specific $wgDeprecationWarnings setting.
+                       self::sendMessage(
+                               $msg,
+                               $callerDescription,
+                               'deprecated',
+                               $wgDevelopmentWarnings ? E_USER_DEPRECATED : false
+                       );
+               }
+
+               if ( self::$enabled ) {
+                       $logMsg = htmlspecialchars( $msg ) .
+                               Html::rawElement( 'div', array( 'class' => 'mw-debug-backtrace' ),
+                                       Html::element( 'span', array(), 'Backtrace:' ) . wfBacktrace()
+                               );
+
+                       self::$log[] = array(
+                               'msg' => $logMsg,
+                               'type' => 'deprecated',
+                               'caller' => $callerFunc,
+                       );
+               }
+       }
+
+       /**
+        * Get an array describing the calling function at a specified offset.
+        *
+        * @param int $callerOffset How far up the callstack is the original
+        *    caller. 0 = function that called getCallerDescription()
+        * @return array Array with two keys: 'file' and 'func'
+        */
+       private static function getCallerDescription( $callerOffset ) {
+               $callers = wfDebugBacktrace();
+
+               if ( isset( $callers[$callerOffset] ) ) {
+                       $callerfile = $callers[$callerOffset];
+                       if ( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ) {
+                               $file = $callerfile['file'] . ' at line ' . $callerfile['line'];
+                       } else {
+                               $file = '(internal function)';
+                       }
+               } else {
+                       $file = '(unknown location)';
+               }
+
+               if ( isset( $callers[$callerOffset + 1] ) ) {
+                       $callerfunc = $callers[$callerOffset + 1];
+                       $func = '';
+                       if ( isset( $callerfunc['class'] ) ) {
+                               $func .= $callerfunc['class'] . '::';
+                       }
+                       if ( isset( $callerfunc['function'] ) ) {
+                               $func .= $callerfunc['function'];
+                       }
+               } else {
+                       $func = 'unknown';
+               }
+
+               return array( 'file' => $file, 'func' => $func );
+       }
+
+       /**
+        * Send a message to the debug log and optionally also trigger a PHP
+        * error, depending on the $level argument.
+        *
+        * @param string $msg Message to send
+        * @param array $caller Caller description get from getCallerDescription()
+        * @param string $group Log group on which to send the message
+        * @param int|bool $level Error level to use; set to false to not trigger an error
+        */
+       private static function sendMessage( $msg, $caller, $group, $level ) {
+               $msg .= ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
+
+               if ( $level !== false ) {
+                       trigger_error( $msg, $level );
+               }
+
+               wfDebugLog( $group, $msg, 'log' );
+       }
+
+       /**
+        * This is a method to pass messages from wfDebug to the pretty debugger.
+        * Do NOT use this method, use MWDebug::log or wfDebug()
+        *
+        * @since 1.19
+        * @param string $str
+        */
+       public static function debugMsg( $str ) {
+               global $wgDebugComments, $wgShowDebug;
+
+               if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
+                       self::$debug[] = rtrim( UtfNormal::cleanUp( $str ) );
+               }
+       }
+
+       /**
+        * Begins profiling on a database query
+        *
+        * @since 1.19
+        * @param string $sql
+        * @param string $function
+        * @param bool $isMaster
+        * @return int ID number of the query to pass to queryTime or -1 if the
+        *  debugger is disabled
+        */
+       public static function query( $sql, $function, $isMaster ) {
+               if ( !self::$enabled ) {
+                       return -1;
+               }
+
+               self::$query[] = array(
+                       'sql' => $sql,
+                       'function' => $function,
+                       'master' => (bool)$isMaster,
+                       'time' => 0.0,
+                       '_start' => microtime( true ),
+               );
+
+               return count( self::$query ) - 1;
+       }
+
+       /**
+        * Calculates how long a query took.
+        *
+        * @since 1.19
+        * @param int $id
+        */
+       public static function queryTime( $id ) {
+               if ( $id === -1 || !self::$enabled ) {
+                       return;
+               }
+
+               self::$query[$id]['time'] = microtime( true ) - self::$query[$id]['_start'];
+               unset( self::$query[$id]['_start'] );
+       }
+
+       /**
+        * Returns a list of files included, along with their size
+        *
+        * @param IContextSource $context
+        * @return array
+        */
+       protected static function getFilesIncluded( IContextSource $context ) {
+               $files = get_included_files();
+               $fileList = array();
+               foreach ( $files as $file ) {
+                       $size = filesize( $file );
+                       $fileList[] = array(
+                               'name' => $file,
+                               'size' => $context->getLanguage()->formatSize( $size ),
+                       );
+               }
+
+               return $fileList;
+       }
+
+       /**
+        * Returns the HTML to add to the page for the toolbar
+        *
+        * @since 1.19
+        * @param IContextSource $context
+        * @return string
+        */
+       public static function getDebugHTML( IContextSource $context ) {
+               global $wgDebugComments;
+
+               $html = '';
+
+               if ( self::$enabled ) {
+                       MWDebug::log( 'MWDebug output complete' );
+                       $debugInfo = self::getDebugInfo( $context );
+
+                       // Cannot use OutputPage::addJsConfigVars because those are already outputted
+                       // by the time this method is called.
+                       $html = Html::inlineScript(
+                               ResourceLoader::makeLoaderConditionalScript(
+                                       ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
+                               )
+                       );
+               }
+
+               if ( $wgDebugComments ) {
+                       $html .= "<!-- Debug output:\n" .
+                               htmlspecialchars( implode( "\n", self::$debug ) ) .
+                               "\n\n-->";
+               }
+
+               return $html;
+       }
+
+       /**
+        * Generate debug log in HTML for displaying at the bottom of the main
+        * content area.
+        * If $wgShowDebug is false, an empty string is always returned.
+        *
+        * @since 1.20
+        * @return string HTML fragment
+        */
+       public static function getHTMLDebugLog() {
+               global $wgDebugTimestamps, $wgShowDebug;
+
+               if ( !$wgShowDebug ) {
+                       return '';
+               }
+
+               $curIdent = 0;
+               $ret = "\n<hr />\n<strong>Debug data:</strong><ul id=\"mw-debug-html\">\n<li>";
+
+               foreach ( self::$debug as $line ) {
+                       $pre = '';
+                       if ( $wgDebugTimestamps ) {
+                               $matches = array();
+                               if ( preg_match( '/^(\d+\.\d+ {1,3}\d+.\dM\s{2})/', $line, $matches ) ) {
+                                       $pre = $matches[1];
+                                       $line = substr( $line, strlen( $pre ) );
+                               }
+                       }
+                       $display = ltrim( $line );
+                       $ident = strlen( $line ) - strlen( $display );
+                       $diff = $ident - $curIdent;
+
+                       $display = $pre . $display;
+                       if ( $display == '' ) {
+                               $display = "\xc2\xa0";
+                       }
+
+                       if ( !$ident
+                               && $diff < 0
+                               && substr( $display, 0, 9 ) != 'Entering '
+                               && substr( $display, 0, 8 ) != 'Exiting '
+                       ) {
+                               $ident = $curIdent;
+                               $diff = 0;
+                               $display = '<span style="background:yellow;">' .
+                                       nl2br( htmlspecialchars( $display ) ) . '</span>';
+                       } else {
+                               $display = nl2br( htmlspecialchars( $display ) );
+                       }
+
+                       if ( $diff < 0 ) {
+                               $ret .= str_repeat( "</li></ul>\n", -$diff ) . "</li><li>\n";
+                       } elseif ( $diff == 0 ) {
+                               $ret .= "</li><li>\n";
+                       } else {
+                               $ret .= str_repeat( "<ul><li>\n", $diff );
+                       }
+                       $ret .= "<code>$display</code>\n";
+
+                       $curIdent = $ident;
+               }
+
+               $ret .= str_repeat( '</li></ul>', $curIdent ) . "</li>\n</ul>\n";
+
+               return $ret;
+       }
+
+       /**
+        * Append the debug info to given ApiResult
+        *
+        * @param IContextSource $context
+        * @param ApiResult $result
+        */
+       public static function appendDebugInfoToApiResult( IContextSource $context, ApiResult $result ) {
+               if ( !self::$enabled ) {
+                       return;
+               }
+
+               // output errors as debug info, when display_errors is on
+               // this is necessary for all non html output of the api, because that clears all errors first
+               $obContents = ob_get_contents();
+               if ( $obContents ) {
+                       $obContentArray = explode( '<br />', $obContents );
+                       foreach ( $obContentArray as $obContent ) {
+                               if ( trim( $obContent ) ) {
+                                       self::debugMsg( Sanitizer::stripAllTags( $obContent ) );
+                               }
+                       }
+               }
+
+               MWDebug::log( 'MWDebug output complete' );
+               $debugInfo = self::getDebugInfo( $context );
+
+               $result->setIndexedTagName( $debugInfo, 'debuginfo' );
+               $result->setIndexedTagName( $debugInfo['log'], 'line' );
+               $result->setIndexedTagName( $debugInfo['debugLog'], 'msg' );
+               $result->setIndexedTagName( $debugInfo['queries'], 'query' );
+               $result->setIndexedTagName( $debugInfo['includes'], 'queries' );
+               $result->setIndexedTagName( $debugInfo['profile'], 'function' );
+               $result->addValue( null, 'debuginfo', $debugInfo );
+       }
+
+       /**
+        * Returns the HTML to add to the page for the toolbar
+        *
+        * @param IContextSource $context
+        * @return array
+        */
+       public static function getDebugInfo( IContextSource $context ) {
+               if ( !self::$enabled ) {
+                       return array();
+               }
+
+               global $wgVersion, $wgRequestTime;
+               $request = $context->getRequest();
+
+               // HHVM's reported memory usage from memory_get_peak_usage()
+               // is not useful when passing false, but we continue passing
+               // false for consistency of historical data in zend.
+               // see: https://github.com/facebook/hhvm/issues/2257#issuecomment-39362246
+               $realMemoryUsage = wfIsHHVM();
+
+               return array(
+                       'mwVersion' => $wgVersion,
+                       'phpVersion' => PHP_VERSION,
+                       'gitRevision' => GitInfo::headSHA1(),
+                       'gitBranch' => GitInfo::currentBranch(),
+                       'gitViewUrl' => GitInfo::headViewUrl(),
+                       'time' => microtime( true ) - $wgRequestTime,
+                       'log' => self::$log,
+                       'debugLog' => self::$debug,
+                       'queries' => self::$query,
+                       'request' => array(
+                               'method' => $request->getMethod(),
+                               'url' => $request->getRequestURL(),
+                               'headers' => $request->getAllHeaders(),
+                               'params' => $request->getValues(),
+                       ),
+                       'memory' => $context->getLanguage()->formatSize( memory_get_usage( $realMemoryUsage ) ),
+                       'memoryPeak' => $context->getLanguage()->formatSize( memory_get_peak_usage( $realMemoryUsage ) ),
+                       'includes' => self::getFilesIncluded( $context ),
+                       'profile' => Profiler::instance()->getRawData(),
+               );
+       }
+}
index 1a3e7ae..eb16d0d 100644 (file)
@@ -61,7 +61,6 @@
        "config-env-good": "Środowisko oprogramowania zostało sprawdzone.\nMożesz teraz zainstalować MediaWiki.",
        "config-env-bad": "Środowisko oprogramowania zostało sprawdzone.\nNie możesz zainstalować MediaWiki.",
        "config-env-php": "Zainstalowane jest PHP w wersji $1.",
-       "config-env-php-toolow": "Zainstalowane jest PHP $1.\nJednak MediaWiki wymaga PHP $2 lub nowszego.",
        "config-unicode-using-utf8": "Korzystanie z normalizacji Unicode utf8_normalize.so napisanej przez Brion Vibbera.",
        "config-unicode-using-intl": "Korzystanie z [http://pecl.php.net/intl rozszerzenia intl PECL] do normalizacji Unicode.",
        "config-unicode-pure-php-warning": "'''Uwaga!''' [http://pecl.php.net/intl Rozszerzenie intl PECL] do obsługi normalizacji Unicode nie jest dostępne. Użyta zostanie mało wydajna zwykła implementacja w PHP.\nJeśli prowadzisz stronę o dużym natężeniu ruchu, powinieneś zapoznać się z informacjami o [//www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations normalizacji Unicode].",
@@ -69,7 +68,7 @@
        "config-no-db": "Nie można odnaleźć właściwego sterownika bazy danych! Musisz zainstalować sterownik bazy danych dla PHP.\nMożna użyć następujących typów baz danych: $1.\n\nJeśli skompilowałeś PHP samodzielnie, skonfiguruj je ponownie z włączonym klientem bazy danych, na przykład za pomocą polecenia <code>./configure --with-mysqli</code>.\nJeśli zainstalowałeś PHP jako pakiet Debiana lub Ubuntu, musisz również zainstalować np. moduł <code>php5-mysql</code>.",
        "config-outdated-sqlite": "'''Ostrzeżenie''': masz SQLite  $1, która jest niższa od minimalnej wymaganej wersji  $2 . SQLite będzie niedostępne.",
        "config-no-fts3": "'''Uwaga''' – SQLite został skompilowany bez [//sqlite.org/fts3.html modułu FTS3] – funkcje wyszukiwania nie będą dostępne.",
-       "config-register-globals": "'''Uwaga –  w konfiguracji PHP włączona jest opcja <code>[http://php.net/register_globals register_globals]</code>.'''\n'''Jeśli możesz, wyłącz ją.'''\nMediaWiki będzie działać, ale Twój serwer może być narażony potencjalnymi lukami w zabezpieczeniach.",
+       "config-register-globals-error": "<strong>Błąd: dyrektywa PHP <code>[http://php.net/register_globals register_globals]</code> jest włączona.\nAby kontynuować instalację musi zostać wyłączona.</strong>\nPrzeczytaj [https://www.mediawiki.org/wiki/register_globals https://www.mediawiki.org/wiki/register_globals], aby dowiedzieć się, jak to zrobić.",
        "config-magic-quotes-runtime": "'''Błąd krytyczny – włączono [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime magic_quotes_runtime]!'''\nTa opcja powoduje nieprzewidywalne uszkodzenia wprowadzanych danych.\nZainstalować lub korzystać z MediaWiki można pod warunkiem, że ta opcja jest wyłączona.",
        "config-magic-quotes-sybase": "'''Błąd krytyczny – włączono [http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-sybase magic_quotes_sybase]!'''\nTa opcja powoduje nieprzewidywalne uszkodzenia wprowadzanych danych.\nZainstalować lub korzystać z MediaWiki można pod warunkiem, że ta opcja jest wyłączona.",
        "config-mbstring": "'''Błąd krytyczny – włączono [http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload mbstring.func_overload]!'''\nTa opcja powoduje błędy i może wywołać nieprzewidywalne uszkodzenia wprowadzanych danych.\nZainstalować lub korzystać z MediaWiki można pod warunkiem, że ta opcja jest wyłączona.",
diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php
new file mode 100644 (file)
index 0000000..f7fe5a8
--- /dev/null
@@ -0,0 +1,289 @@
+<?php
+/**
+ * HTML validation and correction
+ *
+ * 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
+ * @ingroup Parser
+ */
+
+/**
+ * Class used to hide mw:editsection tokens from Tidy so that it doesn't break them
+ * or break on them. This is a bit of a hack for now, but hopefully in the future
+ * we may create a real postprocessor or something that will replace this.
+ * It's called wrapper because for now it basically takes over MWTidy::tidy's task
+ * of wrapping the text in a xhtml block
+ *
+ * This re-uses some of the parser's UNIQ tricks, though some of it is private so it's
+ * duplicated. Perhaps we should create an abstract marker hiding class.
+ *
+ * @ingroup Parser
+ */
+class MWTidyWrapper {
+
+       /**
+        * @var ReplacementArray
+        */
+       protected $mTokens;
+
+       protected $mUniqPrefix;
+
+       protected $mMarkerIndex;
+
+       public function __construct() {
+               $this->mTokens = null;
+               $this->mUniqPrefix = null;
+       }
+
+       /**
+        * @param string $text
+        * @return string
+        */
+       public function getWrapped( $text ) {
+               $this->mTokens = new ReplacementArray;
+               $this->mUniqPrefix = "\x7fUNIQ" .
+                       dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) );
+               $this->mMarkerIndex = 0;
+
+               // Replace <mw:editsection> elements with placeholders
+               $wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
+                       array( &$this, 'replaceCallback' ), $text );
+               // ...and <mw:toc> markers
+               $wrappedtext = preg_replace_callback( '/\<\\/?mw:toc\>/',
+                       array( &$this, 'replaceCallback' ), $wrappedtext );
+
+               // Modify inline Microdata <link> and <meta> elements so they say <html-link> and <html-meta> so
+               // we can trick Tidy into not stripping them out by including them in tidy's new-empty-tags config
+               $wrappedtext = preg_replace( '!<(link|meta)([^>]*?)(/{0,1}>)!', '<html-$1$2$3', $wrappedtext );
+
+               // Wrap the whole thing in a doctype and body for Tidy.
+               $wrappedtext = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' .
+                       ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>' .
+                       '<head><title>test</title></head><body>' . $wrappedtext . '</body></html>';
+
+               return $wrappedtext;
+       }
+
+       /**
+        * @param array $m
+        *
+        * @return string
+        */
+       function replaceCallback( $m ) {
+               $marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
+               $this->mMarkerIndex++;
+               $this->mTokens->setPair( $marker, $m[0] );
+               return $marker;
+       }
+
+       /**
+        * @param string $text
+        * @return string
+        */
+       public function postprocess( $text ) {
+               // Revert <html-{link,meta}> back to <{link,meta}>
+               $text = preg_replace( '!<html-(link|meta)([^>]*?)(/{0,1}>)!', '<$1$2$3', $text );
+
+               // Restore the contents of placeholder tokens
+               $text = $this->mTokens->replace( $text );
+
+               return $text;
+       }
+
+}
+
+/**
+ * Class to interact with HTML tidy
+ *
+ * Either the external tidy program or the in-process tidy extension
+ * will be used depending on availability. Override the default
+ * $wgTidyInternal setting to disable the internal if it's not working.
+ *
+ * @ingroup Parser
+ */
+class MWTidy {
+       /**
+        * Interface with html tidy, used if $wgUseTidy = true.
+        * If tidy isn't able to correct the markup, the original will be
+        * returned in all its glory with a warning comment appended.
+        *
+        * @param string $text Hideous HTML input
+        * @return string Corrected HTML output
+        */
+       public static function tidy( $text ) {
+               global $wgTidyInternal;
+
+               $wrapper = new MWTidyWrapper;
+               $wrappedtext = $wrapper->getWrapped( $text );
+
+               $retVal = null;
+               if ( $wgTidyInternal ) {
+                       $correctedtext = self::execInternalTidy( $wrappedtext, false, $retVal );
+               } else {
+                       $correctedtext = self::execExternalTidy( $wrappedtext, false, $retVal );
+               }
+
+               if ( $retVal < 0 ) {
+                       wfDebug( "Possible tidy configuration error!\n" );
+                       return $text . "\n<!-- Tidy was unable to run -->\n";
+               } elseif ( is_null( $correctedtext ) ) {
+                       wfDebug( "Tidy error detected!\n" );
+                       return $text . "\n<!-- Tidy found serious XHTML errors -->\n";
+               }
+
+               $correctedtext = $wrapper->postprocess( $correctedtext ); // restore any hidden tokens
+
+               return $correctedtext;
+       }
+
+       /**
+        * Check HTML for errors, used if $wgValidateAllHtml = true.
+        *
+        * @param string $text
+        * @param string &$errorStr Return the error string
+        * @return bool Whether the HTML is valid
+        */
+       public static function checkErrors( $text, &$errorStr = null ) {
+               global $wgTidyInternal;
+
+               $retval = 0;
+               if ( $wgTidyInternal ) {
+                       $errorStr = self::execInternalTidy( $text, true, $retval );
+               } else {
+                       $errorStr = self::execExternalTidy( $text, true, $retval );
+               }
+
+               return ( $retval < 0 && $errorStr == '' ) || $retval == 0;
+       }
+
+       /**
+        * Spawn an external HTML tidy process and get corrected markup back from it.
+        * Also called in OutputHandler.php for full page validation
+        *
+        * @param string $text HTML to check
+        * @param bool $stderr Whether to read result from STDERR rather than STDOUT
+        * @param int &$retval Exit code (-1 on internal error)
+        * @return string|null
+        */
+       private static function execExternalTidy( $text, $stderr = false, &$retval = null ) {
+               global $wgTidyConf, $wgTidyBin, $wgTidyOpts;
+               wfProfileIn( __METHOD__ );
+
+               $cleansource = '';
+               $opts = ' -utf8';
+
+               if ( $stderr ) {
+                       $descriptorspec = array(
+                               0 => array( 'pipe', 'r' ),
+                               1 => array( 'file', wfGetNull(), 'a' ),
+                               2 => array( 'pipe', 'w' )
+                       );
+               } else {
+                       $descriptorspec = array(
+                               0 => array( 'pipe', 'r' ),
+                               1 => array( 'pipe', 'w' ),
+                               2 => array( 'file', wfGetNull(), 'a' )
+                       );
+               }
+
+               $readpipe = $stderr ? 2 : 1;
+               $pipes = array();
+
+               $process = proc_open(
+                       "$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes );
+
+               //NOTE: At least on linux, the process will be created even if tidy is not installed.
+               //      This means that missing tidy will be treated as a validation failure.
+
+               if ( is_resource( $process ) ) {
+                       // Theoretically, this style of communication could cause a deadlock
+                       // here. If the stdout buffer fills up, then writes to stdin could
+                       // block. This doesn't appear to happen with tidy, because tidy only
+                       // writes to stdout after it's finished reading from stdin. Search
+                       // for tidyParseStdin and tidySaveStdout in console/tidy.c
+                       fwrite( $pipes[0], $text );
+                       fclose( $pipes[0] );
+                       while ( !feof( $pipes[$readpipe] ) ) {
+                               $cleansource .= fgets( $pipes[$readpipe], 1024 );
+                       }
+                       fclose( $pipes[$readpipe] );
+                       $retval = proc_close( $process );
+               } else {
+                       wfWarn( "Unable to start external tidy process" );
+                       $retval = -1;
+               }
+
+               if ( !$stderr && $cleansource == '' && $text != '' ) {
+                       // Some kind of error happened, so we couldn't get the corrected text.
+                       // Just give up; we'll use the source text and append a warning.
+                       $cleansource = null;
+               }
+
+               wfProfileOut( __METHOD__ );
+               return $cleansource;
+       }
+
+       /**
+        * Use the HTML tidy extension to use the tidy library in-process,
+        * saving the overhead of spawning a new process.
+        *
+        * @param string $text HTML to check
+        * @param bool $stderr Whether to read result from error status instead of output
+        * @param int &$retval Exit code (-1 on internal error)
+        * @return string|null
+        */
+       private static function execInternalTidy( $text, $stderr = false, &$retval = null ) {
+               global $wgTidyConf, $wgDebugTidy;
+               wfProfileIn( __METHOD__ );
+
+               if ( !class_exists( 'tidy' ) ) {
+                       wfWarn( "Unable to load internal tidy class." );
+                       $retval = -1;
+
+                       wfProfileOut( __METHOD__ );
+                       return null;
+               }
+
+               $tidy = new tidy;
+               $tidy->parseString( $text, $wgTidyConf, 'utf8' );
+
+               if ( $stderr ) {
+                       $retval = $tidy->getStatus();
+
+                       wfProfileOut( __METHOD__ );
+                       return $tidy->errorBuffer;
+               }
+
+               $tidy->cleanRepair();
+               $retval = $tidy->getStatus();
+               if ( $retval == 2 ) {
+                       // 2 is magic number for fatal error
+                       // http://www.php.net/manual/en/function.tidy-get-status.php
+                       $cleansource = null;
+               } else {
+                       $cleansource = tidy_get_output( $tidy );
+                       if ( $wgDebugTidy && $retval > 0 ) {
+                               $cleansource .= "<!--\nTidy reports:\n" .
+                                       str_replace( '-->', '--&gt;', $tidy->errorBuffer ) .
+                                       "\n-->";
+                       }
+               }
+
+               wfProfileOut( __METHOD__ );
+               return $cleansource;
+       }
+}
diff --git a/includes/parser/Tidy.php b/includes/parser/Tidy.php
deleted file mode 100644 (file)
index f7fe5a8..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-<?php
-/**
- * HTML validation and correction
- *
- * 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
- * @ingroup Parser
- */
-
-/**
- * Class used to hide mw:editsection tokens from Tidy so that it doesn't break them
- * or break on them. This is a bit of a hack for now, but hopefully in the future
- * we may create a real postprocessor or something that will replace this.
- * It's called wrapper because for now it basically takes over MWTidy::tidy's task
- * of wrapping the text in a xhtml block
- *
- * This re-uses some of the parser's UNIQ tricks, though some of it is private so it's
- * duplicated. Perhaps we should create an abstract marker hiding class.
- *
- * @ingroup Parser
- */
-class MWTidyWrapper {
-
-       /**
-        * @var ReplacementArray
-        */
-       protected $mTokens;
-
-       protected $mUniqPrefix;
-
-       protected $mMarkerIndex;
-
-       public function __construct() {
-               $this->mTokens = null;
-               $this->mUniqPrefix = null;
-       }
-
-       /**
-        * @param string $text
-        * @return string
-        */
-       public function getWrapped( $text ) {
-               $this->mTokens = new ReplacementArray;
-               $this->mUniqPrefix = "\x7fUNIQ" .
-                       dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) );
-               $this->mMarkerIndex = 0;
-
-               // Replace <mw:editsection> elements with placeholders
-               $wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
-                       array( &$this, 'replaceCallback' ), $text );
-               // ...and <mw:toc> markers
-               $wrappedtext = preg_replace_callback( '/\<\\/?mw:toc\>/',
-                       array( &$this, 'replaceCallback' ), $wrappedtext );
-
-               // Modify inline Microdata <link> and <meta> elements so they say <html-link> and <html-meta> so
-               // we can trick Tidy into not stripping them out by including them in tidy's new-empty-tags config
-               $wrappedtext = preg_replace( '!<(link|meta)([^>]*?)(/{0,1}>)!', '<html-$1$2$3', $wrappedtext );
-
-               // Wrap the whole thing in a doctype and body for Tidy.
-               $wrappedtext = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' .
-                       ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>' .
-                       '<head><title>test</title></head><body>' . $wrappedtext . '</body></html>';
-
-               return $wrappedtext;
-       }
-
-       /**
-        * @param array $m
-        *
-        * @return string
-        */
-       function replaceCallback( $m ) {
-               $marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
-               $this->mMarkerIndex++;
-               $this->mTokens->setPair( $marker, $m[0] );
-               return $marker;
-       }
-
-       /**
-        * @param string $text
-        * @return string
-        */
-       public function postprocess( $text ) {
-               // Revert <html-{link,meta}> back to <{link,meta}>
-               $text = preg_replace( '!<html-(link|meta)([^>]*?)(/{0,1}>)!', '<$1$2$3', $text );
-
-               // Restore the contents of placeholder tokens
-               $text = $this->mTokens->replace( $text );
-
-               return $text;
-       }
-
-}
-
-/**
- * Class to interact with HTML tidy
- *
- * Either the external tidy program or the in-process tidy extension
- * will be used depending on availability. Override the default
- * $wgTidyInternal setting to disable the internal if it's not working.
- *
- * @ingroup Parser
- */
-class MWTidy {
-       /**
-        * Interface with html tidy, used if $wgUseTidy = true.
-        * If tidy isn't able to correct the markup, the original will be
-        * returned in all its glory with a warning comment appended.
-        *
-        * @param string $text Hideous HTML input
-        * @return string Corrected HTML output
-        */
-       public static function tidy( $text ) {
-               global $wgTidyInternal;
-
-               $wrapper = new MWTidyWrapper;
-               $wrappedtext = $wrapper->getWrapped( $text );
-
-               $retVal = null;
-               if ( $wgTidyInternal ) {
-                       $correctedtext = self::execInternalTidy( $wrappedtext, false, $retVal );
-               } else {
-                       $correctedtext = self::execExternalTidy( $wrappedtext, false, $retVal );
-               }
-
-               if ( $retVal < 0 ) {
-                       wfDebug( "Possible tidy configuration error!\n" );
-                       return $text . "\n<!-- Tidy was unable to run -->\n";
-               } elseif ( is_null( $correctedtext ) ) {
-                       wfDebug( "Tidy error detected!\n" );
-                       return $text . "\n<!-- Tidy found serious XHTML errors -->\n";
-               }
-
-               $correctedtext = $wrapper->postprocess( $correctedtext ); // restore any hidden tokens
-
-               return $correctedtext;
-       }
-
-       /**
-        * Check HTML for errors, used if $wgValidateAllHtml = true.
-        *
-        * @param string $text
-        * @param string &$errorStr Return the error string
-        * @return bool Whether the HTML is valid
-        */
-       public static function checkErrors( $text, &$errorStr = null ) {
-               global $wgTidyInternal;
-
-               $retval = 0;
-               if ( $wgTidyInternal ) {
-                       $errorStr = self::execInternalTidy( $text, true, $retval );
-               } else {
-                       $errorStr = self::execExternalTidy( $text, true, $retval );
-               }
-
-               return ( $retval < 0 && $errorStr == '' ) || $retval == 0;
-       }
-
-       /**
-        * Spawn an external HTML tidy process and get corrected markup back from it.
-        * Also called in OutputHandler.php for full page validation
-        *
-        * @param string $text HTML to check
-        * @param bool $stderr Whether to read result from STDERR rather than STDOUT
-        * @param int &$retval Exit code (-1 on internal error)
-        * @return string|null
-        */
-       private static function execExternalTidy( $text, $stderr = false, &$retval = null ) {
-               global $wgTidyConf, $wgTidyBin, $wgTidyOpts;
-               wfProfileIn( __METHOD__ );
-
-               $cleansource = '';
-               $opts = ' -utf8';
-
-               if ( $stderr ) {
-                       $descriptorspec = array(
-                               0 => array( 'pipe', 'r' ),
-                               1 => array( 'file', wfGetNull(), 'a' ),
-                               2 => array( 'pipe', 'w' )
-                       );
-               } else {
-                       $descriptorspec = array(
-                               0 => array( 'pipe', 'r' ),
-                               1 => array( 'pipe', 'w' ),
-                               2 => array( 'file', wfGetNull(), 'a' )
-                       );
-               }
-
-               $readpipe = $stderr ? 2 : 1;
-               $pipes = array();
-
-               $process = proc_open(
-                       "$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes );
-
-               //NOTE: At least on linux, the process will be created even if tidy is not installed.
-               //      This means that missing tidy will be treated as a validation failure.
-
-               if ( is_resource( $process ) ) {
-                       // Theoretically, this style of communication could cause a deadlock
-                       // here. If the stdout buffer fills up, then writes to stdin could
-                       // block. This doesn't appear to happen with tidy, because tidy only
-                       // writes to stdout after it's finished reading from stdin. Search
-                       // for tidyParseStdin and tidySaveStdout in console/tidy.c
-                       fwrite( $pipes[0], $text );
-                       fclose( $pipes[0] );
-                       while ( !feof( $pipes[$readpipe] ) ) {
-                               $cleansource .= fgets( $pipes[$readpipe], 1024 );
-                       }
-                       fclose( $pipes[$readpipe] );
-                       $retval = proc_close( $process );
-               } else {
-                       wfWarn( "Unable to start external tidy process" );
-                       $retval = -1;
-               }
-
-               if ( !$stderr && $cleansource == '' && $text != '' ) {
-                       // Some kind of error happened, so we couldn't get the corrected text.
-                       // Just give up; we'll use the source text and append a warning.
-                       $cleansource = null;
-               }
-
-               wfProfileOut( __METHOD__ );
-               return $cleansource;
-       }
-
-       /**
-        * Use the HTML tidy extension to use the tidy library in-process,
-        * saving the overhead of spawning a new process.
-        *
-        * @param string $text HTML to check
-        * @param bool $stderr Whether to read result from error status instead of output
-        * @param int &$retval Exit code (-1 on internal error)
-        * @return string|null
-        */
-       private static function execInternalTidy( $text, $stderr = false, &$retval = null ) {
-               global $wgTidyConf, $wgDebugTidy;
-               wfProfileIn( __METHOD__ );
-
-               if ( !class_exists( 'tidy' ) ) {
-                       wfWarn( "Unable to load internal tidy class." );
-                       $retval = -1;
-
-                       wfProfileOut( __METHOD__ );
-                       return null;
-               }
-
-               $tidy = new tidy;
-               $tidy->parseString( $text, $wgTidyConf, 'utf8' );
-
-               if ( $stderr ) {
-                       $retval = $tidy->getStatus();
-
-                       wfProfileOut( __METHOD__ );
-                       return $tidy->errorBuffer;
-               }
-
-               $tidy->cleanRepair();
-               $retval = $tidy->getStatus();
-               if ( $retval == 2 ) {
-                       // 2 is magic number for fatal error
-                       // http://www.php.net/manual/en/function.tidy-get-status.php
-                       $cleansource = null;
-               } else {
-                       $cleansource = tidy_get_output( $tidy );
-                       if ( $wgDebugTidy && $retval > 0 ) {
-                               $cleansource .= "<!--\nTidy reports:\n" .
-                                       str_replace( '-->', '--&gt;', $tidy->errorBuffer ) .
-                                       "\n-->";
-                       }
-               }
-
-               wfProfileOut( __METHOD__ );
-               return $cleansource;
-       }
-}
index e7a09d7..8a08fd1 100644 (file)
@@ -885,6 +885,45 @@ class RevDelArchivedFileItem extends RevDelFileItem {
                }
                return $link;
        }
+
+       public function getApiData( ApiResult $result ) {
+               $file = $this->file;
+               $user = $this->list->getUser();
+               $ret = array(
+                       'title' => $this->list->title->getPrefixedText(),
+                       'timestamp' => wfTimestamp( TS_ISO_8601, $file->getTimestamp() ),
+                       'width' => $file->getWidth(),
+                       'height' => $file->getHeight(),
+                       'size' => $file->getSize(),
+               );
+               $ret += $file->isDeleted( Revision::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
+               $ret += $file->isDeleted( Revision::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
+               $ret += $this->isDeleted() ? array( 'contenthidden' => '' ) : array();
+               if ( $this->canViewContent() ) {
+                       $ret += array(
+                               'url' => SpecialPage::getTitleFor( 'Revisiondelete' )->getLinkURL(
+                                       array(
+                                               'target' => $this->list->title->getPrefixedText(),
+                                               'file' => $file->getKey(),
+                                               'token' => $user->getEditToken( $file->getKey() )
+                                       ),
+                                       false, PROTO_RELATIVE
+                               ),
+                       );
+               }
+               if ( $file->userCan( Revision::DELETED_USER, $user ) ) {
+                       $ret += array(
+                               'userid' => $file->getUser( 'id' ),
+                               'user' => $file->getUser( 'text' ),
+                       );
+               }
+               if ( $file->userCan( Revision::DELETED_COMMENT, $user ) ) {
+                       $ret += array(
+                               'comment' => $file->getRawDescription(),
+                       );
+               }
+               return $ret;
+       }
 }
 
 /**
index a857da4..28ad0f4 100644 (file)
@@ -650,6 +650,7 @@ class SpecialVersion extends SpecialPage {
 
                if ( isset( $extension['path'] ) ) {
                        global $IP;
+                       $extensionPath = dirname( $extension['path'] );
                        if ( $this->coreId == '' ) {
                                wfDebug( 'Looking up core head id' );
                                $coreHeadSHA1 = self::getGitHeadSha1( $IP );
@@ -668,7 +669,6 @@ class SpecialVersion extends SpecialPage {
 
                        if ( !$vcsVersion ) {
                                wfDebug( "Getting VCS info for extension $extensionName" );
-                               $extensionPath = dirname( $extension['path'] );
                                $gitInfo = new GitInfo( $extensionPath );
                                $vcsVersion = $gitInfo->getHeadSHA1();
                                if ( $vcsVersion !== false ) {
index c1885cf..e8e48ab 100644 (file)
        "tog-hideminor": "خبي الكتيبات الصغيرة في التبديلات التوالا",
        "tog-hidepatrolled": "خبي الكتيبات المعسوسه في التبديلات التوالا",
        "tog-newpageshidepatrolled": "خبي الباجات المعسوسه اللي في ليستت الباجات الجدد",
-       "tog-extendwatchlist": "دÙ\84Ù\8a Ø§Ù\84Ù\84Ù\8aستÙ\87 Ù\86تاع Ø§Ù\84تبÙ\8aعÙ\87 Ø¨Ø§Ø´ ØªØ¹Ø±Ø¶ Ù\83اÙ\85Ù\84 Ø§Ù\84تبدÙ\8aÙ\84ات Ù\88 Ù\85Ø´Ù\8a Ø¨Ø±Ù\83 التوالا",
-       "tog-usenewrc": "اجÙ\85ع Ø§Ù\84Ù\80تبداÙ\84ات Ø¨Ù\84 ØµÙ\81حات Ù\81Ù\84 ØªØ¨Ø¯Ø§Ù\84ات Ø§Ù\84Ù\80تاÙ\84Ù\8aØ© Ù\88 Ø§Ù\84Ù\80Ù\84Ù\8aستة ØªØ§Ø¹ Ø§Ù\84Ù\80Ù\85راÙ\82بة (تستحÙ\82 Ø§Ù\84Ù\80 JavaScript)",
+       "tog-extendwatchlist": "دÙ\84Ù\91Ù\8a Ø§Ù\84Ù\84Ù\8aستة ØªØ§Ø¹ Ø§Ù\84تتباع Ø¨Ø§Ø´ ØªÙ\88رÙ\91Ù\8a Ù\83اÙ\85Ù\84 Ø§Ù\84تبدÙ\8aÙ\84اتØ\8c Ù\85اشÙ\8a Ø¨Ø±Ù\83 ØºÙ\8aر التوالا",
+       "tog-usenewrc": "جÙ\85Ù\91ع Ø§Ù\84Ù\80تبداÙ\84ات Ø¨Ù\84 ØµÙ\81حة Ù\81Ù\84 ØªØ¨Ø¯Ø§Ù\84ات Ø§Ù\84Ù\80جدÙ\8aدة Ù\88 Ø§Ù\84Ù\80Ù\84Ù\8aستة ØªØ§Ø¹ Ø§Ù\84Ù\80عسÙ\91Ø©",
        "tog-numberheadings": "رقم اليا عناوين السكسيو",
-       "tog-showtoolbar": "تبÙ\8aاÙ\86 Ø¨Ø§Ø±Ù\87 Ø§Ù\84Ù\83تÙ\8aبات (Ù\8aÙ\84زÙ\85Ù\87ا Ø¬Ø§Ù\81اسÙ\83رÙ\8aبت)",
-       "tog-editondblclick": "كتيبت الباجات بالزوج دركات (يلزمها جافاسكربت)",
-       "tog-editsectiononrightclick": "اÙ\83تÙ\8aÙ\81Ù\8a Ù\83تÙ\8aبت Ø§Ù\84سÙ\83سÙ\8aÙ\88ات Ø¨Ø§Ù\84درÙ\8aÙ\83 Ø¨Ø§Ù\84Ù\8aÙ\85Ù\8aÙ\86 Ø¹Ù\84Ù\89 Ø§Ù\84عÙ\86اÙ\88Ù\8aÙ\86 Ù\86تاعÙ\87Ù\85\8aتطÙ\84ب Ø¬Ø§Ù\81اسÙ\83رÙ\8aبت)",
+       "tog-showtoolbar": "بÙ\8aÙ\91Ù\86 Ø§Ù\84بارÙ\91Ø© ØªØ§Ø¹ Ø¯Ù\88زاÙ\86â\80\98 Ø§Ù\84Ù\83تبة",
+       "tog-editondblclick": "آكتيفي التبدال تاع الباجات بل زوج ضركات تاع الفارة",
+       "tog-editsectiononrightclick": "Ø¢Ù\83تÙ\8aÙ\81Ù\8a Ø§Ù\84تبداÙ\84 ØªØ§Ø¹ Ø§Ù\84سÙ\83سÙ\8aÙ\88Ù\91ات Ø¨Ù\84 Ø¶Ø±Ù\8aÙ\83 Ø¨Ù\84 Ù\84Ù\8aÙ\85Ù\86Ø© Ø¹Ù\84Ù\89 Ø§Ù\84عÙ\84اÙ\88Ù\8aÙ\86 Ù\86تاعÙ\87Ù\85",
        "tog-watchcreations": "زيد الـصفحات اللي نخلقها و الـفيشيّات فل قايمة تاع التتباع تاعي",
        "tog-watchdefault": "زيد الـصفحات و الـفيشيّات اللي نبدّلها فل قايمة تاع الـتتباع تاعي",
        "tog-watchmoves": "زيد الـصفحات و الـفيشيات اللي نحوّلها فل قايمة تاع الـتباع تاعي",
        "tog-watchdeletion": "زيد الـصفحات اللي نفصيها فل قايمة تاع التتباع تاعي",
        "tog-minordefault": "ماركي كل التبديلات بلي راهي خفيفه",
-       "tog-previewontop": "Ù\88رÙ\8a Ø´Ù\88Ù\81Ù\87\82بÙ\84Ù\8aÙ\87 Ù\84Ù\84Ù\83تبÙ\87 Ù\81Ù\88Ù\82 ØµÙ\86دÙ\88Ù\82 Ø§Ù\84Ù\83تÙ\8aبÙ\87",
+       "tog-previewontop": "Ù\88رÙ\91Ù\8a Ù\86ضرة Ù\82بÙ\84Ù\8aÙ\91Ø© ØªØ§Ø¹ Ù\88اش Ù\8aصراØ\8c Ù\81Ù\88Ù\82 Ø§Ù\84جÙ\8aÙ\87Ø© ØªØ§Ø¹ Ø§Ù\84تبداÙ\84",
        "tog-previewonfirst": "بين شوفه-قبليه مع اول تبديله",
        "tog-enotifwatchlistpages": "ابحت لي إيمال كي تتبدّل صفحة ولا فيشي من الـليستة تاع الـتتباع تاعي",
        "tog-enotifusertalkpages": "ابعثلي بريه كل ما تبدلت باجت نقاش ديالي",
@@ -30,7 +30,7 @@
        "tog-shownumberswatching": "بين شحال كاين من مستعمل يتبع الباجه",
        "tog-oldsig": "خطّ‘لـيدّ اللي كاين",
        "tog-fancysig": "اعتبر التوقيع كي كتيبه ويكي (بلا وصيله توماتيك)",
-       "tog-uselivepreview": "استعمل الـنضرة الـقبلانيّة (تستحق الـ JavaScript) (تجرابيّة)",
+       "tog-uselivepreview": "استعمل الـنضرة الـقبلانيّة الحيّة (عفسة تجرابيّة، تخلّيك تشوف التبدال الّي يصرا فل وقت الّي تكون تكتب)",
        "tog-forceeditsummary": "نبّهني كي تندخل كاش صفحة خاوية",
        "tog-watchlisthideown": "خبّي الـتبدالات تاوعي فل ليستة تاع الـتتباع",
        "tog-watchlisthidebots": "خبّي الـتبدالات تاع الـروبويات فل ليستة تاع التتباع تاعي",
        "newwindow": "(حل في تاقة جديدة)",
        "cancel": "انيلي",
        "moredotdotdot": "كتر...",
-       "morenotlisted": "Ù\83تر Ù\85اشÙ\8a Ù\85Ù\84Ù\8aستÙ\8a...",
+       "morenotlisted": "Ù\87اد Ø§Ù\84Ù\84Ù\8aستة Ù\85ا Ø±Ø§Ù\87Ù\8aØ´ Ù\85Ù\83Ù\85Ù\88Ù\84Ø©",
        "mypage": "باجه",
        "mytalk": "نقاش",
        "anontalk": "تناقش على الـ ip هادي",
        "qbmyoptions": "الباجات نتاوعى",
        "faq": "المسقسية المتعاوده",
        "faqpage": "Project:سؤالات متكرره",
-       "vector-action-addsection": "زيد موضوع",
-       "vector-action-delete": "امحي",
-       "vector-action-move": "حول",
-       "vector-action-protect": "بروجي",
-       "vector-action-undelete": "ردّ كيما كان",
-       "vector-action-unprotect": "بدّل الـحماية",
-       "vector-view-create": "أصنع",
-       "vector-view-edit": "بدل",
-       "vector-view-history": "روح للتاريخي",
-       "vector-view-view": "أقرى",
-       "vector-view-viewsource": "شوف المصدر",
        "actions": "أفعال",
        "namespaces": "بلاصه تع أسموات",
        "variants": "متغيرات",
        "history": "تاريخ الملف",
        "history_short": "تاريخ",
        "updatedmarker": "مبدّل منلي الزيارة تاعي الـتالية",
-       "printableversion": "نسخه نتاع طبيع",
+       "printableversion": "نسخة تاع طبيع",
        "permalink": "وصيل دايم",
        "print": "امبريمي",
        "view": "اقرا",
+       "view-foreign": "شوف على $1",
        "edit": "بدل",
+       "edit-local": "عدّل التوصاف المبلّد",
        "create": "أصنع",
+       "create-local": "زيد توصاف مبلّد",
        "editthispage": "بدّل هاد الـصفحة",
        "create-this-page": "خلّق صفحة ب هاد الـعلوان",
        "delete": "امحي",
        "deletethispage": "امحي هاد الـصفحة",
        "undeletethispage": "ردّ الصفحة الّي محيتها",
+       "undelete_short": "رجّع {{PLURAL:$1||تعديل واحد|$1 تعديل}}",
+       "viewdeleted_short": "شوف {{PLURAL:$1||تعديل واحد|$1 تعديل}}",
        "protect": "حمايه",
        "protect_change": "بدل",
+       "protectthispage": "بروتيجي هاد الباجة",
+       "unprotect": "بدّل الحضية",
+       "unprotectthispage": "بدّل الحضية تاع هاد الباجة",
        "newpage": "باجه جديده",
+       "talkpage": "قرعَج على هاد الباجة",
        "talkpagelinktext": "ناقش",
+       "specialpage": "باجة خوصوصيّة",
        "personaltools": "ادوالت شخصيه",
+       "articlepage": "شوف الباجة تاع المحتاوا",
        "talk": "مناقشه",
        "views": "شوفات",
-       "toolbox": "صندوق الادوات",
+       "toolbox": "صندوق تاع الدوزان",
+       "userpage": "شوف الباجة تاع المستعملي",
+       "projectpage": "شوف الباجة تاع البروجي",
+       "imagepage": "شوف الباجة تاع الفيشي",
+       "mediawikipage": "شوف الباجة تاع الميساج",
+       "templatepage": "شوف الباجة تاع القالب",
+       "viewhelppage": "شوف الباجة تاع المعاونة",
+       "categorypage": "شوف الباجة تاع الصنيف",
+       "viewtalkpage": "شوف التقرعيج",
        "otherlanguages": "بلوغات وحد اوخره",
        "redirectedfrom": "(محول من $1)",
+       "redirectpagesub": "باجة تاع التحوال",
        "lastmodifiedat": "هاد الباجه راهي تبدّلت نهار الـ $1, على الـساعة $2.",
+       "viewcount": "هاد الباجة نشافت {{PLURAL:$1|خطرة وحدة|$1 خطرة}}.",
+       "protectedpage": "باجة محضيّة",
        "jumpto": "اقفز ل:",
        "jumptonavigation": "تجوال",
        "jumptosearch": "تفتاش",
+       "view-pool-error": "اعدرونا، السربايات راهم مغبّنين ف هاد الوقيتة.\nبزّاف المستعمليّين راهم باغيين يشوفو هاد الباجة.\nاصبرو شي وقيتة قبل ما تحاولو تلحقو لها عاود.\n\n$1",
+       "generic-pool-error": "اعدرونا، السربايات راهم مغبّنين ف هاد الوقيتة.\nبزّاف المستعمليّين راهم باغيين يشوفو هاد الباجة.\nاصبرو شي وقيتة قبل ما تحاولو تلحقو لها عاود.",
+       "pool-timeout": "المهلة تاع المقارعة راهي فاتت",
+       "pool-queuefull": "السنسلة تاع المقارعة راهي عامرة",
+       "pool-errorunknown": "خلطة ماشي معروفة",
+       "pool-servererror": "السربيس تاع العدّان راه حابس ( $1 ).",
        "aboutsite": "على{{SITENAME}}",
        "aboutpage": "Project:على",
+       "copyright": "المحتاوا راه تحت النسخة $1 تاع الليسانس، غير يلا كان مكتوب حاجاخرة.",
        "copyrightpage": "{{ns:project}}:حقوق النسخ",
        "currentevents": "الخبورات",
        "currentevents-url": "Project:خبورات",
        "disclaimers": "تنبيهات",
        "disclaimerpage": "Project:التحذيرات العامه",
        "edithelp": "معونة",
-       "mainpage": "الباجة اللوله",
+       "mainpage": "الباجة اللولانيّة",
        "mainpage-description": "الباجة اللوله",
+       "policy-url": "Project:المقاون",
        "portal": "المجتمع",
        "portal-url": "Project:بورطاي المجتمع",
        "privacy": "السياسة تاع الخصوصيات (الدين الضيّق)",
        "privacypage": "Project:خصوصيه",
+       "badaccess": "مشكل فل مسموحات",
+       "badaccess-group0": "ماشي مقبول ليك تدير الشي الّي راك تسيّي تديرهُ.",
+       "badaccess-groups": "الفعلة الّي راك سيّيت تديرها مسموحة برك لل مستعملّين {{PLURAL:$2||الّي هوما منل جماعة|الّي هوما من وحدة من هاد الجمايع}}: $1.",
+       "versionrequired": "النسخة $1 تاع ميدياويكي ملزومة",
+       "versionrequiredtext": "النسخة $1 تاع ميدياويكي راهي ملزومة باش تنجم تستعمل هاد الباجة.\nشوف [[Special:Version|الباجة تاع النسخات باش تفهم كتَر على هاد الشي]]",
+       "ok": "قابل",
        "retrievedfrom": "جايبينه من \"$1\"",
        "youhavenewmessages": "عندك $1 ($2).",
+       "youhavenewmessagesfromusers": "{{PLURAL:$4|عندك}} $1 من عند {PLURAL:$3|مستعملي واحد|زوج تاع المستعمليّين|$3 مستعملي}} ($2).",
+       "youhavenewmessagesmanyusers": "عندك $1 من عند شحال من مستعملي ($2).",
+       "newmessageslinkplural": "{{PLURAL:$1|بريّة جديدة وحدة|999=بريّة جديدة}}",
+       "newmessagesdifflinkplural": "{{PLURAL:$1التبديلة التالية|التبديلات التاليين}}",
+       "youhavenewmessagesmulti": "عندك بريّة جديدة في $1.",
        "editsection": "بدل",
        "editold": "بدل",
        "viewsourceold": "شوف الاصل",
        "viewsourcelink": "شوف العين",
        "editsectionhint": "إيديتي الصنف:$1",
        "toc": "محتويات",
+       "showtoc": "ورّي",
+       "hidetoc": "خبّي",
+       "collapsible-collapse": "خبّي",
+       "collapsible-expand": "ورّي",
+       "thisisdeleted": "راك باغي تشوف ولا ترجّع $1؟",
+       "viewdeleted": "شوف $1؟",
+       "restorelink": "{{PLURAL:$1|تبدال واحد مفاصي|$1 تبدالات مفاصيين|$1 تبدال مفاصي}}",
+       "feed-invalid": "النوع تاع التلقيمة ماشي مصلاح.",
+       "feed-unavailable": "التلقيمات ما راهمش موجودين.",
        "site-rss-feed": "تيار آر‌إس‌إس $1",
        "site-atom-feed": "$1 تيار آتوم",
+       "page-rss-feed": "تلقيمة RSS تاع \"$1\"",
        "page-atom-feed": "$1 تيار آتوم",
        "red-link-title": "$1 (الباجه ما كاينش)",
+       "sort-descending": "رتّب بل نازولي",
+       "sort-ascending": "رتّب بل طالوعي",
        "nstab-main": "الباجة",
        "nstab-user": "باجة{{GENDER:{{BASEPAGENAME}}|المستخدم|المستخدمة}}",
+       "nstab-media": "باجة تاع ميديا",
        "nstab-special": "باجه خوصوصيّة",
        "nstab-project": "باجه مشروع",
        "nstab-image": "ملف",
+       "nstab-mediawiki": "بريّة",
        "nstab-template": "مودال",
+       "nstab-help": "باجة تاع معاونة",
        "nstab-category": "تصنيف",
+       "nosuchaction": "الشي الّي طلبتهُ ما كاينش",
+       "nosuchactiontext": "الفعلة الّي مطلوبة فل URL ماشي مقبولة.\nبالاك ما دخّلتوش الـ URL كيما لازم ولا تاني تبّعتو كاش وصيل مغلوط.\nينجم تاني يكون كاين عُلّة فل لوجيسيال الّي مستعمل فـ {{SITENAME}}.",
+       "nosuchspecialpage": "هاد الباجة الخوصوصيّة ما كاينش منها",
+       "nospecialpagetext": "<strong>راك طلبت باجة خوصوصيّة ماشي صحيحة.</strong>\n\nتصيب الليستة تاع الباجات الخوصوصيّة في [[Special:SpecialPages|{{int:specialpages}}]].",
+       "error": "غلطة",
+       "databaseerror": "غلطة فل دخيرة تاع الخبيرات (DB)",
+       "databaseerror-text": "صرات غلطة عند المسقسية تاع الدخيرة تاع الخبيرات. هاد الشي ينجم يكون جاي من غلطة فل برنامج.",
+       "databaseerror-textcl": "صرات غلطة عند المسقسية تاع الدخيرة تاع الخبيرات.",
+       "databaseerror-query": "مسقسية : $1",
+       "databaseerror-function": "دالّة: $1",
+       "databaseerror-error": "غلطة: $1",
+       "laggedslavemode": "<strong>ردّ بالك:</strong> هاد الباجة تنجم تكون ما حاوياش التبدالات التاليين الّي ندارو.",
+       "readonly": "الدخيرة تاع الخبيرات راهي مغلوقة",
+       "enterlockreason": "حطّ السبّة تاع القفيل و المدّة تاعهُ بل ميز.",
+       "readonlytext": "الدخيرة تاع الخبيرات راهي مغلوقة على الدخلات الجديدة ولا التبدالات، بالاك علاجال كاش صيانة عاديّة، مور ماش غادي تعاود ترجع لل طبَع.\n\nالإيداري الّي دار هاد الشي راه يعطي التفسيرات هادي: $1",
        "missing-article": "الداتاباز ما صابتش باجه كان لازم تنصاب، الباجه هي \"$1\" $2.\n\nنورمالمو يصرا هذا مين اتبع فرق بيريمي والا وصيل تأريخ باجة ممحيه.\n\nإذا ما كانش هذا هو الحال همالا راك طحت في علة تاع البرمجية.\nمن فضلك سينياليها لواحد من[[Special:ListUsers/sysop|الإداريين]]، و أعطه مسار هذه الباجه.",
        "missingarticle-rev": "(رقم الفرسيون: $1)",
+       "readonly_lag": "الدخيرة تاع الخبرات راهي مقفولة بيدما السربايات التوناويّة يلحقو التوخار الّي عندهم معا السرباي اللولاني",
        "badtitle": "عنوان عيان",
        "badtitletext": "عنوان الباجه المطلوب إما ماشي صحيح والا فارغ، وبالاك الوصيل بين اللغات والا بين البروجيات ماشي صحيح.\nبالاك فيه حروف ما تصلحش  باس يستعملوها فالعناوين.",
        "viewsource": "شوف الاصل",
        "remembermypassword": "اتفكر الدخول تاعي ب هاذ النافيكاتور (ب مدّة حدها{{PLURAL:$1||يوم واحد|يومين|$1 إيّام|$1 يوم}})",
        "login": "كونكسيون",
        "nav-login-createaccount": "تسجل/ اصنع حساب",
-       "loginprompt": "لازم تكون الكوكيز لديك ماكتيفيه باش تكونيكتي و تدخل ل{{SITENAME}}.",
        "userlogin": "تسجل/ اصنع حساب",
        "userlogout": "سجل خروج",
        "nologin": "ما عندكش حساب مسجل؟ '''$1'''.",
        "link_tip": "وصيلة داخليه",
        "extlink_sample": "http://www.example.com اسم الوصيلة",
        "extlink_tip": "وصيلة برانية (ما تنساش البديةhttp://)",
-       "headline_sample": "كتبة نتاع عنوان كبير",
+       "headline_sample": "كتبة تاع علوان كبير",
        "headline_tip": "عنوان من المستوى الثاني",
        "nowiki_sample": "دخل الكتبة مشي مستفة هنا",
        "nowiki_tip": "اهمل طريقةالويكي",
        "post-expand-template-argument-warning": "'''توليه:''' هذه الباجه فيها عامل قالب واحد على الأقل عندو حجم تمدد كبير بزاف.\nهاذالعوامل اتمحات.",
        "post-expand-template-argument-category": "باجات فيها مدخلات القالب الممحي",
        "viewpagelogs": "بين العمليات على هاذ الباحه",
-       "currentrev-asof": "النسخه نتاع دروك تاريجها $1",
+       "currentrev-asof": "نسخة ضركانية بل تاريخ تاع $1",
        "revisionasof": "معاودة تاع الـ $1",
        "revision-info": "مراجعه $1 بواسطت $2",
        "previousrevision": "← نسخة اللوله",
        "lineno": "سطر$1:",
        "compareselectedversions": "كومباري بين نسختين مخيرين",
        "editundo": "نحي",
-       "searchresults": "ريزيلته نتاع التفتاش",
+       "searchresults": "نتاج تاع التفتيشة",
        "searchresults-title": "ريزيلته تاع التحواس \"$1\"",
        "prevn": "{{PLURAL:$1|précédente|$1 اللولانيين}}",
        "nextn": "{{PLURAL:$1|suivante|$1 التاليين}}",
        "searchmenu-exists": "'''كاين باجه اسمها « [[:$1]] » في هاذ الويكي'''",
        "searchmenu-new": "'''أصنع الباجه « [[:$1|$1]] » في هذ الويكي !'''",
        "searchprofile-articles": "باجه تع محتوى",
-       "searchprofile-project": "باجه تع المعونه و البروجي",
        "searchprofile-images": "ميلتيميديا",
        "searchprofile-everything": "كلش",
        "searchprofile-advanced": "تفتاش متقدم",
        "searchprofile-articles-tooltip": "فتش في $1",
-       "searchprofile-project-tooltip": "فتش في  $1",
        "searchprofile-images-tooltip": "فتش على ملفات ميلتيميديا",
        "searchprofile-everything-tooltip": "فتش في قاع السيت (حتى في باجات المناقشه)",
        "searchprofile-advanced-tooltip": "خير إسباسات الأسامي للتفتاش",
        "booksources-go": "اذهب",
        "log": "ريجيسترات العمليات",
        "allpages": "قاع الباجات",
-       "alphaindexline": "$1 إلى $2",
        "allarticles": "قاع الباجات",
        "allpagessubmit": "روح",
        "categories": "تصنيفات",
        "linksearch-line": "$1 موصولة من $2",
        "listgrouprights-members": "(ليسته الأعضاء)",
        "emailuser": "ابعث بريه لهاذ المستخدم",
-       "watchlist": "ليستة نتاع التابعه",
-       "mywatchlist": "ليستة نتاع التابعه",
+       "watchlist": "ليستة تاع المتابعة",
+       "mywatchlist": "ليستة تاع المتابعة",
        "watchlistfor2": "ل$1 ($2)",
        "watch": "تبع",
        "unwatch": "ما تزيدش تعس",
        "sp-contributions-talk": "نقاش",
        "sp-contributions-search": "تفتاش المشاركات",
        "sp-contributions-username": "عنوان أيبي والال اسم مستخدم:",
-       "sp-contributions-toponly": "ما تبين غير المشاركات التوالا نتاع المقالات",
+       "sp-contributions-toponly": "ما تورّي غير المشاركات التوالا تاع المقالات",
        "sp-contributions-submit": "تفتاش",
        "whatlinkshere": "واش يوصل هنا",
        "whatlinkshere-title": "الباجات اللي تقين في \"$1\"",
        "tooltip-ca-edit": "تنجم تحرر هاذ الباجه ،ماذابيك تستعمل قفله المراجعه قبل ما تحفظ",
        "tooltip-ca-addsection": "ابدأ طرف جديد",
        "tooltip-ca-viewsource": "هاذ الباجه محميه. و شنو تقدرو تشوفو الأصلي نتاعها",
-       "tooltip-ca-history": "المراجعات التوالى نتاع الباجه (مع المساهمين نتاوعها)",
+       "tooltip-ca-history": "المراجعات التوالا تاع الباجة (معا المساهمين تاوعها)",
        "tooltip-ca-protect": "بروتيجي هاذالباجه",
        "tooltip-ca-delete": "امحي هاذ الباجه",
        "tooltip-ca-move": "بدل أسم هذ الباجه",
-       "tooltip-ca-watch": "زيد هذ الباجه لليستتك نتاع التتباع",
-       "tooltip-ca-unwatch": "اÙ\82Ù\84ع Ù\87اذ Ø§Ù\84باجÙ\87 Ù\85Ù\86 Ø§Ù\84Ù\84Ù\8aستÙ\87 Ù\86تاع التتباع",
+       "tooltip-ca-watch": "زيد هذ الباجة لل ليستة تاعك تاع التتباع",
+       "tooltip-ca-unwatch": "اÙ\82Ù\84ع Ù\87اد Ø§Ù\84باجة Ù\85Ù\86Ù\84 Ù\84Ù\8aستة ØªØ§Ø¹Ù\83 تاع التتباع",
        "tooltip-search": " فتّش في {{SITENAME}}",
        "tooltip-search-go": "روح الباجه عندها نفس الآسم إذا كانت كاينه",
        "tooltip-search-fulltext": "فتّش على باجه بهاد الكتبة",
        "tooltip-n-mainpage": "زور الباجه اللوله",
        "tooltip-n-mainpage-description": "زور الباجه لوله",
        "tooltip-n-portal": "على الپروجي،واش تنجم تدير، وين تصيب واش تحتاج",
-       "tooltip-n-currentevents": "تحÙ\88اس Ø¹Ù\84Ù\89 Ù\85عÙ\84Ù\88Ù\85ات Ø£Ø³Ø§Ø³Ù\8aØ© Ù\84صÙ\88اÙ\84Ø­ ØµØ±Ø§Ù\88 Ø°Ø±Ù\88Ù\83",
+       "tooltip-n-currentevents": "صÙ\8aب Ø®Ø¨Ø§Ø±Ø§Øª Ù\85ستÙ\91رÙ\8aÙ\86 Ø¹Ù\84Ù\89 Ø§Ù\84صÙ\88اÙ\84Ø­ Ø§Ù\84Ù\91Ù\8a Ø±Ø§Ù\87Ù\85 Ù\8aصراÙ\88 Ø¶Ø±Ù\83ا",
        "tooltip-n-recentchanges": "الليستة تاع التبديلات التوالا فل ويكي",
        "tooltip-n-randompage": "طلّع باجه على الزهر",
        "tooltip-n-help": "بلاصة المعونة",
-       "tooltip-t-whatlinkshere": "ليسته نتاع قاع باجات المحتوى الي توصل هنا",
-       "tooltip-t-recentchangeslinked": "ليسته نتاع التبديلات التواله نتاع الباجات الي عندهم علاقه بهاذي",
-       "tooltip-feed-atom": "سيلان آتوم نتاع الباجه",
+       "tooltip-t-whatlinkshere": "ليستة تاع كاع الباجات تاع المحتاوا الي توصّل لهنا",
+       "tooltip-t-recentchangeslinked": "ليستة تاع التبديلات التوالا تاع الباجات الّي عندهم رباط معا هادي",
+       "tooltip-feed-atom": "سيلان آتوم تاع هاد الباجة",
        "tooltip-t-contributions": "شوفان ليسته مساهمات هاذا المستخدم",
        "tooltip-t-emailuser": "أرسل بريه لهاذ المستخدم",
        "tooltip-t-upload": "أرسل تصويرة و إلا أي ملف ميديا للسرفر",
        "tooltip-t-specialpages": "ليستة تاع كامل الباجات الخصوصيّة",
        "tooltip-t-print": "نسخه لهاذ الباجه قابله للطبيع",
-       "tooltip-t-permalink": "توصيله دايمه رايحه لهاذ النسخة نتاع الباجة",
+       "tooltip-t-permalink": "وصيل دايم رايح ل هاد النسخة تاع الباجة",
        "tooltip-ca-nstab-main": "شوف باجه المحتوى",
        "tooltip-ca-nstab-user": "شوف باجت المستعمل",
        "tooltip-ca-nstab-special": "هذه الباجه خصوصيه،ما تقدرش تبدل فيها",
        "tooltip-minoredit": "ماركي هاذا تبديل صغير",
        "tooltip-save": "سجل تبديلات نتاعك",
        "tooltip-preview": "بين التغييرات نتاعك، من فضلك استخدم هذا قبل ما تنشر!",
-       "tooltip-diff": "تخلي الشوفان نتاع التبديلات اللي ندارو.",
+       "tooltip-diff": "ورّي التبدالات الّي راك درتهم فل نصّ.",
        "tooltip-compareselectedversions": "شوف الفروق بين نسختين مخيرين من هاذ الباجه.",
-       "tooltip-watch": "زÙ\8aد Ù\87Ø° Ø§Ù\84باجÙ\87 Ù\84Ù\84Ù\8aستتÙ\83 Ù\86تاع التتباع",
-       "tooltip-rollback": "يولي : بدركة وحده تآنيلي التبديله و إلا التبديلات نتاع المساهم التالي",
+       "tooltip-watch": "زÙ\8aد Ù\87اد Ø§Ù\84باجة Ù\84Ù\84 Ù\84Ù\8aستة ØªØ§Ø¹Ù\83 تاع التتباع",
+       "tooltip-rollback": "\"نحّي\" : ب ضركة وحدة تآنيلي التبديلة ولا التبديلات تاع المساهم التالي",
        "tooltip-undo": "\"نحّي\" فاصي هاد الـمعاودة و حلّ تاقة تاع تبدال بشوفه قبلانيّه. تخلّي باش ترجع لل معاوده التاليه و تزيد الـسبّة علاش فل قابسه تاع الـحويصله.",
        "tooltip-summary": "دخل تلخيص صغير",
        "previousdiff": "→ التعديل الي قبل",
        "file-nohires": "ما كانش دقه اكثر من هاك",
        "svg-long-desc": "فيشيي SVG، أبعاده $1 × $2 بكسل، تاي الفيشي : $3",
        "show-big-image": "تصويرة دقة عالية",
-       "bad_image_list": "الفورمه كيما التابعة:\nما كاين غير السطور الّي باديين بل *، الّي يكونو معدودين\nالـوصيل الـلوّل نتاع سطر لازم تكون تاع تصويرة ضايعة.\nكامل الوصيلات لخرين الّي فل سطر، يكونو معدودين كلّي تتنيّات، بل كي الباجات وين الـفيشي يكون باين.",
+       "bad_image_list": "الفورمة راهي كيما واش يتبع:\nما كاين غير السطور الّي باديين بل *، الّي يكونو معدودين\nالـوصيل الـلوّل تاع سطر لازم كون تاع تصويرة ضايعة.\nكامل الوصيلات لخرين الّي فل سطر، يكونو معدودين كلّي تتنيّات، بل متال باجات وين الـتصويرة تنجم تبان.",
        "metadata": "بايان ميتا",
-       "metadata-help": "هذا الملف راه فيه معلومات زيادة، بالاك تكون انزادت من عند صواره نيميريك ولا سكانر مين صنع الملف.\nالأصلي، شي تفاصيل بالاك ما تعبرش على الملف المعدل.",
-       "metadata-fields": "غادÙ\8a Ù\8aÙ\86عرض Ø§Ù\84Ø­Ù\82Ù\84 Ù\86تاع Ù\85عطÙ\8aات Ø§Ù\84Ù\85Ù\8aتا Ø§Ù\84Ù\83اÙ\8aÙ\86Ù\87 Ù\81Ù\8a Ù\87اذ Ø§Ù\84برÙ\8aÙ\87 Ù\81Ù\8a Ø¨Ø§Ø¬Ù\87 Ø§Ù\84تصÙ\88Ù\8aرة Ù\85Ù\86Ù\8aÙ\86 Ù\8aÙ\83Ù\88Ù\86 Ø¬Ø¯Ù\88Ù\84 Ù\85عطÙ\8aات Ø§Ù\84Ù\85Ù\8aتا Ù\85Ø·Ù\88Ù\8aاÙ\8b.\nاÙ\84Ø­Ù\82Ù\88Ù\84 Ù\84خرÙ\87 ØªÙ\83Ù\88Ù\86 Ù\85خبÙ\8aØ© Ø¨Ø§Ø± ديفو.\n* make\n* model\n* datetimeoriginal\n* exposuretime\n* fnumber\n* isospeedratings\n* focallength\n* artist\n* copyright\n* imagedescription\n* gpslatitude\n* gpslongitude\n* gpsaltitude",
+       "metadata-help": "هذا الملف راه فيه خبيرات زايدين، بالاك تكون انزادت من عند صواره نيميريك ولا سكانر مين صنع الملف.\nالأصلي، شي تفاصيل بالاك ما تعبرش على الملف المعدل.",
+       "metadata-fields": "اÙ\84Ø­Ù\82Ù\88Ù\84 ØªØ§Ø¹ Ø§Ù\84Ù\85Ù\8aتا Ù\85عطÙ\8aÙ\91ات ØªØ§Ø¹ ØªØµØ§Ù\88ر Ø§Ù\84Ù\91Ù\8a Ù\8aÙ\83Ù\88Ù\86Ù\88 Ù\81 Ù\87اد Ø§Ù\84برÙ\8aÙ\91Ø© ØºØ§Ø¯Ù\8a Ù\8aÙ\86حطÙ\91Ù\88 Ù\81Ù\84 Ø¨Ø§Ø¬Ø© ØªØ§Ø¹ Ø§Ù\84تÙ\88صاÙ\81 ØªØ§Ø¹ Ø§Ù\84تصÙ\88Ù\8aرة Ù\85Ù\86Ù\8aÙ\86 Ù\8aÙ\83Ù\88Ù\86 Ø§Ù\84جدÙ\88Ù\84 ØªØ§Ø¹  Ø§Ù\84Ù\85Ù\8aتااÙ\84Ù\85عطÙ\8aات Ù\85Ø·Ù\88Ù\8a.\nاÙ\84Ø­Ù\82Ù\88Ù\84 Ù\84خرة Ù\8aÙ\83Ù\88Ù\86Ù\88 Ù\85خبÙ\8aÙ\8aÙ\86 Ø¨Ø§Ø±ديفو.\n* make\n* model\n* datetimeoriginal\n* exposuretime\n* fnumber\n* isospeedratings\n* focallength\n* artist\n* copyright\n* imagedescription\n* gpslatitude\n* gpslongitude\n* gpsaltitude",
        "watchlistall2": "لكل",
        "namespacesall": "لكل",
        "monthsall": "لكل",
index e04983e..63a7d9f 100644 (file)
@@ -8,7 +8,8 @@
                        "Meno25",
                        "Ouda",
                        "Ramsis II",
-                       "아라"
+                       "아라",
+                       "Oldstoneage"
                ]
        },
        "tog-underline": "حط خط تحت اللينكات:",
        "talkpagelinktext": "مناقشه",
        "specialpage": "صفحة مخصوصة",
        "personaltools": "ادوات شخصيه",
-       "postcomment": "قسم جديد",
        "articlepage": "بين صفحة المحتوى",
        "talk": "مناقشه",
        "views": "مناظر",
        "externaldberror": "يا إما فى حاجة غلط فى الدخول على قاعدة البيانات الخارجية أو انت مش مسموح لك تعمل تحديث لحسابك الخارجي.",
        "login": "دخول",
        "nav-login-createaccount": "تسجيل دخول / فتح حساب",
-       "loginprompt": "لازم تكون الكوكيز عندك مفعله علشان تقدر تدخل ل {{SITENAME}}.",
        "userlogin": "دخول / فتح حساب",
        "userloginnocreate": "دخول",
        "logout": "خروج",
        "timezone-utc": "يو تى سى",
        "unknown_extension_tag": "تاج بتاع امتداد مش معروف \"$1\"",
        "duplicate-defaultsort": "تحزير: زرار الترتيب الاوتوماتيكي\"$2\" بيوقف زرار الترتيب الاوتوماتيكي\"$1\" القديم.",
-       "version": "نسخه",
+       "version": "نسخة",
        "version-extensions": "الامتدادات المتثبتة",
        "version-specialpages": "صفحات مخصوصة",
        "version-parserhooks": "خطاطيف البريزر",
index 56162b5..52c7e41 100644 (file)
        "unusedtemplates": "Net benutzte Vorlagen",
        "unusedtemplateswlh": "Aundre Links",
        "randompage": "Zuafoisseitn",
+       "randomredirect": "Zuafällige Weidaloatung",
        "statistics": "Statistik",
        "statistics-articles": "Inhoidsseiten",
        "statistics-pages": "Seiten",
        "allpagesprefix": "Seiten zoang mid Präfix:",
        "allpagesbadtitle": "Da eihgeewerne Seitennaum is néd gütig: Er hod éntwéder a vurauhgstöds Sprooch-, a Interwiki-Kyrzel óder enthoitt oah óder mererne Zeichen, dé in d' Seitennaumen néd vawendt wern derffm.",
        "allpages-bad-ns": "Dén Naumensraum „$1“ gibts in {{SITENAME}} néd.",
+       "allpages-hide-redirects": "Weidaloatunga ausblendn",
        "categories": "Kategorina",
        "special-categories-sort-count": "Sortiarung noch da Auhzoi",
        "special-categories-sort-abc": "Sortiarung noch 'm Alfabet",
        "ipusubmit": "Freigem",
        "unblocked": "[[User:$1|$1]] is freigem worn",
        "unblocked-id": "Sperr-ID $1 is fraigeem worn",
+       "blocklist": "Gspeade Nutza",
        "ipblocklist": "Gsperrte Nutza",
        "ipblocklist-legend": "Suach noch am gsperrden Benytzer",
        "createaccountblock": "'s erstön voh Benutzerkóntós is gsperrd",
        "othercontribs": "Basiard auf da Orweid voh $1",
        "creditspage": "Seiteninformaziónen",
        "pageinfo-redirects-name": "Ozoi vo de Weidaloatunga zua dea Seitn",
+       "pageinfo-subpages-value": "$1 ($2 {{PLURAL:$2|Weidaloatung|Weidaloatunga}}; $3 {{PLURAL:$3|Untaseitn|Untaseitn}})",
        "pageinfo-redirectsto": "Weidaloatunga af",
        "markedaspatrollederrortext": "Du muasst a Seitenänderrung auswön",
        "deletedrevision": "Oide Version $1 glöscht.",
index dec808c..8f0e7d1 100644 (file)
@@ -8,7 +8,8 @@
                        "Reedy",
                        "ZxxZxxZ",
                        "아라",
-                       "RigiMahnoor"
+                       "RigiMahnoor",
+                       "Oldstoneage"
                ]
        },
        "tog-underline": ":لینکانآ خط کش",
        "talkpagelinktext": "گپ کن",
        "specialpage": "حاصین صفحه",
        "personaltools": "شخصی وسایل",
-       "postcomment": "نوکین بخش",
        "articlepage": "محتوا صفحه به گند",
        "talk": "بحث",
        "views": "چارگان",
        "externaldberror": "یک حطا دیتابیس تصدیق هویت دراییگی هست یا شما را اجازت نیست وتی حساب درایی په روچ کنیت.",
        "login": "ورود",
        "nav-login-createaccount": "ورود/شرکتن حساب",
-       "loginprompt": "شما بایدن په وارد بیگ ته {{SITENAME}} کوکی فعال کنیت",
        "userlogin": "ورود/شرکتن حساب",
        "userloginnocreate": "لاگین",
        "logout": "در بیگ",
        "hebrew-calendar-m12-gen": "الول",
        "unknown_extension_tag": "ناشناس برجسب الحاق  \"$1\"",
        "duplicate-defaultsort": "هژاری: ترتیب پیش فرض «$2» ترتیب پیش فرض پیشگین «$1» را باطل کنت.",
-       "version": "نسخه",
+       "version": "نسخة",
        "version-extensions": "نصب بوتگیت الحاق آن",
        "version-specialpages": "حاصین صفحات",
        "version-parserhooks": "تجزیه کنوک گیر کت",
index b35aa23..0ea566b 100644 (file)
        "pagelang-use-default": "Ужываць мову па змоўчаньні",
        "pagelang-select-lang": "Абярыце мову",
        "right-pagelang": "Зьмяніць мову старонкі",
-       "action-pagelang": "зьмену мовы старонкі"
+       "action-pagelang": "зьмену мовы старонкі",
+       "log-name-pagelang": "Журнал зьменаў мовы"
 }
index 1d81b60..094e669 100644 (file)
        "pool-timeout": "Выйшаў час чакання блакіроўкі",
        "pool-queuefull": "Чарга запытаў перапоўнена",
        "pool-errorunknown": "Невядомая памылка",
+       "pool-servererror": "Служба лічыльніка пулу недаступная ($1).",
        "aboutsite": "Пра {{GRAMMAR:вінавальны|{{SITENAME}}}}",
        "aboutpage": "Project:Пра {{GRAMMAR:вінавальны|{{SITENAME}}}}",
        "copyright": "Матэрыял даступны на ўмовах $1 (калі не пазначана іншае).",
        "license": "Ліцэнзіяванне:",
        "license-header": "Ліцэнзіяванне",
        "nolicense": "Нішто не выбрана",
+       "licenses-edit": "Правіць параметры ліцэнзіі",
        "license-nopreview": "(без перадпаказу)",
        "upload_source_url": " (сапраўдны, публічна дасягальны URL)",
        "upload_source_file": " (файл на вашай машыне)",
        "import-error-invalid": "Старонка «$1» не была імпартаваная з-за няслушнасці назвы.",
        "import-error-unserialize": "Немагчыма дэсерыялізаваць версію $2 старонкі \"$1\". Меркавалася, што версія выкарыстоўвае мадэль змесціва $3, серыялізавана як $4.",
        "import-error-bad-location": "Версія $2, якая выкарыстоўвае мадэль змесціва $3, не можа быць запісана на старонцы \"$1\" гэтай вікі, паколькі такая мадэль не падтрымліваецца на гэтай старонцы.",
+       "import-options-wrong": "{{PLURAL:$2|1=Няправільны параметр|Няправільныя параметры}}: <nowiki>$1</nowiki>",
        "import-rootpage-invalid": "Пазначаная назва каранёвай старонкі недапушчальная.",
        "import-rootpage-nosubpage": "У прастора назваў \"$1\" каранёвай старонкі падстаронкі не дазволены.",
        "importlogpage": "Журнал імпартаванняў",
        "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|размовы]])",
        "unknown_extension_tag": "Невядомая метка пашырэння \"$1\"",
        "duplicate-defaultsort": "Увага: прадвызначаная клавіша ўпарадкавання \"$2\" замяніла ранейшую такую клавішу \"$1\".",
+       "duplicate-displaytitle": "<strong>Папярэджанне:</strong> Паказаная назва \"$2\" перасягае ранейшую назву \"$1\".",
        "version": "Версія",
        "version-extensions": "Устаноўленыя прыстаўкі",
        "version-skins": "Устаноўленыя вокладкі",
        "htmlform-selectorother-other": "Рознае",
        "htmlform-no": "Не",
        "htmlform-yes": "Так",
+       "htmlform-chosen-placeholder": "Выберыце параметр",
        "htmlform-cloner-create": "Дадаць яшчэ",
        "htmlform-cloner-delete": "Сцерці",
        "htmlform-cloner-required": "Неабходна хаця б адно значэнне.",
index b4be21a..07a5a29 100644 (file)
        "expand_templates_remove_nowiki": "ফলাফলে <nowiki> ট্যাগগুলো বাতিল করো",
        "expand_templates_generate_xml": "XML পার্স বৃক্ষ দেখাও",
        "expand_templates_generate_rawhtml": "এইচটিএমএল দেখাও",
-       "expand_templates_preview": "প্রাকদর্শন"
+       "expand_templates_preview": "প্রাকদর্শন",
+       "pagelanguage": "পাতার ভাষা নির্বাচক",
+       "pagelang-name": "পাতা",
+       "pagelang-language": "ভাষা",
+       "pagelang-use-default": "ডিফল্ট ভাষা ব্যবহার করুন",
+       "pagelang-select-lang": "ভাষা নির্বাচন করুন",
+       "right-pagelang": "পাতার ভাষা পরিবর্তন করুন",
+       "action-pagelang": "পাতার ভাষা পরিবর্তন করুন",
+       "log-name-pagelang": "ভাষা পরিবর্তন লগ",
+       "log-description-pagelang": "এটি পাতার ভাষা পরিবর্তনের লগ।",
+       "logentry-pagelang-pagelang": "$1 পাতার ভাষা $3 এর জন্য $4 থেকে $5 এ {{GENDER:$2|পরিবর্তন}} করেছেন।"
 }
index 1ec96c9..7876737 100644 (file)
        "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|diskuse]])",
        "unknown_extension_tag": "Neznámá značka rozšíření: „$1“",
        "duplicate-defaultsort": "Upozornění: Implicitní klíč řazení (DEFAULTSORTKEY) „$2“ přepisuje dříve nastavenou hodnotu „$1“.",
+       "duplicate-displaytitle": "<strong>Upozornění:</strong> Předchozí zobrazovaný název „$1“ je nahrazen zobrazovaným názvem „$2“.",
        "version": "Verze",
        "version-extensions": "Nainstalovaná rozšíření",
        "version-skins": "Nainstalované vzhledy",
index e1d180d..c2efafd 100644 (file)
        "license": "Lizenz:",
        "license-header": "Lizenz",
        "nolicense": "Keine Vorauswahl",
+       "licenses-edit": "Lizenzoptionen bearbeiten",
        "license-nopreview": "(es ist keine Vorschau verfügbar)",
        "upload_source_url": " (gültige, öffentlich zugängliche URL)",
        "upload_source_file": " (eine Datei auf deinem Computer)",
index 9b63730..5aec3ec 100644 (file)
        "externaldberror": "Είτε συνέβη κάποιο σφάλμα εξωτερικής πιστοποίησης της βάσης δεδομένων είτε δεν σας έχει επιτραπεί να ενημερώσετε τον εξωτερικό σας λογαριασμό.",
        "login": "Είσοδος",
        "nav-login-createaccount": "Είσοδος / δημιουργία λογαριασμού",
-       "loginprompt": "Πρέπει να έχετε ενεργοποιήσει τα cookies για να συνδεθείτε στον ιστοχώρο {{SITENAME}}.",
        "userlogin": "Είσοδος / δημιουργία λογαριασμού",
        "userloginnocreate": "Είσοδος",
        "logout": "Έξοδος",
        "largefileserver": "Το μέγεθος αυτού του αρχείο είναι μεγαλύτερο από το μέγιστο μέγεθος που ο εξυπηρετητής είναι ρυθμισμένος να επιτρέπει.",
        "emptyfile": "Το αρχείο που φορτώσατε φαίνεται να είναι κενό. Αυτό μπορεί να οφείλεται σε λάθος πληκτρολόγησης του ονόματος του αρχείου. Παρακαλούμε ελέγξτε εαν αυτό είναι πραγματικά το αρχείο που θέλετε να φορτώσετε.",
        "windows-nonascii-filename": "Αυτό το wiki δεν υποστηρίζει ονόματα αρχείων με ειδικούς χαρακτήρες.",
-       "fileexists": "Υπάρχει ήδη αρχείο με αυτό το όνομα, παρακαλούμε ελέγξτε το <strong>[[:$1]]</strong> εάν δεν είστε σίγουρος/η αν θέλετε να το αλλάξετε.\n[[$1|thumb]]",
+       "fileexists": "Υπάρχει ήδη αρχείο με αυτό το όνομα, παρακαλούμε ελέγξτε το <strong>[[:$1]]</strong> εάν δεν είστε {{GENDER:|σίγουρος|σίγουρη}} αν θέλετε να το αλλάξετε.\n[[$1|thumb]]",
        "filepageexists": "Η σελίδα περιγραφής για αυτό το αρχείο δημιουργήθηκε ήδη στο <strong>[[:$1]]</strong>, αλλά κανένα αρχείο με αυτό το όνομα δεν υπάρχει αυτή τη στιγμή.\nΗ περιγραφἠ που θα εισάγετε δεν θα εμφανιστεί στη σελίδα περιγραφής.\nΓια να εμφανιστεί η περιγραφή σας εκεί, θα πρέπει να την επεξεργαστείτε χειροκίνητα.\n[[$1|thumb]]",
        "fileexists-extension": "Ένα αρχείο με παρόμοιο όνομα υπάρχει: [[$2|thumb]]\n* Όνομα του προς επιφόρτωση αρχείου: <strong>[[:$1]]</strong>\n* Όνομα υπάρχοντος αρχείου: <strong>[[:$2]]</strong>\nΠαρακαλώ διαλέξτε ένα διαφορετικό όνομα.",
        "fileexists-thumbnail-yes": "Το αρχείο φαίνεται ότι είναι μια εικόνα μειωμένου μεγέθους ''(μικρογραφία)''. [[$1|thumb]]\nΠαρακαλώ ελέγξτε το αρχείο <strong>[[:$1]]</strong>.\nΑν το ελεγμένο αρχείο είναι η ίδια εικόνα στο αρχικό μέγεθος δεν είναι απαραίτητο να επιφορτώσετε μια επιπλέον μικρογραφία.",
index 3531448..039b052 100644 (file)
@@ -35,7 +35,8 @@
                        "محک",
                        "아라",
                        "Mostafadaneshvar",
-                       "Pouyana"
+                       "Pouyana",
+                       "Oldstoneage"
                ]
        },
        "tog-underline": "خط کشیدن زیر پیوندها:",
        "unknown_extension_tag": "برچسب ناشناختهٔ افزونه «$1»",
        "duplicate-defaultsort": "هشدار: ترتیب پیش‌فرض «$2» ترتیب پیش‌فرض قبلی «$1» را باطل می‌کند.",
        "duplicate-displaytitle": "<strong>هشدار:</strong> نمایش عنوان \" $2 \"باعث ابطال پیش نمایش عنوان\" $1 \" می‌شود.",
-       "version": "نسخه",
+       "version": "نسخة",
        "version-extensions": "افزونه‌های نصب‌شده",
        "version-skins": "پوسته‌های نصب شده",
        "version-specialpages": "صفحه‌های ویژه",
        "version-ext-license": "مجوزها",
        "version-ext-colheader-name": "گستره‌ها",
        "version-skin-colheader-name": "پوسته",
-       "version-ext-colheader-version": "نسخه",
+       "version-ext-colheader-version": "نسخة",
        "version-ext-colheader-license": "مجوز",
        "version-ext-colheader-description": "توصیفات",
        "version-ext-colheader-credits": "مؤلفان",
index c56948a..8203833 100644 (file)
        "sp-contributions-search": "Közreműködések szűrése",
        "sp-contributions-username": "IP-cím vagy felhasználónév:",
        "sp-contributions-toponly": "Csak a jelenleg utolsónak számító változtatásokat mutassa",
-       "sp-contributions-newonly": "Csak az új oldalt létrehozó szerkesztéseket mutassa.",
+       "sp-contributions-newonly": "Csak az új oldalt létrehozó szerkesztéseket mutassa",
        "sp-contributions-submit": "Keresés",
        "whatlinkshere": "Mi hivatkozik erre",
        "whatlinkshere-title": "A(z) „$1” lapra hivatkozó lapok",
index ccaae87..9ea3ca3 100644 (file)
        "talkpagelinktext": "Dinika",
        "specialpage": "Pejy manokana",
        "personaltools": "Fitaovana manokana",
-       "postcomment": "Hametraka fanamarihana",
        "articlepage": "Hijery ny votoatin'ny pejy",
        "talk": "dinika",
        "views": "Fijerena",
        "externaldberror": "Nisy tsy fetezana angamba teo amin'ny fanamarinana anao tamin'ny sehatra ivelan'ity wiki ity, na tsy manana alalana hanova ny kaontinao ivelany ianao.",
        "login": "Midira",
        "nav-login-createaccount": "Ampidiro ny solonanarana",
-       "loginprompt": "\nMila manaiky cookies ianao raha te hiditra amin'ny {{SITENAME}}.",
        "userlogin": "Hiditra na hanokatra kaonty",
        "userloginnocreate": "hiditra",
        "logout": "Hiala",
        "undo-summary-username-hidden": "Namafa ny famerenana $1 nataom-pikambana afenina",
        "cantcreateaccounttitle": "Tsy afaka manokatra kaonty ianao.",
        "cantcreateaccount-text": "Voasakan'i [[User:$3|$3]] ny fanokafana kaonty avy amin'ity adiresy IP (<b>$1</b>)\n\n''$2'' ny antony.",
+       "cantcreateaccount-range-text": "Nosakanan'i [[User:$3|$3]] ny fanokafana kaonty avy amin'ny adiresy IP ao amin'ny elanelana '''$1''' izay ahitana ny adiresy IP-nao ('''$4''').",
        "viewpagelogs": "Hijery ny fanovan'ity pejy ity",
        "nohistory": "Tsy manana tantaram-panovana io pejy io.",
        "currentrev": "Votoatiny ankehitriny",
        "currentrev-asof": "Endrika tamin'ity $1 ity",
        "revisionasof": "Endrik'io pejy io tamin'ny $1",
-       "revision-info": "Endrika tamin'ny $1 nataon'i $2",
+       "revision-info": "Endrika tamin'ny $1 nataon'i {{GENDER:$6|$2}}$7",
        "previousrevision": "← Endrika tranainy kokoa",
        "nextrevision": "Endrika vaovao kokoa →",
        "currentrevisionlink": "Endrika farany indrindra",
        "right-move": "Manakisaka pejy",
        "right-move-subpages": "Manakisaka pejy miarak'amin'ny zana-pejiny",
        "right-move-rootuserpages": "Mamindra ny renipejin'ny mpikambana",
+       "right-move-categorypages": "Hanetsika ny pejin-tsokajy",
        "right-movefile": "Manova anarana rakitra",
        "right-suppressredirect": "Afaka tsy manometraka redirect avy amin'ny lohateny fiavina",
        "right-upload": "Mampidi-drakitra",
        "action-createpage": "hanao pejy",
        "action-createtalk": "hanao pejin-dresaka",
        "action-createaccount": "amboary io kaontim-pikambana io",
+       "action-history": "hijery ny tantaran'ity pejy ity",
        "action-minoredit": "Mariho ho kely ity fanovana ity",
        "action-move": "hamindra io pejy io",
        "action-move-subpages": "hamindra io pejy io sy ny zanapejiny",
        "action-move-rootuserpages": "hanolo anaran'ny pejin'ny mpikambana",
+       "action-move-categorypages": "hanetsika ny pejin-tsokajy",
        "action-movefile": "manova anaran'ny rakitra iray",
        "action-upload": "hampiditra io rakitra io",
        "action-reupload": "Hanolo io rakitra efa misy io",
        "license-nopreview": "(Tsy misy topi-maso)",
        "upload_source_url": " (URL misy ary azo vangian'ny daholobe)",
        "upload_source_file": " (rakitra eo amin'ny milinao)",
+       "listfiles-delete": "fafao",
        "listfiles-summary": "Ahitana ny rakitra rehetra nampidirina ity pejy manokana ity.",
        "listfiles_search_for": "Hitady anarana media :",
        "imgfile": "rakitra",
        "listfiles_size": "Habe",
        "listfiles_description": "Visavisa",
        "listfiles_count": "Version",
+       "listfiles-show-all": "Hampiditra ny versiona talohan'ny sary",
        "listfiles-latestversion": "Filaza ankehitriny",
        "listfiles-latestversion-yes": "Eny",
        "listfiles-latestversion-no": "Tsia",
index a198956..246cdcb 100644 (file)
        "license": "Лиценцирање:",
        "license-header": "Лиценцирање",
        "nolicense": "Нема",
+       "licenses-edit": "Измени лиценцни можности",
        "license-nopreview": "(Прегледот не е достапен)",
        "upload_source_url": " (важечка, јавно достапна URL-адреса)",
        "upload_source_file": "(податотека на вашиот компјутер)",
index 40d1bee..b2e931e 100644 (file)
        "talkpagelinktext": "Diskusjon",
        "specialpage": "Spesialside",
        "personaltools": "Personlege verktøy",
-       "postcomment": "Ny bolk",
        "articlepage": "Vis innhaldsside",
        "talk": "Diskusjon",
        "views": "Visningar",
        "externaldberror": "Det var anten ein ekstern databasefeil i tilgjengekontrollen, eller du har ikkje løyve til å oppdatere den eksterne kontoen din.",
        "login": "Logg inn",
        "nav-login-createaccount": "Lag brukarkonto / logg inn",
-       "loginprompt": "Nettlesaren din må godta informasjonskapslar for at du skal kunna logge inn.",
        "userlogin": "Lag brukarkonto / logg inn",
        "userloginnocreate": "Logg inn",
        "logout": "Logg ut",
        "powersearch-togglelabel": "Hak av:",
        "powersearch-toggleall": "Alle",
        "powersearch-togglenone": "Ingen",
+       "powersearch-remember": "Hugs utvalet for framtidige søk",
        "search-external": "Eksternt søk",
        "searchdisabled": "Søkjefunksjonen på {{SITENAME}} er slått av akkurat no.\nI mellomtida kan du søkje gjennom Google.\nVer merksam på at registra deira kan vera utdaterte.",
        "search-error": "Det oppstod ein feil under søket: $1",
index e2f8066..4da7191 100644 (file)
        "movepage-page-exists": "Страница $1 већ постоји и не може се заменити.",
        "movepage-page-moved": "Страница $1 је премештена на $2.",
        "movepage-page-unmoved": "Страница $1 не може да се премести на $2.",
-       "movepage-max-pages": "Највише $1 {{PLURAL:$1|страница је премештена|странице су премештене|страница је премештено}}, и више не може да буде аутоматски премештено.",
+       "movepage-max-pages": "Највише $1 {{PLURAL:$1|страница је премештена|странице су премештене|страница је премештено}} и више не може да буде аутоматски премештено.",
        "movelogpage": "Дневник премештања",
        "movelogpagetext": "Испод се налази списак премештања страница.",
        "movesubpage": "{{PLURAL:$1|Подстраница|Подстранице}}",
        "duplicate-defaultsort": "'''Упозорење:''' подразумевани кључ сврставања „$2“ мења некадашњи кључ „$1“.",
        "version": "Верзија",
        "version-extensions": "Инсталирана проширења",
-       "version-skins": "Теме",
+       "version-skins": "Ð\98нÑ\81Ñ\82алиÑ\80ане Ñ\82еме",
        "version-specialpages": "Посебне странице",
        "version-parserhooks": "Куке рашчлањивача",
        "version-variables": "Променљиве",
index aa575c1..552272d 100644 (file)
        "movepage-page-exists": "Stranica $1 već postoji i ne može se zameniti.",
        "movepage-page-moved": "Stranica $1 je premeštena na $2.",
        "movepage-page-unmoved": "Stranica $1 ne može da se premesti na $2.",
-       "movepage-max-pages": "Najviše $1 {{PLURAL:$1|stranica je premeštena|stranice su premeštene|stranica je premešteno}}, i više ne može da bude automatski premešteno.",
+       "movepage-max-pages": "Najviše $1 {{PLURAL:$1|stranica je premeštena|stranice su premeštene|stranica je premešteno}} i više ne može da bude automatski premešteno.",
        "movelogpage": "Dnevnik premeštanja",
        "movelogpagetext": "Ispod se nalazi spisak premeštanja stranica.",
        "movesubpage": "{{PLURAL:$1|Podstranica|Podstranice}}",
index 341bf45..d6efb45 100644 (file)
        "history_short": "歷史",
        "updatedmarker": "自我最後一次訪問以後的更新",
        "printableversion": "可列印版",
-       "permalink": "固定連結",
+       "permalink": "靜態連結",
        "print": "列印",
        "view": "檢視",
        "view-foreign": "用 $1 檢視",
        "nstab-project": "專案頁面",
        "nstab-image": "檔案",
        "nstab-mediawiki": "訊息",
-       "nstab-template": "模æ\9d¿",
+       "nstab-template": "樣ç\89\88",
        "nstab-help": "說明頁面",
        "nstab-category": "分類",
        "nosuchaction": "無此動作",
index 4f854fb..5afe336 100644 (file)
@@ -1442,18 +1442,16 @@ return array(
        /* MediaWiki UI */
 
        'mediawiki.ui' => array(
-               'skinStyles' => array(
-                       'default' => 'resources/src/mediawiki.ui/default.less',
-                       'vector' => 'resources/src/mediawiki.ui/vector.less',
+               'styles' => array(
+                       'resources/src/mediawiki.ui/default.less',
                ),
                'position' => 'top',
                'targets' => array( 'desktop', 'mobile' ),
        ),
        // Lightweight module for button styles
        'mediawiki.ui.button' => array(
-               'skinStyles' => array(
-                       'default' => 'resources/src/mediawiki.ui/components/default/buttons.less',
-                       'vector' => 'resources/src/mediawiki.ui/components/vector/buttons.less',
+               'styles' => array(
+                       'resources/src/mediawiki.ui/components/buttons.less',
                ),
                'position' => 'top',
                'targets' => array( 'desktop', 'mobile' ),
diff --git a/resources/src/mediawiki.less/mediawiki.ui/mixins.less b/resources/src/mediawiki.less/mediawiki.ui/mixins.less
new file mode 100644 (file)
index 0000000..bda4043
--- /dev/null
@@ -0,0 +1,147 @@
+// ----------------------------------------------------------------------------
+// Form styling mixins
+// ----------------------------------------------------------------------------
+
+// Font is not included.
+.agora-field-styling() {
+
+       border: 1px solid @colorGrayLight;
+
+       &:focus {
+               // Styling focus of native checkboxes etc on Mac is almost impossible.
+               &:not([type=checkbox]):not([type=radio]) {
+                       outline: 0; // Removes OS field focus
+               }
+
+               box-shadow: @colorProgressiveShadow 0 0 5px;
+
+               border-color: @colorProgressiveShadow;
+       }
+
+       color: @colorText;
+       padding: 0.35em 0.5em 0.35em 0.5em;
+
+       // Ensure that buttons and inputs are nicely aligned when they have differing heights
+       vertical-align: middle;
+}
+
+.agora-label-styling() {
+       //font-weight: bold;
+       font-size: 0.9em;
+       color: darken(@colorGrayLight, 50%);
+
+       * {
+               font-weight: normal;
+       }
+}
+
+.agora-inline-label-styling() {
+       margin-bottom: 0.5em;
+       cursor: pointer;
+       vertical-align: bottom;
+       line-height: normal;
+
+       font-weight: normal;
+
+       & > input[type="checkbox"],
+       & > input[type="radio"] {
+               width: auto;
+               height: auto;
+               margin: 0 0.1em 0 0;
+               padding: 0;
+               border: 1px solid @colorGrayLight;
+               cursor: pointer;
+       }
+}
+
+// ----------------------------------------------------------------------------
+// Button styling
+// ----------------------------------------------------------------------------
+
+.button-colors(@bgColor) {
+       background: @bgColor;
+
+       &:hover,
+       &:focus {
+               // The inner bottom bevel should match the active background color.
+               box-shadow: 0 1px rgba(0, 0, 0, 10%), inset 0 -3px rgba(0, 0, 0, 20%);
+               border-bottom-color: mix(#000, @bgColor, 20%);
+               outline: none;
+               // remove outline in Firefox
+               &::-moz-focus-inner {
+                       border-color: transparent;
+               }
+       }
+
+       &:active,
+       &.mw-ui-checked {
+               // lessphp doesn't implement shade (https://github.com/leafo/lessphp/issues/528);
+               // it passes it through, then ResourceLoader drops it.
+               // background: shade(@bgColor, 20%);
+               background: mix(#000, @bgColor, 20%);
+               box-shadow: none;
+       }
+}
+
+.button-colors(@bgColor) when (lightness(@bgColor) >= 70%) {
+       color: @colorGrayDark;
+       border: 1px solid @colorGrayLight;
+
+       &:disabled {
+               color: @colorGrayLight;
+
+               // make sure disabled buttons don't have hover and active states
+               &:hover,
+               &:active {
+                       background: @bgColor;
+                       box-shadow: none;
+               }
+       }
+}
+
+.button-colors(@bgColor) when (lightness(@bgColor) < 70%) {
+       color: @colorWhite;
+       // border of the same color as background so that light background and
+       // dark background buttons are the same height (only top and bottom to
+       // make box shadow on hover cover the corners too)
+       border: 1px solid @bgColor;
+       border-left: none;
+       border-right: none;
+       text-shadow: 0 1px rgba(0, 0, 0, .1);
+
+       &:disabled {
+               background: @colorGrayLight;
+               border-color: @colorGrayLight;
+
+               // make sure disabled buttons don't have hover and active states
+               &:hover,
+               &:active,
+               &.mw-ui-checked {
+                       box-shadow: none;
+               }
+       }
+}
+
+.button-colors-quiet(@textColor) {
+       // Quiet buttons all start gray, and reveal
+       // constructive/progressive/destructive color on hover and active.
+       color: @colorGrayDark;
+
+       &:hover,
+       &:focus {
+               // lessphp doesn't implement tint, see above
+               // color: tint(@textColor, 20%);
+               color: mix(#fff, @textColor, 20%);
+       }
+
+       &:active,
+       &.mw-ui-checked {
+               // lessphp doesn't implement shade, see above
+               // color: shade(@textColor, 20%);
+               color: mix(#000, @textColor, 20%);
+       }
+
+       &:disabled {
+               color: @colorGrayLight;
+       }
+}
diff --git a/resources/src/mediawiki.less/mediawiki.ui/variables.less b/resources/src/mediawiki.less/mediawiki.ui/variables.less
new file mode 100644 (file)
index 0000000..ccf869d
--- /dev/null
@@ -0,0 +1,37 @@
+@baseFontSize: 1em;
+
+// FIXME: remove @colorProgressiveShadow (shadows should be generated
+// in LESS by dimming the original colors)
+@colorProgressiveShadow: #4091ed;
+
+// White; for background use, and text use on dark backgrounds
+@colorWhite: #fff;
+// Off-white; for background use on white backgrounds
+@colorOffWhite: #fafafa;
+// Dark gray; for non-text use
+@colorGrayDark: #898989;
+// Light gray; for non-text use
+@colorGrayLight: #ccc;
+// Very light gray; for non-text use
+@colorGrayLighter: #ddd;
+// Lightest gray; for non-text use
+@colorGrayLightest: #eee;
+
+// Dark gray; for body text
+@colorText: #252525;
+// Light gray; for less important body text and links
+@colorTextLight: #696969;
+
+// Blue; for contextual use of a continuing action
+@colorProgressive: #347bff;
+// Orange; for contextual use of returning to a past action
+@colorRegressive: #ff7e1e;
+// Green; for contextual use of a positive finalizing action
+@colorConstructive: #00af89;
+// Red; for contextual use of a negative finalizing action
+@colorDestructive: #d11d13;
+
+// Used in mixins to darken contextual colors by the same amount (eg. focus)
+@colorDarkenPercentage: 13.5%;
+// Used in mixins to lighten contextual colors by the same amount (eg. hover)
+@colorLightenPercentage: 13.5%;
\ No newline at end of file
diff --git a/resources/src/mediawiki.ui/components/buttons.less b/resources/src/mediawiki.ui/components/buttons.less
new file mode 100644 (file)
index 0000000..ec08413
--- /dev/null
@@ -0,0 +1,227 @@
+@import "mediawiki.mixins";
+@import "mediawiki.ui/variables";
+@import "mediawiki.ui/mixins";
+
+// Buttons
+//
+// All buttons start with mw-ui-button class, modified by other classes.
+// It can be any element.  Due to a lack of a CSS reset, the exact styling of
+// the button depends on what type of element is used.
+// There are two kinds of buttons, the default is a "Call to Action" with an obvious border
+// and there is a quiet kind without a border.
+//
+// Styleguide 2.
+
+@buttonBorderRadius: 3px;
+@transitionDuration: .1s;
+@transitionFunction: ease-in-out;
+
+// Neutral button styling
+//
+// Markup:
+// <button class="mw-ui-button">.mw-ui-button</button>
+// <button class="mw-ui-button" disabled>.mw-ui-button</button>
+//
+// Styleguide 2.1.
+.mw-ui-button {
+       // Container layout
+       display: inline-block;
+       padding: .5em 1em;
+       margin: 0;
+       .box-sizing(border-box);
+
+       // Disable weird iOS styling
+       -webkit-appearance: none;
+
+       // IE6/IE7 hack
+       // http://stackoverflow.com/a/5838575/365238
+       *display: inline;
+       zoom: 1;
+
+       // Container styling
+       .button-colors(@colorWhite);
+       border-radius: @buttonBorderRadius;
+
+       // Ensure that buttons and inputs are nicely aligned when they have differing heights
+       vertical-align: middle;
+
+       // Content styling
+       text-align: center;
+       font-weight: bold;
+
+       // Interaction styling
+       cursor: pointer;
+
+       &:disabled {
+               text-shadow: none;
+               cursor: default;
+       }
+
+       .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
+
+       // Styling for specific button types
+       // -----------------------------------------
+
+       // Big buttons
+       //
+       // Not all buttons are equal. You can emphasise certain actions over others
+       // using the mw-ui-big class.
+       //
+       // Markup:
+       // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
+       // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
+       // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
+       // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
+       //
+       // Styleguide 2.1.6.
+       &.mw-ui-big {
+               font-size: @baseFontSize * 1.3;
+       }
+
+       // Block buttons
+       //
+       // Some buttons might need to be stacked.
+       //
+       // Markup:
+       // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
+       // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
+       // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
+       // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
+       //
+       // Styleguide 2.1.5.
+       &.mw-ui-block {
+               display: block;
+               width: 100%;
+       }
+
+       // Progressive buttons
+       //
+       // Use progressive buttons for actions which lead to a next step in the process.
+       // .mw-ui-primary is deprecated, kept for compatibility.
+       //
+       // Markup:
+       // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
+       // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
+       //
+       // Styleguide 2.1.1.
+       &.mw-ui-progressive,
+       &.mw-ui-primary {
+               .button-colors(@colorProgressive);
+
+               &.mw-ui-quiet {
+                       .button-colors-quiet(@colorProgressive);
+               }
+       }
+
+       // Constructive buttons
+       //
+       // Use constructive buttons for actions which result in a final action in the process that results
+       // in a change of state.
+       // e.g. save changes button
+       //
+       // Markup:
+       // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
+       // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
+       //
+       // Styleguide 2.1.2.
+       &.mw-ui-constructive {
+               .button-colors(@colorConstructive);
+
+               &.mw-ui-quiet {
+                       .button-colors-quiet(@colorConstructive);
+               }
+       }
+
+       // Destructive buttons
+       //
+       // Use destructive buttons for actions which result in the destruction of data.
+       // e.g. deleting a page.
+       // This should not be used for cancel buttons.
+       //
+       // Markup:
+       // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
+       // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
+       //
+       // Styleguide 2.1.3.
+       &.mw-ui-destructive {
+               .button-colors(@colorDestructive);
+
+               &.mw-ui-quiet {
+                       .button-colors-quiet(@colorDestructive);
+               }
+       }
+
+       // Quiet buttons
+       //
+       // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
+       //
+       // Markup:
+       // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
+       // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
+       // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
+       // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
+       // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
+       // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
+       // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
+       //
+       // Styleguide 2.1.4.
+       &.mw-ui-quiet {
+               background: transparent;
+               border: none;
+               text-shadow: none;
+               .button-colors-quiet(@colorGrayDark);
+
+               &:hover,
+               &:focus {
+                       box-shadow: none;
+               }
+
+               &:active,
+               &:disabled {
+                       background: transparent;
+               }
+       }
+}
+
+a.mw-ui-button {
+       text-decoration: none;
+
+       // This overrides an underline declaration on a:hover and a:focus in
+       // commonElements.css, which the class alone isn't specific enough to do.
+       &:hover,
+       &:focus {
+               text-decoration: none;
+       }
+}
+
+// Button groups
+//
+// Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
+//
+// Markup:
+// <div class="mw-ui-button-group">
+//   <div class="mw-ui-button">A</div>
+//   <div class="mw-ui-button">B</div>
+//   <div class="mw-ui-button">C</div>
+//   <div class="mw-ui-button">D</div>
+// </div><div style="clear:both"></div>
+//
+// Styleguide 2.2.
+.mw-ui-button-group > * {
+       border-radius: 0;
+       float: left;
+
+       &:first-child {
+               border-top-left-radius: @buttonBorderRadius;
+               border-bottom-left-radius: @buttonBorderRadius;
+       }
+
+       &:not(:first-child) {
+               border-left: none;
+       }
+
+       &:last-child{
+               border-top-right-radius: @buttonBorderRadius;
+               border-bottom-right-radius: @buttonBorderRadius;
+       }
+}
diff --git a/resources/src/mediawiki.ui/components/default/buttons.less b/resources/src/mediawiki.ui/components/default/buttons.less
deleted file mode 100644 (file)
index dce4cd0..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-@import "mediawiki.mixins";
-@import "../../settings/typography";
-@import "../../mixins/effects";
-@import "../../mixins/utilities";
-
-// Buttons
-//
-// All buttons start with mw-ui-button class, modified by other classes.
-// It can be any element.  Due to a lack of a CSS reset, the exact styling of
-// the button depends on what type of element is used.
-// There are two kinds of buttons, the default is a "Call to Action" with an obvious border
-// and there is a quiet kind without a border.
-//
-// Styleguide 2.
-
-@buttonBorderRadius: 3px;
-@transitionDuration: .1s;
-@transitionFunction: ease-in-out;
-
-// Neutral button styling
-//
-// Markup:
-// <button class="mw-ui-button">.mw-ui-button</button>
-// <button class="mw-ui-button" disabled>.mw-ui-button</button>
-//
-// Styleguide 2.1.
-.mw-ui-button {
-       // Container layout
-       display: inline-block;
-       padding: .5em 1em;
-       margin: 0;
-       .box-sizing(border-box);
-
-       // Disable weird iOS styling
-       -webkit-appearance: none;
-
-       // IE6/IE7 hack
-       // http://stackoverflow.com/a/5838575/365238
-       *display: inline;
-       zoom: 1;
-
-       // Container styling
-       .button-colors(@colorWhite);
-       border-radius: @buttonBorderRadius;
-
-       // Ensure that buttons and inputs are nicely aligned when they have differing heights
-       vertical-align: middle;
-
-       // Content styling
-       text-align: center;
-       font-weight: bold;
-
-       // Interaction styling
-       cursor: pointer;
-
-       &:disabled {
-               text-shadow: none;
-               cursor: default;
-       }
-
-       .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
-
-       // Styling for specific button types
-       // -----------------------------------------
-
-       // Big buttons
-       //
-       // Not all buttons are equal. You can emphasise certain actions over others
-       // using the mw-ui-big class.
-       //
-       // Markup:
-       // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
-       // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
-       // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
-       // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
-       //
-       // Styleguide 2.1.6.
-       &.mw-ui-big {
-               font-size: @baseFontSize * 1.3;
-       }
-
-       // Block buttons
-       //
-       // Some buttons might need to be stacked.
-       //
-       // Markup:
-       // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
-       // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
-       // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
-       // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
-       //
-       // Styleguide 2.1.5.
-       &.mw-ui-block {
-               display: block;
-               width: 100%;
-       }
-
-       // Progressive buttons
-       //
-       // Use progressive buttons for actions which lead to a next step in the process.
-       // .mw-ui-primary is deprecated, kept for compatibility.
-       //
-       // Markup:
-       // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
-       // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
-       //
-       // Styleguide 2.1.1.
-       &.mw-ui-progressive,
-       &.mw-ui-primary {
-               .button-colors(@colorProgressive);
-
-               &.mw-ui-quiet {
-                       .button-colors-quiet(@colorProgressive);
-               }
-       }
-
-       // Constructive buttons
-       //
-       // Use constructive buttons for actions which result in a final action in the process that results
-       // in a change of state.
-       // e.g. save changes button
-       //
-       // Markup:
-       // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
-       // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
-       //
-       // Styleguide 2.1.2.
-       &.mw-ui-constructive {
-               .button-colors(@colorConstructive);
-
-               &.mw-ui-quiet {
-                       .button-colors-quiet(@colorConstructive);
-               }
-       }
-
-       // Destructive buttons
-       //
-       // Use destructive buttons for actions which result in the destruction of data.
-       // e.g. deleting a page.
-       // This should not be used for cancel buttons.
-       //
-       // Markup:
-       // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
-       // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
-       //
-       // Styleguide 2.1.3.
-       &.mw-ui-destructive {
-               .button-colors(@colorDestructive);
-
-               &.mw-ui-quiet {
-                       .button-colors-quiet(@colorDestructive);
-               }
-       }
-
-       // Quiet buttons
-       //
-       // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
-       //
-       // Markup:
-       // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
-       // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
-       // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
-       // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
-       // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
-       // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
-       // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
-       //
-       // Styleguide 2.1.4.
-       &.mw-ui-quiet {
-               background: transparent;
-               border: none;
-               text-shadow: none;
-               .button-colors-quiet(@colorGrayDark);
-
-               &:hover,
-               &:focus {
-                       box-shadow: none;
-               }
-
-               &:active,
-               &:disabled {
-                       background: transparent;
-               }
-       }
-}
-
-a.mw-ui-button {
-       text-decoration: none;
-
-       // This overrides an underline declaration on a:hover and a:focus in
-       // commonElements.css, which the class alone isn't specific enough to do.
-       &:hover,
-       &:focus {
-               text-decoration: none;
-       }
-}
-
-// Button groups
-//
-// Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
-//
-// Markup:
-// <div class="mw-ui-button-group">
-//   <div class="mw-ui-button">A</div>
-//   <div class="mw-ui-button">B</div>
-//   <div class="mw-ui-button">C</div>
-//   <div class="mw-ui-button">D</div>
-// </div><div style="clear:both"></div>
-//
-// Styleguide 2.2.
-.mw-ui-button-group > * {
-       border-radius: 0;
-       float: left;
-
-       &:first-child {
-               border-top-left-radius: @buttonBorderRadius;
-               border-bottom-left-radius: @buttonBorderRadius;
-       }
-
-       &:not(:first-child) {
-               border-left: none;
-       }
-
-       &:last-child{
-               border-top-right-radius: @buttonBorderRadius;
-               border-bottom-right-radius: @buttonBorderRadius;
-       }
-}
diff --git a/resources/src/mediawiki.ui/components/default/forms.less b/resources/src/mediawiki.ui/components/default/forms.less
deleted file mode 100644 (file)
index 6c40c26..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-// Form elements and layouts
-
-@import "mediawiki.mixins";
-@import "../../mixins/utilities";
-@import "../../mixins/forms";
-
-// --------------------------------------------------------------------------
-// Layouts
-// --------------------------------------------------------------------------
-
-// The FancyCaptcha image CAPTCHA used on WMF wikis drives the width of the
-// 'VForm' design, the form can't be narrower than this.
-@captchaContainerWidth: 290px;
-@defaultFormWidth: @captchaContainerWidth;
-
-// Forms
-//
-// Styleguide 3.
-
-// VForm
-//
-// Style a compact vertical stacked form ("VForm") and the elements in divs
-// within it. See button section on guidance of how and when to use mw-ui-constructive.
-//
-// Markup:
-// <form class="mw-ui-vform">
-//   <div class="mw-ui-vform-field">This is a form example.</div>
-//   <div class="mw-ui-vform-field">
-//     <label>Username </label>
-//     <input value="input">
-//   </div>
-//   <div class="mw-ui-vform-field">
-//     <button class="mw-ui-button mw-ui-constructive">Button in vform</button>
-//   </div>
-// </form>
-//
-// Styleguide 3.1.
-.mw-ui-vform {
-       .box-sizing(border-box);
-
-       width: @defaultFormWidth;
-
-       // MW currently doesn't use the type attribute everywhere on inputs.
-       input,
-       select,
-       .mw-ui-button {
-               display: block;
-               .box-sizing(border-box);
-               margin: 0;
-               width: 100%;
-       }
-
-       // We exclude buttons because they'll generally use mw-ui-button.
-       // Otherwise, we'll unintentionally override that.
-       input:not([type=button]):not([type=submit]):not([type=file]) {
-               .agora-field-styling(); // mixins/forms.less
-       }
-
-       // Give dropdown lists the same spacing as input fields for consistency.
-       // Values taken from .agora-field-styling() in mixins/form.less
-       select {
-               padding: 0.35em 0.5em 0.35em 0.5em;
-               vertical-align: middle;
-       }
-
-       label {
-               display: block;
-               .box-sizing(border-box);
-               .agora-label-styling();
-               width: auto;
-               margin: 0 0 0.2em;
-               padding: 0;
-       }
-
-       // Override input styling just for checkboxes and radio inputs.
-       input[type="checkbox"],
-       input[type="radio"] {
-               display: inline;
-               .box-sizing(content-box);
-               width: auto;
-       }
-
-
-       // Styles for information boxes
-       //
-       // Regular HTMLForm uses .error class, some special pages like
-       // SpecialUserlogin (login and create account) use .errorbox.
-       //
-       // Markup:
-       // <form class="mw-ui-vform">
-       //   <div class="errorbox">An error occurred</div>
-       //   <div class="warningbox">A warning to be noted</div>
-       //   <div class="successbox">Action successful!</div>
-       //   <div class="error">A different kind of error</div>
-       //   <div class="error">
-       //     <ul><li>There are problems with some of your input.</li></ul>
-       //   </div>
-       //   <div class="mw-ui-vform-field">
-       //     <input type="text" value="input" class="mw-ui-input">
-       //   </div>
-       //   <div class="mw-ui-vform-field">
-       //     <select>
-       //       <option value="1">Option 1</option>
-       //       <option value="2">Option 2</option>
-       //     </select>
-       //     <span class="error">The value you specified is not a valid option.</span>
-       //   </div>
-       //   <div class="mw-ui-vform-field">
-       //     <button class="mw-ui-button">Button in vform</button>
-       //   </div>
-       // </form>
-       //
-       // Styleguide 3.1.
-       .error,
-       .errorbox,
-       .warningbox,
-       .successbox {
-               .box-sizing(border-box);
-               font-size: 0.9em;
-               margin: 0 0 1em 0;
-               padding: 0.5em;
-               word-wrap: break-word;
-       }
-
-       // Colours taken from those for .errorbox in skins/common/shared.css
-       .error {
-               color: #cc0000;
-               border: 1px solid #fac5c5;
-               background-color: #fae3e3;
-               text-shadow: 0 1px #fae3e3;
-       }
-
-       // This specifies styling for individual field validation error messages.
-       // Show them below the fields to prevent line break glitches, and leave
-       // some space between the field and the error message box.
-       .mw-ui-vform-div .error, /* for backwards-compatibility, remove before 1.24 */
-       .mw-ui-vform-field .error {
-               display: block;
-               margin-top: 5px;
-       }
-
-}
-
-// --------------------------------------------------------------------------
-// Elements
-// --------------------------------------------------------------------------
-
-// A wrapper for a single form field: the <input> / <select> / <button> element,
-// help text, labels, associated error/warning/success messages, and so on.
-// Elements with this class are generated by HTMLFormField in core MediaWiki.
-//
-// (We use a broad definition of 'field' here: a purely textual information
-// block is also a "field".)
-.mw-ui-vform-div, /* for backwards-compatibility, remove before 1.24 */
-.mw-ui-vform-field {
-       display: block;
-       margin: 0 0 15px;
-       padding: 0;
-       width: 100%;
-}
-
-// Apply mw-ui-input to individual input fields to style them.
-// You generally don't need to use this class if <input> is within an Agora
-// form container such as mw-ui-vform
-.mw-ui-input {
-       .agora-field-styling(); // mixins/forms.less
-}
-
-// Apply mw-ui-label to individual elements to style them.
-// You generally don't need to use this class if <label> is within an Agora
-// form container such as mw-ui-vform
-.mw-ui-label {
-       .agora-label-styling(); // mixins/forms.less
-}
-
-// Nesting an input checkbox or radio button inside a label with this class
-// improves alignment, e.g.
-//     <label class="mw-ui-checkbox-label">
-//             <input type="checkbox">The label text
-//     </label>
-.mw-ui-checkbox-label, .mw-ui-radio-label {
-       .agora-inline-label-styling();
-}
diff --git a/resources/src/mediawiki.ui/components/forms.less b/resources/src/mediawiki.ui/components/forms.less
new file mode 100644 (file)
index 0000000..2e586a6
--- /dev/null
@@ -0,0 +1,190 @@
+// Form elements and layouts
+
+@import "mediawiki.mixins";
+@import "mediawiki.ui/variables";
+@import "mediawiki.ui/mixins";
+
+// --------------------------------------------------------------------------
+// Layouts
+// --------------------------------------------------------------------------
+
+// The FancyCaptcha image CAPTCHA used on WMF wikis drives the width of the
+// 'VForm' design, the form can't be narrower than this.
+@captchaContainerWidth: 290px;
+@defaultFormWidth: @captchaContainerWidth;
+
+// Forms
+//
+// Styleguide 3.
+
+// VForm
+//
+// Style a compact vertical stacked form ("VForm") and the elements in divs
+// within it. See button section on guidance of how and when to use mw-ui-constructive.
+//
+// Markup:
+// <form class="mw-ui-vform">
+//   <div class="mw-ui-vform-field">This is a form example.</div>
+//   <div class="mw-ui-vform-field">
+//     <label>Username </label>
+//     <input value="input">
+//   </div>
+//   <div class="mw-ui-vform-field">
+//     <button class="mw-ui-button mw-ui-constructive">Button in vform</button>
+//   </div>
+// </form>
+//
+// Styleguide 3.1.
+.mw-ui-vform {
+       .box-sizing(border-box);
+
+       width: @defaultFormWidth;
+
+       // MW currently doesn't use the type attribute everywhere on inputs.
+       input,
+       select,
+       .mw-ui-button {
+               display: block;
+               .box-sizing(border-box);
+               margin: 0;
+               width: 100%;
+       }
+
+       // We exclude buttons because they'll generally use mw-ui-button.
+       // Otherwise, we'll unintentionally override that.
+       input:not([type=button]):not([type=submit]):not([type=file]) {
+               .agora-field-styling(); // mixins/forms.less
+       }
+
+       // Give dropdown lists the same spacing as input fields for consistency.
+       // Values taken from .agora-field-styling() in mixins/form.less
+       select {
+               padding: 0.35em 0.5em 0.35em 0.5em;
+               vertical-align: middle;
+       }
+
+       label {
+               display: block;
+               .box-sizing(border-box);
+               .agora-label-styling();
+               width: auto;
+               margin: 0 0 0.2em;
+               padding: 0;
+       }
+
+       // Override input styling just for checkboxes and radio inputs.
+       input[type="checkbox"],
+       input[type="radio"] {
+               display: inline;
+               .box-sizing(content-box);
+               width: auto;
+       }
+
+
+       // Styles for information boxes
+       //
+       // Regular HTMLForm uses .error class, some special pages like
+       // SpecialUserlogin (login and create account) use .errorbox.
+       //
+       // Markup:
+       // <form class="mw-ui-vform">
+       //   <div class="errorbox">An error occurred</div>
+       //   <div class="warningbox">A warning to be noted</div>
+       //   <div class="successbox">Action successful!</div>
+       //   <div class="error">A different kind of error</div>
+       //   <div class="error">
+       //     <ul><li>There are problems with some of your input.</li></ul>
+       //   </div>
+       //   <div class="mw-ui-vform-field">
+       //     <input type="text" value="input" class="mw-ui-input">
+       //   </div>
+       //   <div class="mw-ui-vform-field">
+       //     <select>
+       //       <option value="1">Option 1</option>
+       //       <option value="2">Option 2</option>
+       //     </select>
+       //     <span class="error">The value you specified is not a valid option.</span>
+       //   </div>
+       //   <div class="mw-ui-vform-field">
+       //     <button class="mw-ui-button">Button in vform</button>
+       //   </div>
+       // </form>
+       //
+       // Styleguide 3.1.
+       .error,
+       .errorbox,
+       .warningbox,
+       .successbox {
+               .box-sizing(border-box);
+               font-size: 0.9em;
+               margin: 0 0 1em 0;
+               padding: 0.5em;
+               word-wrap: break-word;
+       }
+
+       // Colours taken from those for .errorbox in skins/common/shared.css
+       .error {
+               color: #cc0000;
+               border: 1px solid #fac5c5;
+               background-color: #fae3e3;
+               text-shadow: 0 1px #fae3e3;
+       }
+
+       // This specifies styling for individual field validation error messages.
+       // Show them below the fields to prevent line break glitches, and leave
+       // some space between the field and the error message box.
+       .mw-ui-vform-div .error, /* for backwards-compatibility, remove before 1.24 */
+       .mw-ui-vform-field .error {
+               display: block;
+               margin-top: 5px;
+       }
+
+}
+
+// --------------------------------------------------------------------------
+// Elements
+// --------------------------------------------------------------------------
+
+// A wrapper for a single form field: the <input> / <select> / <button> element,
+// help text, labels, associated error/warning/success messages, and so on.
+// Elements with this class are generated by HTMLFormField in core MediaWiki.
+//
+// (We use a broad definition of 'field' here: a purely textual information
+// block is also a "field".)
+.mw-ui-vform-div, /* for backwards-compatibility, remove before 1.24 */
+.mw-ui-vform-field {
+       display: block;
+       margin: 0 0 15px;
+       padding: 0;
+       width: 100%;
+
+       input {
+               font-size: 1em;
+               line-height: 1.4;
+       }
+}
+
+// Apply mw-ui-input to individual input fields to style them.
+// You generally don't need to use this class if <input> is within an Agora
+// form container such as mw-ui-vform
+.mw-ui-input {
+       .agora-field-styling(); // mixins/forms.less
+       font-size: 1em;
+       line-height: 1.4em;
+}
+
+// Apply mw-ui-label to individual elements to style them.
+// You generally don't need to use this class if <label> is within an Agora
+// form container such as mw-ui-vform
+.mw-ui-label {
+       .agora-label-styling(); // mixins/forms.less
+}
+
+// Nesting an input checkbox or radio button inside a label with this class
+// improves alignment, e.g.
+//     <label class="mw-ui-checkbox-label">
+//             <input type="checkbox">The label text
+//     </label>
+.mw-ui-checkbox-label, .mw-ui-radio-label {
+       .agora-inline-label-styling();
+}
index 9aea429..ccfb677 100644 (file)
@@ -1,19 +1,55 @@
-// Generic helper classes that could be used in many elements/layouts
-
-// --------------------------------------------------------------------------
-// Positioning
-// --------------------------------------------------------------------------
-
-@import "../mixins/utilities";
+// Utilities
+//
+// Other things which effect the behaviour of components
+//
+// Styleguide 4.
 
+// Flush left
+//
+// Used when you want to push an element to the left of its containing element
+//
+// Markup:
+// <div class="mw-ui-vform-field">
+//   <label>Username <a href="#" class="mw-ui-flush-left">?</a></label>
+//   <input>
+// </div>
+//
+// Styleguide 4.1.
 .mw-ui-flush-left {
-       .agora-flush-left();
+       float: left;
+       margin-left: 0;
+       padding-left: 0;
 }
 
+// Flush right
+//
+// Used when you want to push an element to the right of its containing element
+//
+// Markup:
+// <div class="mw-ui-vform-field">
+//   <label>Username <a href="#" class="mw-ui-flush-right">?</a></label>
+//   <input>
+// </div>
+//
+// Styleguide 4.2.
 .mw-ui-flush-right {
-       .agora-flush-right();
+       float: right;
+       padding-right: 0;
+       margin-right: 0;
 }
 
+// Center block
+//
+// Centers the element in its containing element
+//
+// Markup:
+// <div>
+//   <button class="mw-ui-center-block">click me</button>
+// </div>
+//
+// Styleguide 4.3.
 .mw-ui-center-block {
-       .agora-center-block();
+       display: block;
+       margin-left: auto;
+       margin-right: auto;
 }
diff --git a/resources/src/mediawiki.ui/components/vector/buttons.less b/resources/src/mediawiki.ui/components/vector/buttons.less
deleted file mode 100644 (file)
index 1536338..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-@import "../default/buttons"; // Layer Vector on top of the default settings.
-@import "../../mixins/type";
-
-.mw-ui-button {
-       .vector-type();
-}
diff --git a/resources/src/mediawiki.ui/components/vector/containers.less b/resources/src/mediawiki.ui/components/vector/containers.less
deleted file mode 100644 (file)
index 1e9ec05..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// No default settings for containers yet.
-@import "../../mixins/type";
-
-.mw-ui-container {
-       .vector-type();
-}
diff --git a/resources/src/mediawiki.ui/components/vector/forms.less b/resources/src/mediawiki.ui/components/vector/forms.less
deleted file mode 100644 (file)
index 2bbd8f0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-@import "../default/forms"; // Layer Vector on top of the default settings.
-@import "../../mixins/type";
-
-.mw-ui-vform,
-.mw-ui-vform input,
-.mw-ui-input {
-       .vector-type();
-}
index e576937..d21b814 100644 (file)
@@ -1,7 +1,6 @@
 /**
- * Provide Agora appearance for mw-ui-* classes when using a skin other than
- * Vector.
+ * Provide Agora appearance for mw-ui-* classes.
  */
 
+@import "components/forms";
 @import "components/utilities";
-@import "components/default/forms";
diff --git a/resources/src/mediawiki.ui/mixins/effects.less b/resources/src/mediawiki.ui/mixins/effects.less
deleted file mode 100644 (file)
index 9759f63..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-@import "../settings/colors";
-// ----------------------------------------------------------------------------
-// Button styling
-// ----------------------------------------------------------------------------
-
-.button-colors(@bgColor) {
-       background: @bgColor;
-
-       &:hover,
-       &:focus {
-               // The inner bottom bevel should match the active background color.
-               box-shadow: 0 1px rgba(0, 0, 0, 10%), inset 0 -3px rgba(0, 0, 0, 20%);
-               border-bottom-color: mix(#000, @bgColor, 20%);
-               outline: none;
-               // remove outline in Firefox
-               &::-moz-focus-inner {
-                       border-color: transparent;
-               }
-       }
-
-       &:active,
-       &.mw-ui-checked {
-               // lessphp doesn't implement shade (https://github.com/leafo/lessphp/issues/528);
-               // it passes it through, then ResourceLoader drops it.
-               // background: shade(@bgColor, 20%);
-               background: mix(#000, @bgColor, 20%);
-               box-shadow: none;
-       }
-}
-
-.button-colors(@bgColor) when (lightness(@bgColor) >= 70%) {
-       color: @colorGrayDark;
-       border: 1px solid @colorGrayLight;
-
-       &:disabled {
-               color: @colorGrayLight;
-
-               // make sure disabled buttons don't have hover and active states
-               &:hover,
-               &:active {
-                       background: @bgColor;
-                       box-shadow: none;
-               }
-       }
-}
-
-.button-colors(@bgColor) when (lightness(@bgColor) < 70%) {
-       color: @colorWhite;
-       // border of the same color as background so that light background and
-       // dark background buttons are the same height (only top and bottom to
-       // make box shadow on hover cover the corners too)
-       border: 1px solid @bgColor;
-       border-left: none;
-       border-right: none;
-       text-shadow: 0 1px rgba(0, 0, 0, .1);
-
-       &:disabled {
-               background: @colorGrayLight;
-               border-color: @colorGrayLight;
-
-               // make sure disabled buttons don't have hover and active states
-               &:hover,
-               &:active,
-               &.mw-ui-checked {
-                       box-shadow: none;
-               }
-       }
-}
-
-.button-colors-quiet(@textColor) {
-       // Quiet buttons all start gray, and reveal
-       // constructive/progressive/destructive color on hover and active.
-       color: @colorGrayDark;
-
-       &:hover,
-       &:focus {
-               // lessphp doesn't implement tint, see above
-               // color: tint(@textColor, 20%);
-               color: mix(#fff, @textColor, 20%);
-       }
-
-       &:active,
-       &.mw-ui-checked {
-               // lessphp doesn't implement shade, see above
-               // color: shade(@textColor, 20%);
-               color: mix(#000, @textColor, 20%);
-       }
-
-       &:disabled {
-               color: @colorGrayLight;
-       }
-}
diff --git a/resources/src/mediawiki.ui/mixins/forms.less b/resources/src/mediawiki.ui/mixins/forms.less
deleted file mode 100644 (file)
index 20f42a0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-@import "../settings/colors";
-
-// Font is not included.
-// For Vector, that should be layered on top with vector-type
-.agora-field-styling() {
-
-       border: 1px solid @colorGrayLight;
-
-       &:focus {
-               // Styling focus of native checkboxes etc on Mac is almost impossible.
-               &:not([type=checkbox]):not([type=radio]) {
-                       outline: 0; // Removes OS field focus
-               }
-
-               box-shadow: @colorProgressiveShadow 0 0 5px;
-
-               border-color: @colorProgressiveShadow;
-       }
-
-       color: @colorText;
-       padding: 0.35em 0.5em 0.35em 0.5em;
-
-       // Ensure that buttons and inputs are nicely aligned when they have differing heights
-       vertical-align: middle;
-}
-
-.agora-label-styling() {
-       //font-weight: bold;
-       font-size: 0.9em;
-       color: darken(@colorGrayLight, 50%);
-
-       * {
-               font-weight: normal;
-       }
-}
-
-.agora-inline-label-styling() {
-       margin-bottom: 0.5em;
-       cursor: pointer;
-       vertical-align: bottom;
-       line-height: normal;
-
-       font-weight: normal;
-
-       & > input[type="checkbox"],
-       & > input[type="radio"] {
-               width: auto;
-               height: auto;
-               margin: 0 0.1em 0 0;
-               padding: 0;
-               border: 1px solid @colorGrayLight;
-               cursor: pointer;
-       }
-}
diff --git a/resources/src/mediawiki.ui/mixins/type.less b/resources/src/mediawiki.ui/mixins/type.less
deleted file mode 100644 (file)
index 4a01168..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-@import "../settings/typography";
-
-.vector-type() {
-       font-size: @baseFontSize;
-       line-height: @baseLineHeight;
-}
diff --git a/resources/src/mediawiki.ui/mixins/utilities.less b/resources/src/mediawiki.ui/mixins/utilities.less
deleted file mode 100644 (file)
index 3d7b732..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-.agora-flush-left() {
-       float: left;
-       margin-left: 0;
-       padding-left: 0;
-}
-
-.agora-flush-right() {
-       float: right;
-       margin-right: 0;
-       padding-right: 0;
-}
-
-.agora-center-block() {
-       display: block;
-       margin-left: auto;
-       margin-right: auto;
-}
diff --git a/resources/src/mediawiki.ui/settings/colors.less b/resources/src/mediawiki.ui/settings/colors.less
deleted file mode 100644 (file)
index d456f86..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// FIXME: remove @colorProgressiveShadow (shadows should be generated
-// in LESS by dimming the original colors)
-@colorProgressiveShadow: #4091ed;
-
-// White; for background use, and text use on dark backgrounds
-@colorWhite: #fff;
-// Off-white; for background use on white backgrounds
-@colorOffWhite: #fafafa;
-// Dark gray; for non-text use
-@colorGrayDark: #898989;
-// Light gray; for non-text use
-@colorGrayLight: #ccc;
-// Very light gray; for non-text use
-@colorGrayLighter: #ddd;
-// Lightest gray; for non-text use
-@colorGrayLightest: #eee;
-
-// Dark gray; for body text
-@colorText: #252525;
-// Light gray; for less important body text and links
-@colorTextLight: #696969;
-
-// Blue; for contextual use of a continuing action
-@colorProgressive: #347bff;
-// Orange; for contextual use of returning to a past action
-@colorRegressive: #ff7e1e;
-// Green; for contextual use of a positive finalizing action
-@colorConstructive: #00af89;
-// Red; for contextual use of a negative finalizing action
-@colorDestructive: #d11d13;
-
-// Used in mixins to darken contextual colors by the same amount (eg. focus)
-@colorDarkenPercentage: 13.5%;
-// Used in mixins to lighten contextual colors by the same amount (eg. hover)
-@colorLightenPercentage: 13.5%;
\ No newline at end of file
diff --git a/resources/src/mediawiki.ui/settings/typography.less b/resources/src/mediawiki.ui/settings/typography.less
deleted file mode 100644 (file)
index 83651ed..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-@baseFontSize: 1em;
-@baseLineHeight: 1.4 * @baseFontSize;
-@baseFontColor: @colorText;
-
-@smallFontSize: 0.75em;
diff --git a/resources/src/mediawiki.ui/vector.less b/resources/src/mediawiki.ui/vector.less
deleted file mode 100644 (file)
index 04e88e8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Provide Agora appearance for mw-ui-* classes when using the Vector skin.
- */
-
-// Typography
-//
-// We prefer the usage of Georgia Bold for all headings. Georgia Regular is used to place emphasis on pull-out or short quotations. This latter usage should be used sparingly. 
-//
-// We prefer the use of Helvetica Neue Regular for body copy. Helvetiva Neue Bold for sub-headers. Pull-out quotes within the body copy should use Helvetica Neue Bold. Helvetica Neue is an not open-source font. Hence, below is a list of preferred alternate choices.
-//
-// Second choice: Helvetica
-//
-// Third choice: Arial
-//
-// Wiki content is often predominantly text; hence, visual hierarchy must be clear. Use these recommended type sizes to inform and establish information hierarchy and organization.
-//
-// Unless if you plan to put extra attention and manually adjust spacing, avoid justifying texts and paragraphs as they are harder to read and create unnecessary visual distractions. Along with centered text, they convey a formal and less friendly environment. 
-//
-// It will be important to talk about other languages, scripts and writing direction - with the same level as importance, not as an afterthought.
-//
-// Styleguide 1.
-
-@import "mediawiki.mixins";
-@import "components/utilities";
-@import "components/vector/forms";
-@import "components/vector/containers";
index a3a20e5..684d3d3 100644 (file)
@@ -1,10 +1,12 @@
 {
        "@metadata": {
                "authors": [
-                       "Yury Tarasievich"
+                       "Yury Tarasievich",
+                       "Mikalai Udodau"
                ]
        },
        "skinname-monobook": "Манабук",
+       "monobook-desc": "Класічная вокладка MediaWiki з 2004 года, названая ў гонар чорна-белай фатаграфіі кнігі ў фоне старонкі",
        "monobook.css": "/* CSS, упісаны сюды, будзе дзейнічаць на браўзер кожнага чытача з актыўнай світай Monobook */",
        "monobook.js": "/* Any JavaScript here will be loaded for users using the MonoBook skin */"
 }
index b84c18f..5dbc57c 100644 (file)
@@ -7,6 +7,7 @@
                        "Хомелка"
                ]
        },
+       "vector-skin-desc": "Сучасная версія вокладкі Манабук, з абноўленым відам і шматлікімі зручнымі паляпшэннямі",
        "vector-action-addsection": "Дадаць тэму",
        "vector-action-delete": "Сцерці",
        "vector-action-move": "Перанесці",