Merge "American spelling - recognize/customize"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 6 Mar 2013 15:19:45 +0000 (15:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 6 Mar 2013 15:19:45 +0000 (15:19 +0000)
101 files changed:
HISTORY
RELEASE-NOTES-1.21
UPGRADE
docs/hooks.txt
docs/maintenance.txt
docs/memcached.txt
includes/Action.php
includes/ArrayUtils.php
includes/AutoLoader.php
includes/CategoryViewer.php
includes/DefaultSettings.php
includes/EditPage.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/Linker.php
includes/Preferences.php
includes/Revision.php
includes/SkinLegacy.php
includes/SpecialPage.php
includes/StringUtils.php
includes/Title.php
includes/User.php
includes/WatchedItem.php
includes/WikiPage.php
includes/ZipDirectoryReader.php
includes/api/ApiPageSet.php
includes/api/ApiParse.php
includes/api/ApiQueryAllPages.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQuerySiteinfo.php
includes/api/ApiWatch.php
includes/content/Content.php
includes/content/ContentHandler.php
includes/db/LoadBalancer.php
includes/db/ORMRow.php
includes/filebackend/lockmanager/ScopedLock.php
includes/filerepo/FileRepo.php
includes/filerepo/LocalRepo.php
includes/filerepo/README
includes/filerepo/file/ForeignDBFile.php
includes/job/JobQueueGroup.php
includes/libs/CSSJanus.php
includes/libs/GenericArrayObject.php
includes/libs/IEUrlExtension.php
includes/objectcache/SqlBagOStuff.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/resourceloader/ResourceLoader.php
includes/site/MediaWikiSite.php
includes/specials/SpecialBlockme.php
includes/specials/SpecialFilepath.php
includes/specials/SpecialSearch.php
includes/specials/SpecialStatistics.php
includes/upload/UploadBase.php
languages/messages/MessagesBr.php
languages/messages/MessagesDiq.php
languages/messages/MessagesEn.php
languages/messages/MessagesEu.php
languages/messages/MessagesGv.php
languages/messages/MessagesHu.php
languages/messages/MessagesKa.php
languages/messages/MessagesLad.php
languages/messages/MessagesNl.php
languages/messages/MessagesOr.php
languages/messages/MessagesQqq.php
maintenance/README
maintenance/clearCacheStats.php [new file with mode: 0644]
maintenance/clearInterwikiCache.php [new file with mode: 0644]
maintenance/clear_interwiki_cache.php [deleted file]
maintenance/clear_stats.php [deleted file]
maintenance/initSiteStats.php [new file with mode: 0644]
maintenance/initStats.php [deleted file]
maintenance/language/messages.inc
maintenance/nextJobDB.php
maintenance/proxyCheck.php [new file with mode: 0644]
maintenance/proxy_check.php [deleted file]
maintenance/runJobs.php
maintenance/showCacheStats.php [new file with mode: 0644]
maintenance/showSiteStats.php [new file with mode: 0644]
maintenance/showStats.php [deleted file]
maintenance/stats.php [deleted file]
maintenance/storage/recompressTracked.php
resources/jquery/jquery.qunit.completenessTest.js
resources/mediawiki/mediawiki.jqueryMsg.js
resources/mediawiki/mediawiki.js
resources/mediawiki/mediawiki.util.js
skins/Vector.php
skins/common/commonElements.css
skins/common/shared.css
tests/RunSeleniumTests.php
tests/parser/parserTests.txt
tests/phpunit/includes/db/TestORMRowTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/libs/CSSJanusTest.php
tests/phpunit/maintenance/MaintenanceTest.php
tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js
tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js

diff --git a/HISTORY b/HISTORY
index 3a25b97..02ba8d8 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -132,7 +132,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 39273) Added AJAX support for "Show changes" (diff) in LivePreview.
 * Added ResourceLoader module "jquery.badge".
 * mw.util.$content now points to the overall content area in the skin rather than just
-  page text content area. If you need the old behaviour please use $( '#mw-content-text').
+  page text content area. If you need the old behavior please use $( '#mw-content-text').
 * jsMessage has been replaced with a floating bubble notification system complete
   with auto-hide, multi-message support, and message replacement tags.
 * jquery.messageBox which appears to be unused by both core and extensions has
@@ -1135,7 +1135,7 @@ Selected changes since MediaWiki 1.17 that may be of interest:
 * New maintenance script to refresh image metadata (maintenance/refreshImageMetadata.php).
 * (bug 16428) Include permalink in printable version.
 * (bug 30722) Add an identity collation that sorts things based on what the
-  unicode code point is (aka pre-1.17 behaviour).
+  unicode code point is (aka pre-1.17 behavior).
 * (bug 30940) Add a hook in User:getDefaultOptions.
   To give extensions a better and more flexible way of providing default
   values for preferences a hook has been introdiced in User:getDefaultOptions().
@@ -2125,7 +2125,7 @@ Selected changes since MediaWiki 1.16 that may be of interest:
   make wfTempDir() return a sane value for Windows on worst-case.
 * (bug 24824) Support ImageMagick 6.5.6-2+ JPEG decoder size hint, to reduce
   memory usage when such an ImageMagick is used for scaling.
-* Disable multithreaded behaviour in recent ImageMagick, to avoid a deadlock
+* Disable multithreaded behavior in recent ImageMagick, to avoid a deadlock
   when a resource limit such as $wgMaxShellMemory is hit.
 * (bug 24981) Allow extensions to access SpecialUpload variables again.
 * (bug 20744) Wiki forgets about an uploaded file.
@@ -2518,8 +2518,8 @@ Other significant changes to MediaWiki's language support:
   exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to
   it as appropriate.
 * If $wgLocaltimezone is null, use the server's timezone as the default for
-  signatures. This was always the behaviour documented in DefaultSettings.php
-  but has not been the actual behaviour for some time: instead, UTC was used
+  signatures. This was always the behavior documented in DefaultSettings.php
+  but has not been the actual behavior for some time: instead, UTC was used
   by default.
 * Added $wgExtensionAssetsPath, to decouple assets serving from $wgScriptPath.
   If not specified it will default to $wgScriptPath/extensions
@@ -4716,7 +4716,7 @@ Other changes in this release:
 * (bug 12644) Template list on edit page now sorted on preview
 * (bug 14058) Support pipe trick for namespaces and interwikis with "-"
 * Message name filter on Special:Allmessages now case-insensitive
-* (bug 13943) Fix image redirect behaviour on image pages
+* (bug 13943) Fix image redirect behavior on image pages
 * (bug 14093) Do 'sysop' => 'protect' magic in Title::isValidMoveOperation
 * (bug 14063) Power search form missing <label> for redirects check
 * (bug 14111) Similar filename warning links now lead to correct page
@@ -4939,7 +4939,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   to not check and assume they are always up to date)
 * The rollback permission can now be rate-limited using the normal mechanism.
 * New configuration variable $wgExtraLanguageNames
-* Behaviour of $wgAddGroups and $wgRemoveGroups changed. New behaviour:
+* Behavior of $wgAddGroups and $wgRemoveGroups changed. New behavior:
 * * Granting the userrights privilege allows arbitrary changing of rights.
 * * Without the userrights privilege, a user will be able to add and/or
      remove the groups specified in $wgAddGroups and $wgRemoveGroups for
@@ -5351,7 +5351,7 @@ the removal of this double-parse. Please see the wiki page for examples.
 
 Message transformation mode has been removed, and replaced with "preprocess"
 mode. This means that some MediaWiki namespace messages may need to be updated,
-especially ones which took advantage of the terribly counterintuitive behaviour
+especially ones which took advantage of the terribly counterintuitive behavior
 of the former message mode.
 
 The header identification routines for section edit and for numbering section
@@ -5361,7 +5361,7 @@ template expansion will still be rendered into a heading tag, and will get an
 entry in the TOC, but will not have a section edit link. HTML-style headings
 will also not have a section edit link. Valid wikitext headings present in the
 template source text will get a template section edit link. This is a major
-break from previous behaviour, but I believe the effects are almost entirely
+break from previous behavior, but I believe the effects are almost entirely
 beneficial.
 
 The main motivation for making these changes was performance. The new two-pass
@@ -5568,7 +5568,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   enabled by default.
 * Added option to install to MyISAM
 * (bug 9250) Remove hardcoded minimum image name length of three characters
-* Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the
+* Fixed DISPLAYTITLE behavior to reject titles which don't normalise to the
   same title as the current page, and enabled per default
 * Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
 * (bug 10196) Add classes and dir="ltr" to the <pre>s on CSS and JS pages (new
@@ -5850,7 +5850,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fix upload form display in right-to-left languages
 * Fixed regression in blocking of username '0'
 * (bug 9437) Don't overwrite edit form submission handler when setting up
-  edit box scroll position preserve/restore behaviour
+  edit box scroll position preserve/restore behavior
 * (bug 10805) Fix "undo" link when viewing the diff of the most recent
   change to a page using "diff=0"
 * (bug 10765) img_auth.php will now refuse logged-out requests where
@@ -6396,7 +6396,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   to image/svg+xml after loading from the database.
 * Workaround for djvutoxml bug #1704049 (poor performance). Use djvudump
   instead.
-* Fixed odd behaviour in ImagePage on DjVu thumbnailing errors
+* Fixed odd behavior in ImagePage on DjVu thumbnailing errors
 * (bug 5439) "Go" title search will now jump to shared/foreign Image: and
   MediaWiki: pages that have not been locally edited.
 * (bug 9630) Limits links in Whatlinkshere forgot about namespace filter
@@ -7002,7 +7002,7 @@ setting since version 1.2.0. If you have it on, turn it *off* if you can.
 * New maintenance script to show the cached statistics : showStats.php.
 * Count deleted edits when regenerating total edits in maintenance/initStats.php
 * (bug 3706) Allow users to be exempted from IP blocks. The ipblock-exempt permission
-  key has been added to enable this behaviour, by default assigned to sysops.
+  key has been added to enable this behavior, by default assigned to sysops.
 * (bug 7948) importDump.php now warn that Recentchanges need to be rebuild.
 * (bug 7667) allow XHTML namespaces customization
 * (bug 8531) Correct local name of Lingála (patch by Raymond)
@@ -7281,7 +7281,7 @@ they will be run along with the main tests by maintenance/parserTests.php
 * (bug 6642) Don't offer to unlock the database when it isn't locked
 * cleanupTitles.php changed from --dry-run option to --fix, so default
   behavior is now a non-invasive check as with namespaceDupes.php
-* (bug 6660) Fix behaviour of EditPage::blockedPage() when the article does
+* (bug 6660) Fix behavior of EditPage::blockedPage() when the article does
   not exist; now doesn't show the source box if the user hasn't provided it
   (blocked mid-edit) and the page doesn't exist
 * Improve default value of "blockedtext"
@@ -7442,7 +7442,7 @@ they will be run along with the main tests by maintenance/parserTests.php
 * (bug 6023) Fixed mismatch of 0/NULL for wl_notificationtimestamp; now notification
   mails are working after 'Mark all pages visited' button on Special:Watchlist is clicked
 * Made {{INT:}} a core parser function instead of a special case. The syntax
-  and behaviour is largely unchanged.
+  and behavior is largely unchanged.
 * (bug 7448) Fixing the native name for Ewe (ee)
 * (bug 6864) Replace message 'editing' with new message 'editinguser' in Special:Userrights
   to allow better localisation
@@ -10320,7 +10320,7 @@ pages for purposes of page relevancy ranking.
 * (bug 1283) Use underlining and borders to highlight additions/deletions
   in diff-view
 * Use user's local timezone in Special:Log display
-* Show filename for images in gallery by default (restore beta 3 behaviour)
+* Show filename for images in gallery by default (restore beta 3 behavior)
 * (bug 1201) Double-escaping in brokenlinks, imagelinks, categorylinks, searchindex
 * When using squid reverse proxy, cache the redirect to the Main_Page
 * (bug 1302) Fix Norwegian language file
index 3471dbe..17bca70 100644 (file)
@@ -96,6 +96,8 @@ production.
 * (bug 5346) Categories that are redirects will be displayed italic in
   the category links section at the bottom of a page.
 * (bug 43915) New maintenance script deleteEqualMessages.php.
+* You can now create checkbox option matrixes through the HTMLCheckMatrix
+  subclass in HTMLForm.
 * WikiText now permits the use of WAI-ARIA's role="presentation" inside of
   html elements and tables. This allows presentational markup, especially
   tables. To be marked up as such.
@@ -111,6 +113,7 @@ production.
   gl, hr, hsb, hu, is, it, kk, kl, ku, ky, la, lb, lt, lv, mk, mo, mt, nl, no,
   oc, pl, pt, rm, ro, ru, rup, sco, sk, sl, smn, sq, sr, sv, tk, tl, tr, tt, uk,
   uz, vi.
+* Added 'CategoryAfterPageAdded' and 'CategoryAfterPageRemoved' hooks.
 
 === Bug fixes in 1.21 ===
 * (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
@@ -187,6 +190,8 @@ production.
   "password mismatch" error.
 * (bug 44599) On Special:Version, HEADs for submodule checkouts (e.g. for
   extensions) performed using Git 1.7.8+ should now appear.
+* (bug 42184) $wgUploadSizeWarning missing second variable
+* (bug 40326) Check if files exist with a different extension during uploading
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat.
@@ -249,6 +254,8 @@ production.
   an error during parameter validation if the parameter is given but not
   recognized as an uploaded file.
 * (bug 44244) prop=info may now return the number of people watching each page.
+* (bug 33304) list=allpages will no longer return duplicate entries when
+  querying protection.
 
 === API internal changes in 1.21 ===
 * For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
@@ -287,6 +294,13 @@ changes to languages because of Bugzilla reports.
   Vector extension (and possibly disable its features using config settings if
   you don't want them).
 * Experimental IBM DB2 support was removed due to lack of interest and maintainership
+* BREAKING CHANGE: Filenames of maintenance scripts were standardized into lowerCamelCase
+  format, and made more explicit: clear_stats.php -> clearCacheStats.php; 
+  clear_interwiki_cache.php -> clearInterwikiCache.php; initStats.php -> initSiteStats.php;
+  proxy_check.php -> proxyCheck.php; stats.php -> showCacheStats.php;
+  showStats.php -> showSiteStats.php. Class names were renamed accordingly:
+  clear_stats -> ClearCacheStats; InitStats -> InitSiteStats; CacheStats -> ShowCacheStats
+  ShowStats -> ShowSiteStats.
 
 == Compatibility ==
 
diff --git a/UPGRADE b/UPGRADE
index 2c6df98..7987b22 100644 (file)
--- a/UPGRADE
+++ b/UPGRADE
@@ -81,7 +81,7 @@ The names of configuration variables, and their default values and purposes,
 can change between release branches, e.g. $wgDisableUploads in 1.4 is replaced
 with $wgEnableUploads in later versions. When upgrading, consult the release
 notes to check for configuration changes which would alter the expected
-behaviour of MediaWiki.
+behavior of MediaWiki.
 
 === Check installed extensions ===
 
index 28eedf4..cd1af96 100644 (file)
@@ -745,6 +745,14 @@ $output: OutputPage object in use
 the defaults.
 &$namespaces: Array of namespace numbers with corresponding canonical names
 
+'CategoryAfterPageAdded': After a page is added to a category.
+$category: Category that page was added to
+$wikiPage: WikiPage that was added
+
+'CategoryAfterPageRemoved': After a page is removed from a category.
+$category: Category that page was removed from
+$wikiPage: WikiPage that was removed
+
 'CategoryPageView': Before viewing a categorypage in CategoryPage::view.
 $catpage: CategoryPage instance
 
@@ -2285,7 +2293,7 @@ $result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page.
   Title::isCssOrJsPage().
 
 'TitleIsAlwaysKnown': Called when determining if a page exists. Allows
-overriding default behaviour for determining if a page exists. If $isKnown is
+overriding default behavior for determining if a page exists. If $isKnown is
 kept as null, regular checks happen. If it's a boolean, this value is returned
 by the isKnown method.
 $title: Title object that is being checked
index 988ff28..27619c8 100644 (file)
@@ -15,7 +15,7 @@ subdirectories, all of which have unique purposes.
 level /maintenance directory.
 
 Example:
-  php clear_stats.php
+  php clearCacheStats.php
   
 The following parameters are available to all maintenance scripts
 --help   : Print a help message
index 971a611..f54a4e7 100644 (file)
@@ -237,9 +237,9 @@ Statistics:
        controlled by: $wgStatsMethod
        key: $wgDBname:stats:$key
        ex: wikibd:stats:request_with_session
-       stores: counter for statistics (see maintenance/stats.php script)
+       stores: counter for statistics (see maintenance/showCacheStats.php script)
        expiry: none (?)
-       cleared by: maintenance/clear_stats.php script
+       cleared by: maintenance/clearCacheStats.php script
 
 User:
        key: $wgDBname:user:id:$sId
index 40ce478..cace4b4 100644 (file)
@@ -388,7 +388,7 @@ abstract class FormAction extends Action {
        protected function alterForm( HTMLForm $form ) {}
 
        /**
-        * Get the HTMLForm to control behaviour
+        * Get the HTMLForm to control behavior
         * @return HTMLForm|null
         */
        protected function getForm() {
@@ -439,7 +439,7 @@ abstract class FormAction extends Action {
         * some stuff underneath (history etc); to do some processing on submission of that
         * form (delete, protect, etc) and to do something exciting on 'success', be that
         * display something new or redirect to somewhere.  Some actions have more exotic
-        * behaviour, but that's what subclassing is for :D
+        * behavior, but that's what subclassing is for :D
         */
        public function show() {
                $this->setHeaders();
index d1b72a0..0b74f06 100644 (file)
@@ -21,7 +21,7 @@ class ArrayUtils {
         *     various consistent hash implementations that existed before this
         *     function was introduced.
         */
-       static function consistentHashSort( &$array, $key, $separator = "\000" ) {
+       public static function consistentHashSort( &$array, $key, $separator = "\000" ) {
                $hashes = array();
                foreach ( $array as $elt ) {
                        $hashes[$elt] = md5( $elt . $separator . $key );
@@ -30,4 +30,40 @@ class ArrayUtils {
                        return strcmp( $hashes[$a], $hashes[$b] );
                } );
        }
+
+       /**
+        * Given an array of non-normalised probabilities, this function will select
+        * an element and return the appropriate key
+        *
+        * @param $weights array
+        *
+        * @return bool|int|string
+        */
+       public static function pickRandom( $weights ){
+               if ( !is_array( $weights ) || count( $weights ) == 0 ) {
+                       return false;
+               }
+
+               $sum = array_sum( $weights );
+               if ( $sum == 0 ) {
+                       # No loads on any of them
+                       # In previous versions, this triggered an unweighted random selection,
+                       # but this feature has been removed as of April 2006 to allow for strict
+                       # separation of query groups.
+                       return false;
+               }
+               $max = mt_getrandmax();
+               $rand = mt_rand( 0, $max ) / $max * $sum;
+
+               $sum = 0;
+               foreach ( $weights as $i => $w ) {
+                       $sum += $w;
+                       # Do not return keys if they have 0 weight.
+                       # Note that the "all 0 weight" case is handed above
+                       if ( $w > 0 && $sum >= $rand ) {
+                               break;
+                       }
+               }
+               return $i;
+       }
 }
index ace1348..ed72b2f 100644 (file)
@@ -119,6 +119,7 @@ $wgAutoloadLocalClasses = array(
        'Html' => 'includes/Html.php',
        'HTMLApiField' => 'includes/HTMLForm.php',
        'HTMLCheckField' => 'includes/HTMLForm.php',
+       'HTMLCheckMatrix' => 'includes/HTMLForm.php',
        'HTMLEditTools' => 'includes/HTMLForm.php',
        'HTMLFloatField' => 'includes/HTMLForm.php',
        'HTMLForm' => 'includes/HTMLForm.php',
index 7678ffe..878c371 100644 (file)
@@ -288,10 +288,10 @@ class CategoryViewer extends ContextSource {
                        # the collation in the database differs from the one
                        # set in $wgCategoryCollation, pagination might go totally haywire.
                        $extraConds = array( 'cl_type' => $type );
-                       if ( $this->from[$type] !== null ) {
+                       if ( isset( $this->from[$type] ) && $this->from[$type] !== null ) {
                                $extraConds[] = 'cl_sortkey >= '
                                        . $dbr->addQuotes( $this->collation->getSortKey( $this->from[$type] ) );
-                       } elseif ( $this->until[$type] !== null ) {
+                       } elseif ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
                                $extraConds[] = 'cl_sortkey < '
                                        . $dbr->addQuotes( $this->collation->getSortKey( $this->until[$type] ) );
                                $this->flip[$type] = true;
@@ -445,9 +445,9 @@ class CategoryViewer extends ContextSource {
         * @return String: HTML output, possibly empty if there are no other pages
         */
        private function getSectionPagingLinks( $type ) {
-               if ( $this->until[$type] !== null ) {
+               if ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
                        return $this->pagingLinks( $this->nextPage[$type], $this->until[$type], $type );
-               } elseif ( $this->nextPage[$type] !== null || $this->from[$type] !== null ) {
+               } elseif ( $this->nextPage[$type] !== null || ( isset( $this->from[$type] ) && $this->from[$type] !== null ) ) {
                        return $this->pagingLinks( $this->from[$type], $this->nextPage[$type], $type );
                } else {
                        return '';
@@ -677,7 +677,9 @@ class CategoryViewer extends ContextSource {
                }
 
                $fromOrUntil = false;
-               if ( $this->from[$pagingType] !== null || $this->until[$pagingType] !== null ) {
+               if ( ( isset( $this->from[$pagingType] ) && $this->from[$pagingType] !== null ) ||
+                       ( isset( $this->until[$pagingType] ) && $this->until[$pagingType] !== null )
+               ) {
                        $fromOrUntil = true;
                }
 
index 73c097e..7e4a68b 100644 (file)
@@ -1837,7 +1837,7 @@ $wgSessionsInMemcached = false;
 
 /**
  * Store sessions in an object cache, configured by $wgSessionCacheType. This
- * can be useful to improve performance, or to avoid the locking behaviour of
+ * can be useful to improve performance, or to avoid the locking behavior of
  * PHP's default session handler, which tends to prevent multiple requests for
  * the same user from acting concurrently.
  */
@@ -2207,7 +2207,7 @@ $wgUsePrivateIPs = false;
  * change it in their preferences.
  *
  * This also defines the language of pages in the wiki. The content is wrapped
- * in a html element with lang=XX attribute. This behaviour can be overriden
+ * in a html element with lang=XX attribute. This behavior can be overriden
  * via hooks, see Title::getPageLanguage.
  */
 $wgLanguageCode = 'en';
@@ -4406,7 +4406,7 @@ $wgBlockOpenProxies = false;
 /** Port we want to scan for a proxy */
 $wgProxyPorts = array( 80, 81, 1080, 3128, 6588, 8000, 8080, 8888, 65506 );
 /** Script used to scan */
-$wgProxyScriptPath = "$IP/maintenance/proxy_check.php";
+$wgProxyScriptPath = "$IP/maintenance/proxyCheck.php";
 /** */
 $wgProxyMemcExpiry = 86400;
 /** This should always be customised in LocalSettings.php */
@@ -4971,7 +4971,7 @@ $wgEnableSearchContributorsByIP = true;
 
 /**
  * Path to the GNU diff3 utility. If the file doesn't exist, edit conflicts will
- * fall back to the old behaviour (no merging).
+ * fall back to the old behavior (no merging).
  */
 $wgDiff3 = '/usr/bin/diff3';
 
@@ -5546,6 +5546,8 @@ $wgJobTypesExcludedFromDefaultQueue = array( 'AssembleUploadChunks', 'PublishSta
 
 /**
  * Map of job types to configuration arrays.
+ * This determines which queue class and storage system is used for each job type.
+ * Job types that do not have explicit configuration will use the 'default' config.
  * These settings should be global to all wikis.
  */
 $wgJobTypeConf = array(
index d42edd7..027fa01 100644 (file)
@@ -563,7 +563,7 @@ class EditPage {
                        // Nothing *to* preview for new sections
                        return false;
                } elseif ( ( $wgRequest->getVal( 'preload' ) !== null || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
-                       // Standard preference behaviour
+                       // Standard preference behavior
                        return true;
                } elseif ( !$this->mTitle->exists() &&
                        isset( $wgPreviewOnOpenNamespaces[$this->mTitle->getNamespace()] ) &&
index 79a4920..cdd0ae9 100644 (file)
@@ -329,40 +329,6 @@ function wfRandomString( $length = 32 ) {
        return substr( $str, 0, $length );
 }
 
-/**
- * Given an array of non-normalised probabilities, this function will select
- * an element and return the appropriate key
- *
- * @param $weights array
- *
- * @return bool|int|string
- */
-function wfPickRandom( $weights ){
-       if ( !is_array( $weights ) || count( $weights ) == 0 ) {
-               return false;
-       }
-
-       $sum = array_sum( $weights );
-       if ( $sum == 0 ) {
-               # No loads on any of them
-               # In previous versions, this triggered an unweighted random selection,
-               # but this feature has been removed as of April 2006 to allow for strict
-               # separation of query groups.
-               return false;
-       }
-       $max = mt_getrandmax();
-       $rand = mt_rand( 0, $max ) / $max * $sum;
-
-       $sum = 0;
-       foreach ( $weights as $i => $w ) {
-               $sum += $w;
-               if ( $sum >= $rand ) {
-                       break;
-               }
-       }
-       return $i;
-}
-
 /**
  * We want some things to be included as literal characters in our title URLs
  * for prettiness, which urlencode encodes by default.  According to RFC 1738,
index 86eb38d..5af813b 100644 (file)
@@ -112,6 +112,7 @@ class HTMLForm extends ContextSource {
                'submit' => 'HTMLSubmitField',
                'hidden' => 'HTMLHiddenField',
                'edittools' => 'HTMLEditTools',
+               'checkmatrix' => 'HTMLCheckMatrix',
 
                // HTMLTextField will output the correct type="" attribute automagically.
                // There are about four zillion other HTML5 input types, like url, but
@@ -956,7 +957,7 @@ class HTMLForm extends ContextSource {
                                        $hasLabel = true;
                                }
                        } elseif ( is_array( $value ) ) {
-                               $section = $this->displaySection( $value, $key );
+                               $section = $this->displaySection( $value, $key, "$fieldsetIDPrefix$key-" );
                                $legend = $this->getLegend( $key );
                                if ( isset( $this->mSectionHeaders[$key] ) ) {
                                        $section = $this->mSectionHeaders[$key] . $section;
@@ -1781,6 +1782,170 @@ class HTMLCheckField extends HTMLFormField {
        }
 }
 
+/**
+ * A checkbox matrix
+ * Operates similarly to HTMLMultiSelectField, but instead of using an array of
+ * options, uses an array of rows and an array of columns to dynamically
+ * construct a matrix of options.
+ */
+class HTMLCheckMatrix extends HTMLFormField {
+
+       function validate( $value, $alldata ) {
+               $rows = $this->mParams['rows'];
+               $columns = $this->mParams['columns'];
+
+               // Make sure user-defined validation callback is run
+               $p = parent::validate( $value, $alldata );
+               if ( $p !== true ) {
+                       return $p;
+               }
+
+               // Make sure submitted value is an array
+               if ( !is_array( $value ) ) {
+                       return false;
+               }
+
+               // If all options are valid, array_intersect of the valid options
+               // and the provided options will return the provided options.
+               $validOptions = array();
+               foreach ( $rows as $rowTag ) {
+                       foreach ( $columns as $columnTag ) {
+                               $validOptions[] = $columnTag . '-' . $rowTag;
+                       }
+               }
+               $validValues = array_intersect( $value, $validOptions );
+               if ( count( $validValues ) == count( $value ) ) {
+                       return true;
+               } else {
+                       return $this->msg( 'htmlform-select-badoption' )->parse();
+               }
+       }
+
+       /**
+        * Build a table containing a matrix of checkbox options.
+        * The value of each option is a combination of the row tag and column tag.
+        * mParams['rows'] is an array with row labels as keys and row tags as values.
+        * mParams['columns'] is an array with column labels as keys and column tags as values.
+        * @param $value Array of the options that should be checked
+        * @return String
+        */
+       function getInputHTML( $value ) {
+               $html = '';
+               $tableContents = '';
+               $attribs = array();
+               $rows = $this->mParams['rows'];
+               $columns = $this->mParams['columns'];
+
+               // If the disabled param is set, disable all the options
+               if ( !empty( $this->mParams['disabled'] ) ) {
+                       $attribs['disabled'] = 'disabled';
+               }
+
+               // Build the column headers
+               $headerContents = Html::rawElement( 'td', array(), '&#160;' );
+               foreach ( $columns as $columnLabel => $columnTag ) {
+                       $headerContents .= Html::rawElement( 'td', array(), $columnLabel );
+               }
+               $tableContents .= Html::rawElement( 'tr', array(), "\n$headerContents\n" );
+
+               // Build the options matrix
+               foreach ( $rows as $rowLabel => $rowTag ) {
+                       $rowContents = Html::rawElement( 'td', array(), $rowLabel );
+                       foreach ( $columns as $columnTag ) {
+                               // Knock out any options that are not wanted
+                               if ( isset( $this->mParams['remove-options'] )
+                                       && in_array( "$columnTag-$rowTag", $this->mParams['remove-options'] ) )
+                               {
+                                       $rowContents .= Html::rawElement( 'td', array(), '&#160;' );
+                               } else {
+                                       // Construct the checkbox
+                                       $thisAttribs = array(
+                                               'id' => "{$this->mID}-$columnTag-$rowTag",
+                                               'value' => $columnTag . '-' . $rowTag
+                                       );
+                                       $checkbox = Xml::check(
+                                               $this->mName . '[]',
+                                               in_array( $columnTag . '-' . $rowTag, (array)$value, true ),
+                                               $attribs + $thisAttribs );
+                                       $rowContents .= Html::rawElement( 'td', array(), $checkbox );
+                               }
+                       }
+                       $tableContents .= Html::rawElement( 'tr', array(), "\n$rowContents\n" );
+               }
+
+               // Put it all in a table
+               $html .= Html::rawElement( 'table', array( 'class' => 'mw-htmlform-matrix' ),
+                       Html::rawElement( 'tbody', array(), "\n$tableContents\n" ) ) . "\n";
+
+               return $html;
+       }
+
+       /**
+        * Get the complete table row for the input, including help text,
+        * labels, and whatever.
+        * We override this function since the label should always be on a separate
+        * line above the options in the case of a checkbox matrix, i.e. it's always
+        * a "vertical-label".
+        * @param $value String the value to set the input to
+        * @return String complete HTML table row
+        */
+       function getTableRow( $value ) {
+               list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value );
+               $inputHtml = $this->getInputHTML( $value );
+               $fieldType = get_class( $this );
+               $helptext = $this->getHelpTextHtmlTable( $this->getHelpText() );
+               $cellAttributes = array( 'colspan' => 2 );
+
+               $label = $this->getLabelHtml( $cellAttributes );
+
+               $field = Html::rawElement(
+                       'td',
+                       array( 'class' => 'mw-input' ) + $cellAttributes,
+                       $inputHtml . "\n$errors"
+               );
+
+               $html = Html::rawElement( 'tr',
+                       array( 'class' => 'mw-htmlform-vertical-label' ), $label );
+               $html .= Html::rawElement( 'tr',
+                       array( 'class' => "mw-htmlform-field-$fieldType {$this->mClass} $errorClass" ),
+                       $field );
+
+               return $html . $helptext;
+       }
+
+       /**
+        * @param $request WebRequest
+        * @return Array
+        */
+       function loadDataFromRequest( $request ) {
+               if ( $this->mParent->getMethod() == 'post' ) {
+                       if ( $request->wasPosted() ) {
+                               // Checkboxes are not added to the request arrays if they're not checked,
+                               // so it's perfectly possible for there not to be an entry at all
+                               return $request->getArray( $this->mName, array() );
+                       } else {
+                               // That's ok, the user has not yet submitted the form, so show the defaults
+                               return $this->getDefault();
+                       }
+               } else {
+                       // This is the impossible case: if we look at $_GET and see no data for our
+                       // field, is it because the user has not yet submitted the form, or that they
+                       // have submitted it with all the options unchecked. We will have to assume the
+                       // latter, which basically means that you can't specify 'positive' defaults
+                       // for GET forms.
+                       return $request->getArray( $this->mName, array() );
+               }
+       }
+
+       function getDefault() {
+               if ( isset( $this->mDefault ) ) {
+                       return $this->mDefault;
+               } else {
+                       return array();
+               }
+       }
+}
+
 /**
  * A select dropdown field.  Basically a wrapper for Xmlselect class
  */
index a96bc5f..2434a70 100644 (file)
@@ -660,7 +660,7 @@ class Linker {
                if ( $file && isset( $fp['frameless'] ) ) {
                        $srcWidth = $file->getWidth( $page );
                        # For "frameless" option: do not present an image bigger than the source (for bitmap-style images)
-                       # This is the same behaviour as the "thumb" option does it already.
+                       # This is the same behavior as the "thumb" option does it already.
                        if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
                                $hp['width'] = $srcWidth;
                        }
@@ -819,7 +819,7 @@ class Linker {
                                $noscale = true;
                        } else {
                                # Do not present an image bigger than the source, for bitmap-style images
-                               # This is a hack to maintain compatibility with arbitrary pre-1.10 behaviour
+                               # This is a hack to maintain compatibility with arbitrary pre-1.10 behavior
                                $srcWidth = $file->getWidth( $page );
                                if ( $srcWidth && !$file->mustRender() && $hp['width'] > $srcWidth ) {
                                        $hp['width'] = $srcWidth;
index 76e1760..f35d754 100644 (file)
@@ -129,7 +129,7 @@ class Preferences {
        static function getOptionFromUser( $name, $info, $user ) {
                $val = $user->getOption( $name );
 
-               // Handling for array-type preferences
+               // Handling for multiselect preferences
                if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
                                ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) {
                        $options = HTMLFormField::flattenOptions( $info['options'] );
@@ -143,6 +143,23 @@ class Preferences {
                        }
                }
 
+               // Handling for checkmatrix preferences
+               if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
+                               ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) {
+                       $columns = HTMLFormField::flattenOptions( $info['columns'] );
+                       $rows = HTMLFormField::flattenOptions( $info['rows'] );
+                       $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
+                       $val = array();
+
+                       foreach ( $columns as $column ) {
+                               foreach ( $rows as $row ) {
+                                       if ( $user->getOption( "$prefix-$column-$row" ) ) {
+                                               $val[] = "$column-$row";
+                                       }
+                               }
+                       }
+               }
+
                return $val;
        }
 
@@ -1560,10 +1577,11 @@ class PreferencesForm extends HTMLForm {
         * @return array
         */
        function filterDataForSubmit( $data ) {
-               // Support for separating MultiSelect preferences into multiple preferences
+               // Support for separating multi-option preferences into multiple preferences
                // Due to lack of array support.
                foreach ( $this->mFlatFields as $fieldname => $field ) {
                        $info = $field->mParams;
+
                        if ( $field instanceof HTMLMultiSelectField ) {
                                $options = HTMLFormField::flattenOptions( $info['options'] );
                                $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $fieldname;
@@ -1572,6 +1590,23 @@ class PreferencesForm extends HTMLForm {
                                        $data["$prefix$opt"] = in_array( $opt, $data[$fieldname] );
                                }
 
+                               unset( $data[$fieldname] );
+
+                       } elseif ( $field instanceof HTMLCheckMatrix ) {
+                               $columns = HTMLFormField::flattenOptions( $info['columns'] );
+                               $rows = HTMLFormField::flattenOptions( $info['rows'] );
+                               $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $fieldname;
+                               foreach ( $columns as $column ) {
+                                       foreach ( $rows as $row ) {
+                                               // Make sure option hasn't been removed
+                                               if ( !isset( $info['remove-options'] )
+                                                       || !in_array( "$column-$row", $info['remove-options'] ) )
+                                               {
+                                                       $data["$prefix-$column-$row"] = in_array( "$column-$row", $data[$fieldname] );
+                                               }
+                                       }
+                               }
+
                                unset( $data[$fieldname] );
                        }
                }
index df1e43e..0cb2c79 100644 (file)
@@ -1327,7 +1327,7 @@ class Revision implements IDBAccessObject {
 
                if ( $wgContentHandlerUseDB ) {
                        //NOTE: Store null for the default model and format, to save space.
-                       //XXX: Makes the DB sensitive to changed defaults. Make this behaviour optional? Only in miser mode?
+                       //XXX: Makes the DB sensitive to changed defaults. Make this behavior optional? Only in miser mode?
 
                        $model = $this->getContentModel();
                        $format = $this->getContentFormat();
index c1c7219..b9766a9 100644 (file)
@@ -786,7 +786,7 @@ class LegacyTemplate extends BaseTemplate {
                        return '';
                }
 
-               # __NEWSECTIONLINK___ changes behaviour here
+               # __NEWSECTIONLINK___ changes behavior here
                # If it is present, the link points to this page, otherwise
                # it points to the talk page
                if ( !$title->isTalkPage() && !$wgOut->showNewSectionLink() ) {
index 3b3a5ee..5801e2a 100644 (file)
@@ -302,7 +302,7 @@ class SpecialPage {
         *     be displayed by the default execute() method, without the global function ever
         *     being called.
         *
-        *     If you override execute(), you can recover the default behaviour with userCanExecute()
+        *     If you override execute(), you can recover the default behavior with userCanExecute()
         *     and displayRestrictionError()
         *
         * @param $name String: name of the special page, as seen in links and URLs
@@ -695,7 +695,7 @@ class SpecialPage {
         * also the name that will be listed in Special:Specialpages
         *
         * Derived classes can override this, but usually it is easier to keep the
-        * default behaviour. Messages can be added at run-time, see
+        * default behavior. Messages can be added at run-time, see
         * MessageCache.php.
         *
         * @return String
@@ -889,7 +889,7 @@ abstract class FormSpecialPage extends SpecialPage {
        }
 
        /**
-        * Get the HTMLForm to control behaviour
+        * Get the HTMLForm to control behavior
         * @return HTMLForm|null
         */
        protected function getForm() {
index 6647de4..9543d1f 100644 (file)
@@ -110,7 +110,7 @@ class StringUtils {
         * memory. The delimiters are literal strings, not regular expressions.
         *
         * If the start delimiter ends with an initial substring of the end delimiter,
-        * e.g. in the case of C-style comments, the behaviour differs from the model
+        * e.g. in the case of C-style comments, the behavior differs from the model
         * regex. In this implementation, the end must share no characters with the
         * start, so e.g. /*\/ is not considered to be both the start and end of a
         * comment. /*\/xy/*\/ is considered to be a single comment with contents /xy/.
index b0a6a00..86d1552 100644 (file)
@@ -4397,7 +4397,7 @@ class Title {
                $isKnown = null;
 
                /**
-                * Allows overriding default behaviour for determining if a page exists.
+                * Allows overriding default behavior for determining if a page exists.
                 * If $isKnown is kept as null, regular checks happen. If it's
                 * a boolean, this value is returned by the isKnown method.
                 *
index 2263cae..6a95a8f 100644 (file)
@@ -2322,6 +2322,7 @@ class User {
         * - 'registered' - preferences which are registered in core MediaWiki or
         *                  by extensions using the UserGetDefaultOptions hook.
         * - 'registered-multiselect' - as above, using the 'multiselect' type.
+        * - 'registered-checkmatrix' - as above, using the 'checkmatrix' type.
         * - 'userjs' - preferences with names starting with 'userjs-', intended to
         *              be used by user scripts.
         * - 'unused' - preferences about which MediaWiki doesn't know anything.
@@ -2338,6 +2339,7 @@ class User {
                return array(
                        'registered',
                        'registered-multiselect',
+                       'registered-checkmatrix',
                        'userjs',
                        'unused'
                );
@@ -2363,8 +2365,8 @@ class User {
                $prefs = Preferences::getPreferences( $this, $context );
                $mapping = array();
 
-               // Multiselect options are stored in the database with one key per
-               // option, each having a boolean value. Extract those keys.
+               // Multiselect and checkmatrix options are stored in the database with
+               // one key per option, each having a boolean value. Extract those keys.
                $multiselectOptions = array();
                foreach ( $prefs as $name => $info ) {
                        if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
@@ -2379,6 +2381,23 @@ class User {
                                unset( $prefs[$name] );
                        }
                }
+               $checkmatrixOptions = array();
+               foreach ( $prefs as $name => $info ) {
+                       if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) ||
+                                       ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) {
+                               $columns = HTMLFormField::flattenOptions( $info['columns'] );
+                               $rows = HTMLFormField::flattenOptions( $info['rows'] );
+                               $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
+
+                               foreach ( $columns as $column ) {
+                                       foreach ( $rows as $row ) {
+                                               $checkmatrixOptions["$prefix-$column-$row"] = true;
+                                       }
+                               }
+
+                               unset( $prefs[$name] );
+                       }
+               }
 
                // $value is ignored
                foreach ( $options as $key => $value ) {
@@ -2386,6 +2405,8 @@ class User {
                                $mapping[$key] = 'registered';
                        } elseif( isset( $multiselectOptions[$key] ) ) {
                                $mapping[$key] = 'registered-multiselect';
+                       } elseif( isset( $checkmatrixOptions[$key] ) ) {
+                               $mapping[$key] = 'registered-checkmatrix';
                        } elseif ( substr( $key, 0, 7 ) === 'userjs-' ) {
                                $mapping[$key] = 'userjs';
                        } else {
@@ -2404,14 +2425,14 @@ class User {
         * and 'all', which forces a reset of *all* preferences and overrides everything else.
         *
         * @param $resetKinds array|string which kinds of preferences to reset. Defaults to
-        *                                 array( 'registered', 'registered-multiselect', 'unused' )
-        *                                 for backwards-compatibility.
+        *             array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' )
+        *             for backwards-compatibility.
         * @param $context IContextSource|null context source used when $resetKinds
-        *                                     does not contain 'all', passed to getOptionKinds().
-        *                                     Defaults to RequestContext::getMain() when null.
+        *             does not contain 'all', passed to getOptionKinds().
+        *             Defaults to RequestContext::getMain() when null.
         */
        public function resetOptions(
-               $resetKinds = array( 'registered', 'registered-multiselect', 'unused' ),
+               $resetKinds = array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' ),
                IContextSource $context = null
        ) {
                $this->load();
index 240ebc7..5ac92f7 100644 (file)
@@ -205,7 +205,7 @@ class WatchedItem {
                        $success = true;
                }
 
-               # the following code compensates the new behaviour, introduced by the
+               # the following code compensates the new behavior, introduced by the
                # enotif patch, that every single watched page needs now to be listed
                # in watchlist namespace:page and namespace_talk:page had separate
                # entries: clear them
index 6048294..10b3bd8 100644 (file)
@@ -3058,6 +3058,15 @@ class WikiPage implements Page, IDBAccessObject {
                                __METHOD__
                        );
                }
+
+               foreach( $added as $catName ) {
+                       $cat = Category::newFromName( $catName );
+                       wfRunHooks( 'CategoryAfterPageAdded', array( $cat, $this ) );
+               }
+               foreach( $deleted as $catName ) {
+                       $cat = Category::newFromName( $catName );
+                       wfRunHooks( 'CategoryAfterPageRemoved', array( $cat, $this ) );
+               }
        }
 
        /**
index fc36b1f..e5423f5 100644 (file)
@@ -34,7 +34,7 @@ class ZipDirectoryReader {
         *
         * Because this class is aimed at verification, an error is raised on
         * suspicious or ambiguous input, instead of emulating some standard
-        * behaviour.
+        * behavior.
         *
         * @param $fileName string The archive file name
         * @param $callback Array The callback function. It will be called for each file
index 1bb7e47..c225b1b 100644 (file)
@@ -69,18 +69,21 @@ class ApiPageSet extends ApiBase {
        private $mFakePageId = -1;
        private $mCacheMode = 'public';
        private $mRequestedPageFields = array();
+       private $mDefaultNamespace = NS_MAIN;
 
        /**
         * Constructor
         * @param $dbSource ApiBase Module implementing getDB().
         *        Allows PageSet to reuse existing db connection from the shared state like ApiQuery.
         * @param $flags int Zero or more flags like DISABLE_GENERATORS
+        * @param $defaultNamespace int the namespace to use if none is specified by a prefix.
         * @since 1.21 accepts $flags instead of two boolean values
         */
-       public function __construct( ApiBase $dbSource, $flags = 0 ) {
+       public function __construct( ApiBase $dbSource, $flags = 0, $defaultNamespace = NS_MAIN ) {
                parent::__construct( $dbSource->getMain(), $dbSource->getModuleName() );
                $this->mDbSource = $dbSource;
                $this->mAllowGenerator = ( $flags & ApiPageSet::DISABLE_GENERATORS ) == 0;
+               $this->mDefaultNamespace = $defaultNamespace;
 
                $this->profileIn();
                $this->mParams = $this->extractRequestParams();
@@ -883,13 +886,15 @@ class ApiPageSet extends ApiBase {
         * @return LinkBatch
         */
        private function processTitlesArray( $titles ) {
-               $genderCache = GenderCache::singleton();
-               $genderCache->doTitlesArray( $titles, __METHOD__ );
-
+               $usernames = array();
                $linkBatch = new LinkBatch();
 
                foreach ( $titles as $title ) {
-                       $titleObj = is_string( $title ) ? Title::newFromText( $title ) : $title;
+                       if ( is_string( $title ) ) {
+                               $titleObj = Title::newFromText( $title, $this->mDefaultNamespace );
+                       } else {
+                               $titleObj = $title;
+                       }
                        if ( !$titleObj ) {
                                // Handle invalid titles gracefully
                                $this->mAllpages[0][$title] = $this->mFakePageId;
@@ -899,10 +904,9 @@ class ApiPageSet extends ApiBase {
                        }
                        $unconvertedTitle = $titleObj->getPrefixedText();
                        $titleWasConverted = false;
-                       $iw = $titleObj->getInterwiki();
-                       if ( strval( $iw ) !== '' ) {
+                       if ( $titleObj->isExternal() ) {
                                // This title is an interwiki link.
-                               $this->mInterwikiTitles[$titleObj->getPrefixedText()] = $iw;
+                               $this->mInterwikiTitles[$unconvertedTitle] = $titleObj->getInterwiki();
                        } else {
                                // Variants checking
                                global $wgContLang;
@@ -941,7 +945,15 @@ class ApiPageSet extends ApiBase {
                        } elseif ( is_string( $title ) && $title !== $titleObj->getPrefixedText() ) {
                                $this->mNormalizedTitles[$title] = $titleObj->getPrefixedText();
                        }
+
+                       // Need gender information
+                       if ( MWNamespace::hasGenderDistinction( $titleObj->getNamespace() ) ) {
+                               $usernames[] = $titleObj->getText();
+                       }
                }
+               // Get gender information
+               $genderCache = GenderCache::singleton();
+               $genderCache->doQuery( $usernames, __METHOD__ );
 
                return $linkBatch;
        }
index ec8bfee..09b7a88 100644 (file)
@@ -68,7 +68,7 @@ class ApiParse extends ApiBase {
                // TODO: Does this still need $wgTitle?
                global $wgParser, $wgTitle;
 
-               // Currently unnecessary, code to act as a safeguard against any change in current behaviour of uselang
+               // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
                $oldLang = null;
                if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {
                        $oldLang = $this->getContext()->getLanguage(); // Backup language
index 0c6692a..1667a85 100644 (file)
@@ -135,8 +135,6 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase {
                                } elseif ( $params['prfiltercascade'] == 'noncascading' ) {
                                        $this->addWhereFld( 'pr_cascade', 0 );
                                }
-
-                               $this->addOption( 'DISTINCT' );
                        }
                        $forceNameTitleIndex = false;
 
@@ -146,6 +144,8 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase {
                                $this->addWhere( "pr_expiry != {$db->addQuotes( $db->getInfinity() )}" );
                        }
 
+                       $this->addOption( 'DISTINCT' );
+
                } elseif ( isset( $params['prlevel'] ) ) {
                        $this->dieUsage( 'prlevel may not be used without prtype', 'params' );
                }
index 31812cf..819c1bf 100644 (file)
@@ -74,7 +74,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
 
                if ( $mode == 'revs' || $mode == 'user' ) {
                        // Ignore namespace and unique due to inability to know whether they were purposely set
-                       foreach( array( 'from', 'to', 'prefix', /*'namespace',*/ 'continue', /*'unique'*/ ) as $p ) {
+                       foreach( array( 'from', 'to', 'prefix', /*'namespace', 'unique'*/ ) as $p ) {
                                if ( !is_null( $params[$p] ) ) {
                                        $this->dieUsage( "The '{$p}' parameter cannot be used in modes 1 or 2", 'badparams' );
                                }
@@ -361,7 +361,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        'namespace' => 'Only list pages in this namespace (3)',
                        'user' => 'Only list revisions by this user',
                        'excludeuser' => 'Don\'t list revisions by this user',
-                       'continue' => 'When more results are available, use this to continue (3)',
+                       'continue' => 'When more results are available, use this to continue (1, 3)',
                        'unique' => 'List only one revision for each page (3)',
                );
        }
@@ -399,7 +399,6 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        array( 'code' => 'badparams', 'info' => "The 'from' parameter cannot be used in modes 1 or 2" ),
                        array( 'code' => 'badparams', 'info' => "The 'to' parameter cannot be used in modes 1 or 2" ),
                        array( 'code' => 'badparams', 'info' => "The 'prefix' parameter cannot be used in modes 1 or 2" ),
-                       array( 'code' => 'badparams', 'info' => "The 'continue' parameter cannot be used in modes 1 or 2" ),
                        array( 'code' => 'badparams', 'info' => "The 'start' parameter cannot be used in mode 3" ),
                        array( 'code' => 'badparams', 'info' => "The 'end' parameter cannot be used in mode 3" ),
                ) );
index 6acca67..24849bd 100644 (file)
@@ -149,6 +149,26 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                $this->addTables( 'recentchanges' );
                $index = array( 'recentchanges' => 'rc_timestamp' ); // May change
                $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
+
+               if ( !is_null( $params['continue'] ) ) {
+                       $cont = explode( '|', $params['continue'] );
+                       if ( count( $cont ) != 2 ) {
+                               $this->dieUsage( 'Invalid continue param. You should pass the ' .
+                                                               'original value returned by the previous query', '_badcontinue' );
+                       }
+
+                       $timestamp = $this->getDB()->addQuotes( wfTimestamp( TS_MW, $cont[0] ) );
+                       $id = intval( $cont[1] );
+                       $op = $params['dir'] == 'descending' ? '<' : '>';
+
+                       $this->addWhere(
+                               "rc_timestamp $op $timestamp OR " .
+                               "(rc_timestamp = $timestamp AND " .
+                               "rc_id <= $id)"
+                       );
+               }
+
+
                $this->addWhereFld( 'rc_namespace', $params['namespace'] );
                $this->addWhereFld( 'rc_deleted', 0 );
 
@@ -229,8 +249,9 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                                $this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' );
                        }
 
+                       $this->addFields( 'rc_id' );
                        /* Add fields to our query if they are specified as a needed parameter. */
-                       $this->addFieldsIf( array( 'rc_id', 'rc_this_oldid', 'rc_last_oldid' ), $this->fld_ids );
+                       $this->addFieldsIf( array( 'rc_this_oldid', 'rc_last_oldid' ), $this->fld_ids );
                        $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment );
                        $this->addFieldsIf( 'rc_user', $this->fld_user );
                        $this->addFieldsIf( 'rc_user_text', $this->fld_user || $this->fld_userid );
@@ -281,7 +302,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                foreach ( $res as $row ) {
                        if ( ++ $count > $params['limit'] ) {
                                // We've reached the one extra which shows that there are additional pages to be had. Stop here...
-                               $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
+                               $this->setContinueEnumParameter( 'continue', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) . '|' . $row->rc_id );
                                break;
                        }
 
@@ -295,7 +316,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                                }
                                $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $vals );
                                if ( !$fit ) {
-                                       $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
+                                       $this->setContinueEnumParameter( 'continue', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) . '|' . $row->rc_id );
                                        break;
                                }
                        } else {
@@ -584,6 +605,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                                )
                        ),
                        'toponly' => false,
+                       'continue' => null,
                );
        }
 
@@ -621,6 +643,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
                        'limit' => 'How many total changes to return',
                        'tag' => 'Only list changes tagged with this tag',
                        'toponly' => 'Only list changes which are the latest revision',
+                       'continue' => 'When more results are available, use this to continue',
                );
        }
 
index ac13589..596fd06 100644 (file)
@@ -139,11 +139,15 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
                if ( $wgContLang->linkPrefixExtension() ) {
                        $data['linkprefix'] = wfMessage( 'linkprefix' )->inContentLanguage()->text();
+               } else {
+                       $data['linkprefix'] = '';
                }
 
                $linktrail = $wgContLang->linkTrail();
                if ( $linktrail ) {
                        $data['linktrail'] = $linktrail;
+               } else {
+                       $data['linktrail'] = '';
                }
 
                $git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] );
index 7106b06..3e51299 100644 (file)
@@ -46,7 +46,7 @@ class ApiWatch extends ApiBase {
 
                $res = array( 'title' => $title->getPrefixedText() );
 
-               // Currently unnecessary, code to act as a safeguard against any change in current behaviour of uselang
+               // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
                // Copy from ApiParse
                $oldLang = null;
                if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {
index 31345af..9ebd98e 100644 (file)
@@ -335,7 +335,7 @@ interface Content {
         * target is hit in order to provide (hopefully) the Title of the final
         * destination instead of another redirect.
         *
-        * There is usually no need to override the default behaviour, subclasses that
+        * There is usually no need to override the default behavior, subclasses that
         * want to implement redirects should override getRedirectTarget().
         *
         * @since 1.21
index 5e0447f..d87c72d 100644 (file)
@@ -83,7 +83,7 @@ abstract class ContentHandler {
         *   form of the content.
         * - If $wgContentHandlerTextFallback is 'ignore' and $content is not a
         *   TextContent object, this method returns null.
-        * - otherwise, the behaviour is undefined.
+        * - otherwise, the behavior is undefined.
         *
         * @since 1.21
         *
index 311691d..20d9ca9 100644 (file)
@@ -117,14 +117,14 @@ class LoadBalancer {
         * Given an array of non-normalised probabilities, this function will select
         * an element and return the appropriate key
         *
-        * @deprecated 1.21, use wfPickRandom()
+        * @deprecated 1.21, use ArrayUtils::pickRandom()
         *
         * @param $weights array
         *
         * @return bool|int|string
         */
        function pickRandom( $weights ) {
-               return wfPickRandom( $weights );
+               return ArrayUtils::pickRandom( $weights );
        }
 
        /**
index 6acc124..dc8649b 100644 (file)
@@ -509,11 +509,7 @@ class ORMRow implements IORMRow {
                                        $value = (float)$value;
                                        break;
                                case 'bool':
-                                       if ( is_string( $value ) ) {
-                                               $value = $value !== '0';
-                                       } elseif ( is_int( $value ) ) {
-                                               $value = $value !== 0;
-                                       }
+                                       $value = (bool)$value;
                                        break;
                                case 'array':
                                        if ( is_string( $value ) ) {
index 5a80bee..790a5c6 100644 (file)
@@ -78,6 +78,19 @@ class ScopedLock {
                return null;
        }
 
+       /**
+        * Release a scoped lock and set any errors in the attatched Status object.
+        * This is useful for early release of locks before function scope is destroyed.
+        * This is the same as setting the lock object to null.
+        *
+        * @param ScopedLock $lock
+        * @return void
+        * @since 1.21
+        */
+       public static function release( ScopedLock &$lock = null ) {
+               $lock = null;
+       }
+
        function __destruct() {
                $wasOk = $this->status->isOK();
                $this->status->merge( $this->manager->unlock( $this->paths, $this->type ) );
index 05e71d4..6dbe245 100644 (file)
@@ -490,6 +490,18 @@ class FileRepo {
                return $result;
        }
 
+       /**
+        * Return an array of files where the name starts with $prefix.
+        *
+        * STUB
+        * @param string $prefix The prefix to search for
+        * @param int $limit The maximum amount of files to return
+        * @return array
+        */
+       public function findFilesByPrefix( $prefix, $limit ) {
+               return array();
+       }
+
        /**
         * Get the public root URL of the repository
         *
index 0fbaeef..229f8bf 100644 (file)
@@ -281,6 +281,34 @@ class LocalRepo extends FileRepo {
                return $result;
        }
 
+       /**\r
+        * Return an array of files where the name starts with $prefix.\r
+        *\r
+        * @param string $prefix The prefix to search for\r
+        * @param int $limit The maximum amount of files to return\r
+        * @return array\r
+        */\r
+       public function findFilesByPrefix( $prefix, $limit ) {
+               $selectOptions = array( 'ORDER BY' => 'img_name', 'LIMIT' => intval( $limit ) );
+
+               // Query database\r
+               $dbr = $this->getSlaveDB();
+               $res = $dbr->select(
+                       'image',
+                       LocalFile::selectFields(),
+                       'img_name ' . $dbr->buildLike( $prefix, $dbr->anyString() ),
+                       __METHOD__,
+                       $selectOptions
+                       );
+
+               // Build file objects
+               $files = array();
+               foreach ( $res as $row ) {
+                       $files[] = $this->newFileFromRow( $row );
+               }
+               return $files;\r
+       }
+
        /**
         * Get a connection to the slave DB
         * @return DatabaseBase
index d3aea9f..1423d35 100644 (file)
@@ -18,10 +18,10 @@ repository-specific configuration is needed, or in static members of File or
 FileRepo, where no such configuration is needed.
 
 File objects are generated by a factory function from the repository. The
-repository thus has full control over the behaviour of its subsidiary file
+repository thus has full control over the behavior of its subsidiary file
 class, since it can subclass the file class and override functionality at its
 whim. Thus there is no need for the File subclass to query its parent repository
-for information about repository-class-dependent behaviour -- the file subclass
+for information about repository-class-dependent behavior -- the file subclass
 is generally fully aware of the static preferences of its repository. Limited
 exceptions can be made to this rule to permit sharing of functions, or perhaps
 even entire classes, between repositories.
index 610f556..ee5883c 100644 (file)
@@ -115,7 +115,7 @@ class ForeignDBFile extends LocalFile {
         * @return string
         */
        function getDescriptionUrl() {
-               // Restore remote behaviour
+               // Restore remote behavior
                return File::getDescriptionUrl();
        }
 
@@ -123,7 +123,7 @@ class ForeignDBFile extends LocalFile {
         * @return string
         */
        function getDescriptionText() {
-               // Restore remote behaviour
+               // Restore remote behavior
                return File::getDescriptionText();
        }
 }
index 23a5494..dae026c 100644 (file)
@@ -236,6 +236,23 @@ class JobQueueGroup {
                return $types;
        }
 
+       /**
+        * Check if jobs should not be popped of a queue right now.
+        * This is only used for performance, such as to avoid spamming
+        * the queue with many sub-jobs before they actually get run.
+        *
+        * @param $type string
+        * @return bool
+        */
+       public function isQueueDeprioritized( $type ) {
+               if ( $type === 'refreshLinks2' ) {
+                       // Don't keep converting refreshLinks2 => refreshLinks jobs if the
+                       // later jobs have not been done yet. This helps throttle queue spam.
+                       return !$this->get( 'refreshLinks' )->isEmpty();
+               }
+               return false;
+       }
+
        /**
         * Execute any due periodic queue maintenance tasks for all queues.
         *
index 76c5b6a..bfcbc97 100644 (file)
@@ -76,6 +76,9 @@ class CSSJanus {
                'cursor_west' => null,
                'four_notation_quantity' => null,
                'four_notation_color' => null,
+               'box_shadow' => null,
+               'text_shadow1' => null,
+               'text_shadow2' => null,
                'bg_horizontal_percentage' => null,
                'bg_horizontal_percentage_x' => null,
        );
@@ -96,7 +99,7 @@ class CSSJanus {
                $patterns['ident'] = "-?{$patterns['nmstart']}{$patterns['nmchar']}*";
                $patterns['quantity'] = "{$patterns['num']}(?:\s*{$patterns['unit']}|{$patterns['ident']})?";
                $patterns['possibly_negative_quantity'] = "((?:-?{$patterns['quantity']})|(?:inherit|auto))";
-               $patterns['color'] = "(#?{$patterns['nmchar']}+)";
+               $patterns['color'] = "(#?{$patterns['nmchar']}+|(?:rgba?|hsla?)\([ \d.,%-]+\))";
                $patterns['url_chars'] = "(?:{$patterns['url_special_chars']}|{$patterns['nonAscii']}|{$patterns['escape']})*";
                $patterns['lookahead_not_open_brace'] = "(?!({$patterns['nmchar']}|\r?\n|\s|#|\:|\.|\,|\+|>)*?{)";
                $patterns['lookahead_not_closing_paren'] = "(?!{$patterns['url_chars']}?{$patterns['valid_after_uri_chars']}\))";
@@ -113,8 +116,11 @@ class CSSJanus {
                $patterns['rtl_in_url'] = "/{$patterns['lookbehind_not_letter']}(rtl){$patterns['lookahead_for_closing_paren']}/i";
                $patterns['cursor_east'] = "/{$patterns['lookbehind_not_letter']}([ns]?)e-resize/";
                $patterns['cursor_west'] = "/{$patterns['lookbehind_not_letter']}([ns]?)w-resize/";
-               $patterns['four_notation_quantity'] = "/{$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}/i";
-               $patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}/i";
+               $patterns['four_notation_quantity'] = "/(:\s*){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s*[;}])/i";
+               $patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s*[;}])/i";
+               $patterns['box_shadow'] = "/(box-shadow\s*:\s*(?:inset\s*)?){$patterns['possibly_negative_quantity']}/i";
+               $patterns['text_shadow1'] = "/(text-shadow\s*:\s*){$patterns['color']}(\s*){$patterns['possibly_negative_quantity']}/i";
+               $patterns['text_shadow2'] = "/(text-shadow\s*:\s*){$patterns['possibly_negative_quantity']}/i";
                // The two regexes below are parenthesized differently then in the original implementation to make the
                // callback's job more straightforward
                $patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)(-?{$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
@@ -161,6 +167,7 @@ class CSSJanus {
                $css = self::fixCursorProperties( $css );
                $css = self::fixFourPartNotation( $css );
                $css = self::fixBackgroundPosition( $css );
+               $css = self::fixShadows( $css );
 
                // Detokenize stuff we tokenized before
                $css = $comments->detokenize( $css );
@@ -257,8 +264,43 @@ class CSSJanus {
         * @return string
         */
        private static function fixFourPartNotation( $css ) {
-               $css = preg_replace( self::$patterns['four_notation_quantity'], '$1$2$7$4$5$6$3', $css );
-               $css = preg_replace( self::$patterns['four_notation_color'], '$1$2$3$8$5$6$7$4', $css );
+               $css = preg_replace( self::$patterns['four_notation_quantity'], '$1$2$3$8$5$6$7$4$9', $css );
+               $css = preg_replace( self::$patterns['four_notation_color'], '$1$2$3$8$5$6$7$4$9', $css );
+
+               return $css;
+       }
+
+       /**
+        * Negates horizontal offset in box-shadow and text-shadow rules.
+        *
+        * @param $css string
+        * @return string
+        */
+       private static function fixShadows( $css ) {
+               // Flips the sign of a CSS value, possibly with a unit.
+               // (We can't just negate the value with unary minus due to the units.)
+               $flipSign = function ( $cssValue ) {
+                       // Don't mangle zeroes
+                       if ( intval( $cssValue ) === 0 ) {
+                               return $cssValue;
+                       } elseif ( $cssValue[0] === '-' ) {
+                               return substr( $cssValue, 1 );
+                       } else {
+                               return "-" . $cssValue;
+                       }
+               };
+
+               $css = preg_replace_callback( self::$patterns['box_shadow'], function ( $matches ) use ( $flipSign ) {
+                       return $matches[1] . $flipSign( $matches[2] );
+               }, $css );
+
+               $css = preg_replace_callback( self::$patterns['text_shadow1'], function ( $matches ) use ( $flipSign ) {
+                       return $matches[1] . $matches[2] . $matches[3] . $flipSign( $matches[4] );
+               }, $css );
+
+               $css = preg_replace_callback( self::$patterns['text_shadow2'], function ( $matches ) use ( $flipSign ) {
+                       return $matches[1] . $flipSign( $matches[2] );
+               }, $css );
 
                return $css;
        }
index ef7587d..d77d8ad 100644 (file)
@@ -191,7 +191,7 @@ abstract class GenericArrayObject extends ArrayObject {
        /**
         * Returns an array holding all the data that should go into serialization calls.
         * This is intended to allow overloading without having to reimplement the
-        * behaviour of this base class.
+        * behavior of this base class.
         *
         * @since 1.20
         *
index e9cfa99..065fc3c 100644 (file)
@@ -245,7 +245,7 @@ class IEUrlExtension {
         * whether the script filename has been obscured.
         *
         * The function returns false if the server is not known to have this
-        * behaviour. Microsoft IIS in particular is known to decode escaped script
+        * behavior. Microsoft IIS in particular is known to decode escaped script
         * filenames.
         *
         * SERVER_SOFTWARE typically contains either a plain string such as "Zeus",
index 2404703..87f787d 100644 (file)
@@ -133,7 +133,7 @@ class SqlBagOStuff extends BagOStuff {
                        } else {
                                /*
                                 * We must keep a separate connection to MySQL in order to avoid deadlocks
-                                * However, SQLite has an opposite behaviour. And PostgreSQL needs to know
+                                * However, SQLite has an opposite behavior. And PostgreSQL needs to know
                                 * if we are in transaction or no
                                 */
                                if ( wfGetDB( DB_MASTER )->getType() == 'mysql' ) {
index ed5071e..e10fa57 100644 (file)
@@ -305,7 +305,7 @@ class Parser {
                 * string constructs.
                 *
                 * Must not consist of all title characters, or else it will change
-                * the behaviour of <nowiki> in a link.
+                * the behavior of <nowiki> in a link.
                 */
                $this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString();
                $this->mStripState = new StripState( $this->mUniqPrefix );
@@ -3471,7 +3471,7 @@ class Parser {
                {
                        # Bug 529: if the template begins with a table or block-level
                        # element, it should be treated as beginning a new line.
-                       # This behaviour is somewhat controversial.
+                       # This behavior is somewhat controversial.
                        $text = "\n" . $text;
                }
 
index 468802d..9c7eef5 100644 (file)
@@ -522,7 +522,7 @@ class Preprocessor_DOM implements Preprocessor {
                                if ( $equalsLength > 0 ) {
                                        if ( $searchStart - $equalsLength == $piece->startPos ) {
                                                // This is just a single string of equals signs on its own line
-                                               // Replicate the doHeadings behaviour /={count}(.+)={count}/
+                                               // Replicate the doHeadings behavior /={count}(.+)={count}/
                                                // First find out how many equals signs there really are (don't stop at 6)
                                                $count = $equalsLength;
                                                if ( $count < 3 ) {
index c22da64..fe00e7f 100644 (file)
@@ -462,7 +462,7 @@ class Preprocessor_Hash implements Preprocessor {
                                if ( $equalsLength > 0 ) {
                                        if ( $searchStart - $equalsLength == $piece->startPos ) {
                                                // This is just a single string of equals signs on its own line
-                                               // Replicate the doHeadings behaviour /={count}(.+)={count}/
+                                               // Replicate the doHeadings behavior /={count}(.+)={count}/
                                                // First find out how many equals signs there really are (don't stop at 6)
                                                $count = $equalsLength;
                                                if ( $count < 3 ) {
index 5abe226..52f2009 100644 (file)
@@ -451,7 +451,7 @@ class ResourceLoader {
                                        $this->hasErrors = true;
                                        continue;
                                }
-                               $modules[$name] = $this->getModule( $name );
+                               $modules[$name] = $module;
                        } else {
                                $missing[] = $name;
                        }
index 68161b9..0de97af 100644 (file)
@@ -304,7 +304,7 @@ class MediaWikiSite extends Site {
         * @see Site::getPageUrl
         *
         * This implementation returns a URL constructed using the path returned by getLinkPath().
-        * In addition to the default behaviour implemented by Site::getPageUrl(), this
+        * In addition to the default behavior implemented by Site::getPageUrl(), this
         * method converts the $pageName to DBKey-format by replacing spaces with underscores
         * before using it in the URL.
         *
index 3840b2f..13e2351 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 /**
- * A special page called by proxy_check.php to block open proxies
+ * A special page called by proxyCheck.php to block open proxies
  *
  * @ingroup SpecialPage
  */
index e086650..d0ae101 100644 (file)
@@ -47,7 +47,7 @@ class SpecialFilepath extends SpecialPage {
                        $file = wfFindFile( $title );
 
                        if ( $file && $file->exists() ) {
-                               // Default behaviour: Use the direct link to the file.
+                               // Default behavior: Use the direct link to the file.
                                $url = $file->getURL();
                                $width = $request->getInt( 'width', -1 );
                                $height = $request->getInt( 'height', -1 );
index 77f0ddb..3dc90c6 100644 (file)
@@ -261,7 +261,7 @@ class SpecialSearch extends SpecialPage {
                if( $textMatches && $textMatches->hasSuggestion() ) {
                        $st = SpecialPage::getTitleFor( 'Search' );
 
-                       # mirror Go/Search behaviour of original request ..
+                       # mirror Go/Search behavior of original request ..
                        $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
 
                        if( $this->fulltext != null ) {
index f4bc666..7d6d90e 100644 (file)
@@ -277,21 +277,56 @@ class SpecialStatistics extends SpecialPage {
                return $text;
        }
 
-       private function getOtherStats( $stats ) {
-               if ( !count( $stats ) )
-                       return '';
+       /**
+        * Conversion of external statistics into an internal representation
+        * Following a ([<header-message>][<item-message>] = number) pattern
+        *
+        * @param array $stats
+        * @return string
+        */
+       private function getOtherStats( array $stats ) {
+               $return = '';
 
-               $return = Xml::openElement( 'tr' ) .
-                       Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( 'statistics-header-hooks' )->parse() ) .
-                       Xml::closeElement( 'tr' );
+               foreach( $stats as $header => $items ) {
+
+                       // Identify the structure used
+                       if ( is_array( $items ) ) {
 
-               foreach( $stats as $name => $number ) {
-                       $name = htmlspecialchars( $name );
-                       $number = htmlspecialchars( $number );
+                               // Ignore headers that are recursively set as legacy header
+                               if ( $header !== 'statistics-header-hooks' ) {
+                                       $return .= $this->formatRowHeader( $header );
+                               }
+
+                               // Collect all items that belong to the same header
+                               foreach( $items as $key => $value ) {
+                                       $name = $this->msg( $key )->inContentLanguage()->parse();
+                                       $number = htmlspecialchars( $value );
 
-                       $return .= $this->formatRow( $name, $this->getLanguage()->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) );
+                                       $return .= $this->formatRow( $name, $this->getLanguage()->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) );
+                               }
+                       } else {
+                               // Create the legacy header only once
+                               if ( $return === '' ) {
+                                       $return .= $this->formatRowHeader( 'statistics-header-hooks' );
+                               }
+
+                               // Recursively remap the legacy structure
+                               $return .= $this->getOtherStats( array( 'statistics-header-hooks' => array( $header => $items ) ) );
+                       }
                }
 
                return $return;
        }
+
+       /**
+        * Format row header
+        *
+        * @param string $header
+        * @return string
+        */
+       private function formatRowHeader( $header ) {
+               return Xml::openElement( 'tr' ) .
+                       Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( $header )->parse() ) .
+                       Xml::closeElement( 'tr' );
+       }
 }
index 49713fc..9d756f8 100644 (file)
@@ -1377,6 +1377,17 @@ abstract class UploadBase {
                        }
                }
 
+               // Check for files with the same name but a different extension
+               $similarFiles = RepoGroup::singleton()->getLocalRepo()->findFilesByPrefix(
+                               "{$partname}.", 1 );
+               if ( count( $similarFiles ) ) {
+                       return array(\r
+                               'warning' => 'exists-normalized',\r
+                               'file' => $file,\r
+                               'normalizedFile' => $similarFiles[0],\r
+                       );
+               }
+
                if ( self::isThumbName( $file->getName() ) ) {
                        # Check for filenames like 50px- or 180px-, these are mostly thumbnails
                        $nt_thb = Title::newFromText( substr( $partname, strpos( $partname, '-' ) + 1 ) . '.' . $extension, NS_FILE );
index fe75026..0d688cb 100644 (file)
@@ -2497,7 +2497,7 @@ Roit a-is an abeg resis (o verkañ, da skouer, roll ar pajennoù bet graet gaou
 ** Emzalc'h hegazus/handeus betek re
 ** Mont re bell gant implij meur a gont
 ** Anv implijer n'eo ket aotreet",
-'ipb-hardblock' => "Mirout a ra ouzh an implijerien kevreet da zegas kemmoù adalek ar c'homlec'h IP-mañ",
+'ipb-hardblock' => "Mirout ouzh an implijerien kevreet da zegas kemmoù adalek ar chomlec'h IP-mañ",
 'ipbcreateaccount' => 'Mirout ouzh an implijer da grouiñ kontoù',
 'ipbemailban' => 'Mirout ouzh an implijer da gas posteloù',
 'ipbenableautoblock' => "Stankañ war-eeun ar chomlec'h IP diwezhañ implijet gant an den-mañ hag an holl chomlec'hioù a c'hallfe klask kemmañ traoù drezo drezo diwezhatoc'h",
index a5f9ea4..1403867 100644 (file)
@@ -3220,8 +3220,8 @@ Gurênayışê nae de, beno ke sistemê şıma zerar bıvêno.",
 'minutes' => 'verdê {{PLURAL:$1|$1 daka|$1 daka}}',
 'hours' => 'Verdê {{PLURAL:$1|$1 seata|$1 seata}}',
 'days' => 'Verdê {{PLURAL:$1|$1 rocan|$1 rocan}}',
-'months' => '{{PLURAL:$1|aşmi|$1 aşman}}',
-'years' => '{{PLURAL:$1|$1 ser|$1 seran}}',
+'months' => '{{PLURAL:$1|aşme|$1 aşmi}}',
+'years' => '{{PLURAL:$1|$1 serre|$1 serri}}',
 'ago' => 'Verdê $1',
 'just-now' => 'Hema newke',
 
index 899c220..4debb3f 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 /**
- * Fallback language, used for all unspecified messages and behaviour. This
+ * Fallback language, used for all unspecified messages and behavior. This
  * is English by default, for all files other than this one.
  *
  * Do NOT set this to false in any other message file! Leave the line out to
@@ -620,7 +620,7 @@ $messages = array(
 /*
 The sidebar for MonoBook is generated from this message, lines that do not
 begin with * or ** are discarded, furthermore lines that do begin with ** and
-do not contain | are also discarded, but do not depend on this behaviour for
+do not contain | are also discarded, but do not depend on this behavior for
 future releases. Also note that since each list value is wrapped in a unique
 XHTML id it should only appear once and include characters that are legal
 XHTML id names.
@@ -3198,7 +3198,7 @@ Fill in a specific reason below (for example, citing particular pages that were
 ** Removing content from pages
 ** Spamming links to external sites
 ** Inserting nonsense/gibberish into pages
-** Intimidating behaviour/harassment
+** Intimidating behavior/harassment
 ** Abusing multiple accounts
 ** Unacceptable username',
 'ipb-hardblock'                   => 'Prevent logged-in users from editing from this IP address',
index 62599b8..6da9f33 100644 (file)
@@ -244,9 +244,9 @@ $messages = array(
 'hidden-category-category' => 'Kategoria ezkutuak',
 'category-subcat-count' => '{{PLURAL:$2|Kategoria honek beste honako azpikategoria baino ez du.|Kategoria honek honako {{PLURAL:$1|azpikategoria du|$1 azpikategoriak ditu}}, guztira dauden $2tik.}}',
 'category-subcat-count-limited' => 'Kategoria honek {{PLURAL:$1|azpikategoria hau du|$1 azpikategoria hauek ditu}}.',
-'category-article-count' => '{{PLURAL:$2|Kategoria honek honako orrialdea baino ez du.|Honako {{PLURAL:$1|orrialdea kategoria honetan dago|$1 orrialdeak kategoria hauetan daude}}, guztira dauden $2 (e)tik.}}',
+'category-article-count' => '{{PLURAL:$2|Kategoria honek ondorengo orri hau baino ez du.|Ondorengo {{PLURAL:$1|orri hau kategoria honetan dago|$1 orriak kategoria honetan daude}}. Guztira $2 orri dira kategoria honetan.}}',
 'category-article-count-limited' => 'Ondorengo {{PLURAL:$1|orri hau kategoria honetan dago.|$1 orri hauek kategoria honetan daude.}}',
-'category-file-count' => '{{PLURAL:$2|Kategoria honek fitxategi hau baino ez du.|Honako {{PLURAL:$1|fitxategia kategoria honetan dago|$1 fitxategiak kategoria honetan daude}} guztira dauden $2 (e)tik.}}',
+'category-file-count' => '{{PLURAL:$2|Kategoria honek ondorengo fitxategi hau baino ez du.|Ondorengo {{PLURAL:$1|fitxategi hau kategoria honetan dago|$1 fitxategiak kategoria honetan daude}}. Guztira $2 fitxategi dira kategoria honetan.}}',
 'category-file-count-limited' => 'Ondorengo {{PLURAL:$1|fitxategia kategoria honetan dago.|$1 fitxategiak kategoria honetan daude.}}',
 'listingcontinuesabbrev' => 'jarr.',
 'index-category' => 'Indexatutako orrialdeak',
@@ -313,7 +313,7 @@ $messages = array(
 'editthispage' => 'Orri hau aldatu',
 'create-this-page' => 'Orrialde hau sortu',
 'delete' => 'Ezabatu',
-'deletethispage' => 'Orrialde hau ezabatu',
+'deletethispage' => 'Ezabatu orri hau',
 'undelete_short' => 'Berreskuratu {{PLURAL:$1|aldaketa bat|$1 aldaketa}}',
 'viewdeleted_short' => 'Ikusi ezabatutako {{PLURAL:$1|bidalketa bat|$1 bidalketa}}',
 'protect' => 'Babestu',
@@ -1004,10 +1004,10 @@ Ezin duzu atzitu.',
 'revdelete-concurrent-change' => 'Errorea, $1 $2 data duen elementua aldatzean: badirudi haren egoera aldatu duela nor edo nork, zu aldatzen saiatzen ari zinela.
 Begira itzazu erregistroak.',
 'revdelete-reason-dropdown' => '*Ezabatzeko ohiko arrazoiak
-** Egile eskubideen urraketa
+** Egile eskubideak urratzea
 ** Informazio pertsonal edo iruzkin desegokia
 ** Lankide izen desegokia
-** Iraingarria izan daitekeen informazioa',
+** Kalumnia edo iraintzat jo daiteke',
 'revdelete-otherreason' => 'Bestelako arrazoia:',
 'revdelete-reasonotherlist' => 'Beste arrazoi bat',
 'revdelete-edit-reasonlist' => 'Ezabaketa arrazoiak aldatu',
@@ -2273,7 +2273,9 @@ Ikus [[Special:BlockList|blokeoen zerrenda]] blokeoak aztertzeko.',
 'blocklist' => 'Blokeatutako erabiltzaileak',
 'ipblocklist' => 'Blokeatutako erabiltzaileak',
 'ipblocklist-legend' => 'Blokeatutako erabiltzaile bat bilatu',
+'blocklist-timestamp' => 'Eguna eta ordua',
 'blocklist-target' => 'Helburua',
+'blocklist-by' => 'Blokeoa ezarri duen administratzailea',
 'blocklist-reason' => 'Arrazoia',
 'ipblocklist-submit' => 'Bilatu',
 'ipblocklist-localblock' => 'Tokiko blokeoa',
@@ -2298,7 +2300,7 @@ Ikus [[Special:BlockList|blokeoen zerrenda]] blokeoak aztertzeko.',
 Blokeo erregistroa ematen da azpian erreferentziarako:',
 'blocklog-showsuppresslog' => 'Lankide hau aurretik blokeatua eta ezkutatua izan da.
 Erregistroa ematen da azpian erreferentziarako:',
-'blocklogentry' => '"[[$1]]" wikilariari blokeoa ezarri zaio. Blokeoaldia: $2 $3',
+'blocklogentry' => 'wikilariak [[$1]] erabiltzailea blokeatu du. Blokeoaldia: $2 $3',
 'reblock-logentry' => '[[$1]] wikilariari blokeoaldia aldatu diogu. Blokeoaldi berria: $2 $3',
 'blocklogtext' => 'Erabiltzaileen blokeoen ezarpen eta ezabaketen erregistroa da hau. 
 Automatikoki blokeatutako IP helbideak ez dira zerrendatzen. 
@@ -3353,7 +3355,9 @@ Irudiak bereizmen handienean daude, bestelako fitxategi motak beraiei esleitutak
 'htmlform-selectorother-other' => 'Beste bat',
 
 # New logging system
-'logentry-delete-delete' => '$1 wikilariak $3 orria ezabatu du',
+'logentry-delete-delete' => '$1 wikilariak «$3» orria ezabatu du',
+'logentry-delete-event' => '$1 wikilariak ikusgaitasuna aldatu {{PLURAL:$5|dio erregistroko sarrera bati|die erregistroko $5 sarrerari}}, $3 orrian: $4',
+'logentry-suppress-event' => '$1 wikilariak ezkutuan ikusgaitasuna aldatu {{PLURAL:$5|dio erregistroko sarrera bati|die erregistroko $5 sarrerari}}, $3 orrian: $4',
 'revdelete-restricted' => 'administratzaileentzako mugak ezarri dira',
 'revdelete-unrestricted' => 'administratzaileentzako mugak kendu dira',
 'logentry-move-move' => '$1 wikilariak «$3» orria «$4» izenera aldatu du',
index 6f0b4c5..ea62cba 100644 (file)
@@ -1154,7 +1154,7 @@ Shoh ny reaghaghyn roie da'n duillag '''$1''':",
 ** Removing content from pages
 ** Spamming links to external sites
 ** Inserting nonsense/gibberish into pages
-** Intimidating behaviour/harassment
+** Intimidating behavior/harassment
 ** Abusing multiple accounts
 * Oyr elley
 ** Ennym ymmydeyryn neuchooie
index a9d9597..aa16856 100644 (file)
@@ -3977,8 +3977,8 @@ A képek teljes méretben jelennek meg, más fájltípusok közvetlenül a hozz
 'logentry-newusers-create2' => '$1 létrehozta $3 felhasználói fiókját',
 'logentry-newusers-byemail' => 'Szerkesztői lap $3 néven létrehozva $1 által, jelszó kiküldve emailben.',
 'logentry-newusers-autocreate' => '$1 fiók automatikusan létrehozva',
-'logentry-rights-rights' => '$1 megváltoztatta $3 csoport tagságát erről: $4 erre: $5',
-'logentry-rights-rights-legacy' => '$1 megváltoztatta $3 csoport tagságát',
+'logentry-rights-rights' => '$1 megváltoztatta $3 csoporttagságát erről: $4 erre: $5',
+'logentry-rights-rights-legacy' => '$1 megváltoztatta $3 csoporttagságát',
 'logentry-rights-autopromote' => '$1 automatikusan előléptetve erről: $4 erre: $5',
 'rightsnone' => '(semmi)',
 
index 8956b61..ed04290 100644 (file)
@@ -1961,6 +1961,8 @@ $1',
 ამის ნაცვლად, სავარაუდოდ, ისისნი უნდა მიუთითებდნენ შესაბამის კონკრეტულ სტატიაზე.<br />
 გვერდი ითვლება მრავამნიშვნელოვნად, თუ მასში განთავსებულია თარგი, რომლის სახელიც მითითებულია გვერდზე [[MediaWiki:Disambiguationspage]].",
 
+'pageswithprop-prop' => 'თვისების სახელი:',
+
 'doubleredirects' => 'ორმაგი გადამისამართება',
 'doubleredirectstext' => 'ამ გვერდზე ჩამოთვლილია გვერდები, რომლებიც გადამისამართებულია სხვა გადამისამართების გვერდებზე.
 ყოველი მწკრივი შეიცავს ბმულებს პირველ და მეორე გადამისამართებაზე, აგრეთვე მეორე გადამისამართების ტექსტის პირველ სტრიქონს, რომელშიც ჩვეულებრივ მითითებულია რეალური „სამიზნე“ გვერდის სათაური. საჭიროა, რომ პირველი გადამისამართებაც უთითებდეს ამ გვერდზე.
@@ -4026,4 +4028,6 @@ MediaWiki ვრცელდება იმ იმედით, რომ ი
 'duration-centuries' => '$1 {{PLURAL:$1|საუკუნე|საუკუნე}}',
 'duration-millennia' => '$1 {{PLURAL:$1|ათასწლეული|ათასწლეული}}',
 
+# Unknown messages
+'pageswithprop-submit' => 'მიდი',
 );
index e1080cf..16ef4e5 100644 (file)
@@ -253,18 +253,18 @@ $messages = array(
 'thu' => 'Juğ',
 'fri' => 'Vie',
 'sat' => 'Shab',
-'january' => 'Enero',
-'february' => 'Fevrero',
+'january' => 'Jenero',
+'february' => 'Hevrero',
 'march' => 'Março',
-'april' => 'Abril',
+'april' => 'Avril',
 'may_long' => 'Mayo',
-'june' => 'Junio',
+'june' => 'Juño',
 'july' => 'Jullo',
 'august' => 'Agosto',
-'september' => 'Setembre',
-'october' => 'Ochůvre',
-'november' => 'Novembre',
-'december' => 'Diziembre',
+'september' => 'Setiembre',
+'october' => 'Ochòvre',
+'november' => 'Noviembre',
+'december' => 'Deziembre',
 'january-gen' => 'Enero',
 'february-gen' => 'Fevrero',
 'march-gen' => 'Março',
@@ -419,7 +419,7 @@ $messages = array(
 'policy-url' => 'Project:Politikas',
 'portal' => 'Puertal de la komunitá',
 'portal-url' => 'Project:Puertal de la komunitá',
-'privacy' => 'Principio de particůlaridad',
+'privacy' => 'Principio de particòlaridad',
 'privacypage' => 'Project:Principio de particůlaridad',
 
 'badaccess' => 'Yerro de permissión',
@@ -435,7 +435,7 @@ $messages = array(
 'viewsourceold' => 'Ver su manadero',
 'editlink' => 'trocar',
 'viewsourcelink' => 'ver su manadero',
-'editsectionhint' => 'Troca el capítůlo: $1',
+'editsectionhint' => 'Troca el kapítolo: $1',
 'toc' => 'Contènidos',
 'showtoc' => 'Amostrar',
 'hidetoc' => 'esconder',
@@ -888,7 +888,7 @@ La descripción en su [$2 hoja de descripción del arxivo] está amostrada debax
 # Special:ListGroupRights
 'listgrouprights-members' => '(ver los miembros de este grupo)',
 
-# E-mail user
+# Email user
 'emailuser' => 'Embia e-mail a este usuario',
 
 # Watchlist
@@ -1009,7 +1009,7 @@ A continuación se mostran las opciones actuales de la hoja '''$1''':",
 'blocklink' => 'blokea',
 'unblocklink' => 'quita el bloqueo',
 'change-blocklink' => 'troca el blokeo',
-'contribslink' => 'Àjustamientos',
+'contribslink' => 'donos',
 'blocklogpage' => 'Bloqueos de usuarios',
 'blocklogentry' => 'bloqueó a [[$1]] $3 durante un tiempo de $2',
 'unblocklogentry' => 'desbloqueó a "$1"',
@@ -1068,7 +1068,7 @@ Si puede ser, escoge otro nombre.',
 'tooltip-pt-preferences' => 'Mis preferencias',
 'tooltip-pt-watchlist' => 'La lista de los trocamientos acontècidos en las hojas akavidadas.',
 'tooltip-pt-mycontris' => 'La lista de tus àjustamientos',
-'tooltip-pt-login' => "T'encorajamos d'entrar ma no sos obligado",
+'tooltip-pt-login' => 'Te encorajamos de entrar ma no estás obligado',
 'tooltip-pt-logout' => 'Salir',
 'tooltip-ca-talk' => 'Diskusyón encima del artícůlo de contènido',
 'tooltip-ca-edit' => 'Puedes trocar esta hoja. Y si puede ser, usa el botón de previsteo antes de enrejistrar la hoja',
@@ -1084,14 +1084,14 @@ Puedes ver su manadero',
 'tooltip-search' => 'Busca en {{SITENAME}}',
 'tooltip-search-go' => 'Si ay una hoja con este nombre egzakto, vate allá.',
 'tooltip-search-fulltext' => 'Busca este teksto en las hojas',
-'tooltip-p-logo' => 'Visita la primera hoja',
+'tooltip-p-logo' => 'Vate a la primera hoja',
 'tooltip-n-mainpage' => 'Visita la primera hoja',
 'tooltip-n-mainpage-description' => 'Visita la primera hoja',
 'tooltip-n-portal' => 'Encima del projeto, lo que puedes hazer y ánde topar todo',
 'tooltip-n-currentevents' => 'Información encima de los acontècimientos de oy día',
-'tooltip-n-recentchanges' => 'La lista de los trocamientos freskos en el viki',
-'tooltip-n-randompage' => 'Carga una kualunke hoja asegún viene',
-'tooltip-n-help' => 'El lugar para âmbezarse',
+'tooltip-n-recentchanges' => 'La lista de los trocamientos muevos en el viki',
+'tooltip-n-randompage' => 'Carga una hoja por asardo',
+'tooltip-n-help' => 'El lugar para saver más',
 'tooltip-t-whatlinkshere' => 'Una lista de todas las hojas del viki que tienen atamientos con esta hoja',
 'tooltip-t-recentchangeslinked' => 'Los trocamientos freskos de las hojas que tienen atamiento con esta hoja',
 'tooltip-feed-rss' => 'Sindicación RSS de esta hoja',
@@ -1133,11 +1133,11 @@ Puedes ver su manadero',
 'show-big-image' => 'Resolución original',
 
 # Bad image list
-'bad_image_list' => "El formato es ańsina:
+'bad_image_list' => 'El formato es ansina:
 
-Cale akavidar sólo elementos de lista (quere dezir: shurás/satires qu'empeçan con *).
-El primer atamiento de cada shurá deve de ser un atamiento á una dosya negra (á la dosya que se quere blokear).
-Los atamientos venideros que stan en la mesma shurá s'aprecian como eksepsiones, por eńxemplo, hojas ande la dosya se ve en la shurá.",
+Cale akavidar sólo elementos de lista (quere dezir: liñas que empeçan con *).
+El primer atamiento de cada liña deve de ser un atamiento á una dosya negra (á la dosya que se quere blokear).
+Los atamientos venideros que están en la mesma liña se aprecian como eksepsiones, por enxemplo, hojas ande la dosya se ve en la liña.',
 
 # Metadata
 'metadata' => 'Metadatos',
@@ -1192,7 +1192,7 @@ Los otros campos se van a guardar por defecto.
 'namespacesall' => 'todos',
 'monthsall' => '(todos)',
 
-# E-mail address confirmation
+# Email address confirmation
 'confirmemail' => 'Konfirmar direksion e-pósta',
 'confirmemail_send' => 'Embiar el kodigo de konfirmasion.',
 'confirmemail_sent' => 'Konfirmasion de pósta embiada.',
index 0417459..13280cc 100644 (file)
@@ -877,7 +877,7 @@ Wacht even voordat u het opnieuw probeert.',
 'loginlanguagelabel' => 'Taal: $1',
 'suspicious-userlogout' => 'Uw verzoek om af te melden is genegeerd, omdat het lijkt alsof het verzoek is verzonden door een browser of cacheproxy die stuk is.',
 
-# E-mail sending
+# Email sending
 'php-mail-error-unknown' => 'Er is een onbekende fout opgetreden in de mail()-functie van PHP',
 'user-mail-no-addy' => 'Geprobeerd een e-mail te verzenden zonder een e-mailadres.',
 'user-mail-no-body' => 'Er is geprobeerd een e-mail te verzenden zonder inhoud of met een hele korte inhoud.',
@@ -1579,7 +1579,7 @@ Als u deze opgeeft, kan deze naam gebruikt worden om u erkenning te geven voor u
 'prefs-displaywatchlist' => 'Weergaveopties',
 'prefs-diffs' => 'Verschillen',
 
-# User preference: e-mail validation using jQuery
+# User preference: email validation using jQuery
 'email-address-validity-valid' => 'Het e-mailadres lijkt geldig',
 'email-address-validity-invalid' => 'Geef een geldig e-mailadres op',
 
@@ -2191,6 +2191,10 @@ Vergeet niet de "Koppelingen naar deze pagina" te controleren alvorens deze sjab
 Deze horen waarschijnlijk direct naar een meer toepasselijke pagina te verwijzen.<br />
 Een pagina wordt gezien als doorverwijspagina als er een sjabloon op staat dat opgenomen is op [[MediaWiki:Disambiguationspage]].",
 
+'pageswithprop' => "Pagina's met een pagina-eigenschap",
+'pageswithprop-text' => "Op deze pagina worden pagina's weergegeven met een bepaalde pagina-eigenschap.",
+'pageswithprop-prop' => 'Naam van de eigenschap:',
+
 'doubleredirects' => 'Dubbele doorverwijzingen',
 'doubleredirectstext' => "Deze lijst bevat pagina's die doorverwijzen naar andere doorverwijspagina's.
 Elke rij bevat koppelingen naar de eerste en de tweede doorverwijspagina en een koppeling naar de doelpagina van de tweede doorverwijspagina.
@@ -2386,7 +2390,7 @@ Er kan [[{{MediaWiki:Listgrouprights-helppage}}|extra informatie]] over individu
 'listgrouprights-addgroup-self-all' => 'Alle groepen toevoegen aan eigen gebruiker',
 'listgrouprights-removegroup-self-all' => 'Alle groepen verwijderen van eigen gebruiker',
 
-# E-mail user
+# Email user
 'mailnologin' => 'Geen verzendadres beschikbaar',
 'mailnologintext' => 'U moet [[Special:UserLogin|aangemeld]] zijn en een geldig e-mailadres in uw [[Special:Preferences|voorkeuren]] vermelden om andere gebruikers te kunnen e-mailen.',
 'emailuser' => 'Deze gebruiker e-mailen',
@@ -3809,7 +3813,7 @@ Andere velden worden verborgen.
 'monthsall' => 'alle',
 'limitall' => 'alle',
 
-# E-mail address confirmation
+# Email address confirmation
 'confirmemail' => 'E-mailadres bevestigen',
 'confirmemail_noemail' => 'U hebt geen geldig e-mailadres ingegeven in uw [[Special:Preferences|gebruikersvoorkeuren]].',
 'confirmemail_text' => '{{SITENAME}} eist bevestiging van uw e-mailadres voordat u de e-mailmogelijkheden kunt gebruiken.
@@ -4233,4 +4237,7 @@ Anders kunt u ook het eenvoudige formulier hieronder gebruiken. Uw reactie wordt
 'duration-centuries' => '$1 {{PLURAL:$1|eeuw|eeuwen}}',
 'duration-millennia' => '$1 {{PLURAL:$1|millennium|millennia}}',
 
+# Unknown messages
+'pageswithprop-legend' => "Pagina's met een pagina-eigenschap",
+'pageswithprop-submit' => 'OK',
 );
index 18c04c4..13e0a46 100644 (file)
@@ -265,7 +265,7 @@ $messages = array(
 'tog-extendwatchlist' => 'କେବଳ ନଗଦ ନୁହେଁ, ସବୁଯାକ ବଦଳକୁ ଦେଖାଇବା ନିମନ୍ତେ ଦେଖଣାତାଲିକାକୁ ବଢ଼ାଇବେ',
 'tog-usenewrc' => 'ନଗଦ ବଦଳରେ ପୃଷ୍ଠା ଅନୁଯାୟୀ ଗୋଷ୍ଠୀ ବଦଳ ଏବଂ ଦେଖଣା (ଜାଭାସ୍କ୍ରିପ୍ଟ ଲୋଡ଼ା)',
 'tog-numberheadings' => 'ଆପେଆପେ-ସଂଖ୍ୟାର ନାମଗୁଡ଼ିକ',
-'tog-showtoolbar' => 'ସମà­\8dପାଦନା à¬\9fà­\81ଲବାର à¬¦à­\87à¬\96ାà¬\87ବà­\87 (à¬\9cାଭାସà­\8dà¬\95à­\8dରିପà­\8dà¬\9f à¬¸à¬\9aଳ à¬\95ରିବà­\87)',
+'tog-showtoolbar' => 'ସମà­\8dପାଦନା à¬\9fà­\81ଲବାର à¬¦à­\87à¬\96ାà¬\87ବà­\87 (à¬\9cାଭାସà­\8dà¬\95à­\8dରିପà­\8dà¬\9f à¬²à­\8bଡ଼ା)',
 'tog-editondblclick' => 'ଦୁଇଥର କ୍ଲିକରେ ପୃଷ୍ଠା ବଦଳାଇବେ (ଜାଭାସ୍କ୍ରିପ୍ଟ ଲୋଡ଼ା)',
 'tog-editsection' => '[ବଦଳାଇବେ] ଲିଙ୍କରେ ବିଭାଗର ସମ୍ପାଦନାକୁ ସଚଳ କରିବେ',
 'tog-editsectiononrightclick' => 'ବିଭାଗ ନାମରେ ଡାହାଣ କ୍ଲିକ କରି ବିଭାଗ ସମ୍ପାଦନାକୁ ସଚଳ କରିବେ (ଜାଭାସ୍କ୍ରିପ୍ଟ ଲୋଡ଼ା)',
@@ -3010,7 +3010,7 @@ MediaWiki ବ୍ୟବହାର କରି [[Special:Import|ପୃଷ୍ଠା 
 'tooltip-n-mainpage-description' => 'ପ୍ରଧାନ ପୃଷ୍ଠା',
 'tooltip-n-portal' => 'ଏହି ପ୍ରକଳ୍ପଟିରେ ଖୋଜା ଖୋଜି ପାଇଁ ଆପଣ କେମିତି ସାହାଯ୍ୟ କରିପାରିବେ',
 'tooltip-n-currentevents' => 'ନଗଦ କାମର ପଛପଟେ ଚାଲିଥିବା କାମର ତଥ୍ୟ',
-'tooltip-n-recentchanges' => 'ବିକିରେ ଏହିମାତ୍ର କରାଯାଇଥିବା ଅଦଳ ବଦଳ',
+'tooltip-n-recentchanges' => 'à­±ିକିରେ ଏହିମାତ୍ର କରାଯାଇଥିବା ଅଦଳ ବଦଳ',
 'tooltip-n-randompage' => 'ଯାହିତାହି ପୃଷ୍ଠାଟିଏ ଖୋଲ',
 'tooltip-n-help' => 'ଖୋଜି ପାଇବା ଭଳି ଜାଗା',
 'tooltip-t-whatlinkshere' => 'ଏଠାରେ ଯୋଡ଼ାଯାଇଥିବା ପୃଷ୍ଠାସବୁର ତାଲିକା',
index 57be6de..317b812 100644 (file)
@@ -346,8 +346,8 @@ Parameters:
 'listingcontinuesabbrev' => 'Shown in contiuation of each first letter group. This message follows the first letter.
 
 See http://test.wikipedia.org/wiki/Category:Test_ko?uselang={{SUBPAGENAME}}, for example.',
-'index-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__INDEX__</nowiki> behaviour switch are listed. For description of this behaviour switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
-'noindex-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__NOINDEX__</nowiki> behaviour switch are listed. For description of this behaviour switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
+'index-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__INDEX__</nowiki> behavior switch are listed. For description of this behavior switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
+'noindex-category' => 'Name of the [[mw:Help:Tracking categories|tracking category]] where pages with the <nowiki>__NOINDEX__</nowiki> behavior switch are listed. For description of this behavior switch see [[mw:Help:Magic_words#Behavior_switches|MediaWiki]].',
 'broken-file-category' => 'Name of [[mw:Help:Tracking categories|tracking category]] where pages that embed files that do not exist ("broken images") are listed.',
 'categoryviewer-pagedlinks' => '{{Optional}}
 The pagination links in category viewer. Parameters:
index 9f95f5d..5cb6f5f 100644 (file)
@@ -93,7 +93,7 @@ installations.
        runJobs.php
        Immediately complete all jobs in the job queue
 
-       stats.php
+       showCacheStats.php
        Show all statistics stored in the cache
 
        undelete.php
@@ -106,4 +106,4 @@ installations.
        Update pages restriction to the new schema
 
        userOptions.php
-       Change user options
\ No newline at end of file
+       Change user options
diff --git a/maintenance/clearCacheStats.php b/maintenance/clearCacheStats.php
new file mode 100644 (file)
index 0000000..7a0d664
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Removes all statistics tracking from the cache.
+ *
+ * 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 Maintenance
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to remove all statistics tracking from the cache.
+ *
+ * @ingroup Maintenance
+ */
+class ClearCacheStats extends Maintenance {
+
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = "Remove all statistics tracking from the cache";
+       }
+
+       public function execute() {
+               global $wgLocalDatabases, $wgMemc;
+               foreach ( $wgLocalDatabases as $db ) {
+                       $wgMemc->delete( "$db:stats:request_with_session" );
+                       $wgMemc->delete( "$db:stats:request_without_session" );
+                       $wgMemc->delete( "$db:stats:pcache_hit" );
+                       $wgMemc->delete( "$db:stats:pcache_miss_expired" );
+                       $wgMemc->delete( "$db:stats:pcache_miss_absent" );
+                       $wgMemc->delete( "$db:stats:pcache_miss_stub" );
+                       $wgMemc->delete( "$db:stats:image_cache_hit" );
+                       $wgMemc->delete( "$db:stats:image_cache_miss" );
+                       $wgMemc->delete( "$db:stats:image_cache_update" );
+                       $wgMemc->delete( "$db:stats:diff_cache_hit" );
+                       $wgMemc->delete( "$db:stats:diff_cache_miss" );
+                       $wgMemc->delete( "$db:stats:diff_uncacheable" );
+                       $wgMemc->delete( "$db:stats:job-insert" );
+                       $wgMemc->delete( "$db:stats:job-pop" );
+               }
+       }
+}
+
+$maintClass = "ClearCacheStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/clearInterwikiCache.php b/maintenance/clearInterwikiCache.php
new file mode 100644 (file)
index 0000000..88769df
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Clear the cache of interwiki prefixes for all local wikis.
+ *
+ * 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 Maintenance
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to clear the cache of interwiki prefixes for all local wikis.
+ *
+ * @ingroup Maintenance
+ */
+class ClearInterwikiCache extends Maintenance {
+
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = "Clear all interwiki links for all languages from the cache";
+       }
+
+       public function execute() {
+               global $wgLocalDatabases, $wgMemc;
+               $dbr = wfGetDB( DB_SLAVE );
+               $res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false );
+               $prefixes = array();
+               foreach ( $res as $row ) {
+                       $prefixes[] = $row->iw_prefix;
+               }
+
+               foreach ( $wgLocalDatabases as $db ) {
+                       $this->output( "$db..." );
+                       foreach ( $prefixes as $prefix ) {
+                               $wgMemc->delete( "$db:interwiki:$prefix" );
+                       }
+                       $this->output( "done\n" );
+               }
+       }
+}
+
+$maintClass = "ClearInterwikiCache";
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/clear_interwiki_cache.php b/maintenance/clear_interwiki_cache.php
deleted file mode 100644 (file)
index 88769df..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/**
- * Clear the cache of interwiki prefixes for all local wikis.
- *
- * 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 Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to clear the cache of interwiki prefixes for all local wikis.
- *
- * @ingroup Maintenance
- */
-class ClearInterwikiCache extends Maintenance {
-
-       public function __construct() {
-               parent::__construct();
-               $this->mDescription = "Clear all interwiki links for all languages from the cache";
-       }
-
-       public function execute() {
-               global $wgLocalDatabases, $wgMemc;
-               $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'interwiki', array( 'iw_prefix' ), false );
-               $prefixes = array();
-               foreach ( $res as $row ) {
-                       $prefixes[] = $row->iw_prefix;
-               }
-
-               foreach ( $wgLocalDatabases as $db ) {
-                       $this->output( "$db..." );
-                       foreach ( $prefixes as $prefix ) {
-                               $wgMemc->delete( "$db:interwiki:$prefix" );
-                       }
-                       $this->output( "done\n" );
-               }
-       }
-}
-
-$maintClass = "ClearInterwikiCache";
-require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/clear_stats.php b/maintenance/clear_stats.php
deleted file mode 100644 (file)
index 4581d53..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/**
- * Removes all statistics tracking from the cache.
- *
- * 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 Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to remove all statistics tracking from the cache.
- *
- * @ingroup Maintenance
- */
-class clear_stats extends Maintenance {
-
-       public function __construct() {
-               parent::__construct();
-               $this->mDescription = "Remove all statistics tracking from the cache";
-       }
-
-       public function execute() {
-               global $wgLocalDatabases, $wgMemc;
-               foreach ( $wgLocalDatabases as $db ) {
-                       $wgMemc->delete( "$db:stats:request_with_session" );
-                       $wgMemc->delete( "$db:stats:request_without_session" );
-                       $wgMemc->delete( "$db:stats:pcache_hit" );
-                       $wgMemc->delete( "$db:stats:pcache_miss_expired" );
-                       $wgMemc->delete( "$db:stats:pcache_miss_absent" );
-                       $wgMemc->delete( "$db:stats:pcache_miss_stub" );
-                       $wgMemc->delete( "$db:stats:image_cache_hit" );
-                       $wgMemc->delete( "$db:stats:image_cache_miss" );
-                       $wgMemc->delete( "$db:stats:image_cache_update" );
-                       $wgMemc->delete( "$db:stats:diff_cache_hit" );
-                       $wgMemc->delete( "$db:stats:diff_cache_miss" );
-                       $wgMemc->delete( "$db:stats:diff_uncacheable" );
-                       $wgMemc->delete( "$db:stats:job-insert" );
-                       $wgMemc->delete( "$db:stats:job-pop" );
-               }
-       }
-}
-
-$maintClass = "clear_stats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/initSiteStats.php b/maintenance/initSiteStats.php
new file mode 100644 (file)
index 0000000..1990659
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Re-initialise or update the site statistics table.
+ *
+ * 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 Maintenance
+ * @author Brion Vibber
+ * @author Rob Church <robchur@gmail.com>
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to re-initialise or update the site statistics table
+ *
+ * @ingroup Maintenance
+ */
+class InitSiteStats extends Maintenance {
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = "Re-initialise the site statistics tables";
+               $this->addOption( 'update', 'Update the existing statistics (preserves the ss_total_views field)' );
+               $this->addOption( 'noviews', "Don't update the page view counter" );
+               $this->addOption( 'active', 'Also update active users count' );
+               $this->addOption( 'use-master', 'Count using the master database' );
+       }
+
+       public function execute() {
+               $this->output( "Refresh Site Statistics\n\n" );
+               $counter = new SiteStatsInit( $this->hasOption( 'use-master' ) );
+
+               $this->output( "Counting total edits..." );
+               $edits = $counter->edits();
+               $this->output( "{$edits}\nCounting number of articles..." );
+
+               $good  = $counter->articles();
+               $this->output( "{$good}\nCounting total pages..." );
+
+               $pages = $counter->pages();
+               $this->output( "{$pages}\nCounting number of users..." );
+
+               $users = $counter->users();
+               $this->output( "{$users}\nCounting number of images..." );
+
+               $image = $counter->files();
+               $this->output( "{$image}\n" );
+
+               if ( !$this->hasOption( 'noviews' ) ) {
+                       $this->output( "Counting total page views..." );
+                       $views = $counter->views();
+                       $this->output( "{$views}\n" );
+               }
+
+               if ( $this->hasOption( 'active' ) ) {
+                       $this->output( "Counting active users..." );
+                       $active = SiteStatsUpdate::cacheUpdate( wfGetDB( DB_MASTER ) );
+                       $this->output( "{$active}\n" );
+               }
+
+               $this->output( "\nUpdating site statistics..." );
+
+               if ( $this->hasOption( 'update' ) ) {
+                       $counter->update();
+               } else {
+                       $counter->refresh();
+               }
+
+               $this->output( "done.\n" );
+       }
+}
+
+$maintClass = "InitSiteStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/initStats.php b/maintenance/initStats.php
deleted file mode 100644 (file)
index 5d8b886..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-/**
- * Re-initialise or update the site statistics table.
- *
- * 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 Maintenance
- * @author Brion Vibber
- * @author Rob Church <robchur@gmail.com>
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to re-initialise or update the site statistics table
- *
- * @ingroup Maintenance
- */
-class InitStats extends Maintenance {
-       public function __construct() {
-               parent::__construct();
-               $this->mDescription = "Re-initialise the site statistics tables";
-               $this->addOption( 'update', 'Update the existing statistics (preserves the ss_total_views field)' );
-               $this->addOption( 'noviews', "Don't update the page view counter" );
-               $this->addOption( 'active', 'Also update active users count' );
-               $this->addOption( 'use-master', 'Count using the master database' );
-       }
-
-       public function execute() {
-               $this->output( "Refresh Site Statistics\n\n" );
-               $counter = new SiteStatsInit( $this->hasOption( 'use-master' ) );
-
-               $this->output( "Counting total edits..." );
-               $edits = $counter->edits();
-               $this->output( "{$edits}\nCounting number of articles..." );
-
-               $good  = $counter->articles();
-               $this->output( "{$good}\nCounting total pages..." );
-
-               $pages = $counter->pages();
-               $this->output( "{$pages}\nCounting number of users..." );
-
-               $users = $counter->users();
-               $this->output( "{$users}\nCounting number of images..." );
-
-               $image = $counter->files();
-               $this->output( "{$image}\n" );
-
-               if ( !$this->hasOption( 'noviews' ) ) {
-                       $this->output( "Counting total page views..." );
-                       $views = $counter->views();
-                       $this->output( "{$views}\n" );
-               }
-
-               if ( $this->hasOption( 'active' ) ) {
-                       $this->output( "Counting active users..." );
-                       $active = SiteStatsUpdate::cacheUpdate( wfGetDB( DB_MASTER ) );
-                       $this->output( "{$active}\n" );
-               }
-
-               $this->output( "\nUpdating site statistics..." );
-
-               if ( $this->hasOption( 'update' ) ) {
-                       $counter->update();
-               } else {
-                       $counter->refresh();
-               }
-
-               $this->output( "done.\n" );
-       }
-}
-
-$maintClass = "InitStats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
index ebf8a02..c0b0126 100644 (file)
@@ -3857,7 +3857,7 @@ $wgMessageStructure = array(
 $wgBlockComments = array(
        'sidebar'             => "The sidebar for MonoBook is generated from this message, lines that do not
 begin with * or ** are discarded, furthermore lines that do begin with ** and
-do not contain | are also discarded, but do not depend on this behaviour for
+do not contain | are also discarded, but do not depend on this behavior for
 future releases. Also note that since each list value is wrapped in a unique
 XHTML id it should only appear once and include characters that are legal
 XHTML id names.",
index f5bf4da..1be5146 100644 (file)
@@ -77,10 +77,9 @@ class nextJobDB extends Maintenance {
                                return; // no jobs for this type
                        }
 
-                       list( $type, $db ) = $candidates[ mt_rand( 0, count( $candidates ) - 1 ) ];
-                       if ( !$this->checkJob( $type, $db ) ) { // queue is actually empty?
-                               $pendingDBs[$type] = array_diff( $pendingDBs[$type], $db );
-                               JobQueueAggregator::singleton()->notifyQueueEmpty( $db, $type );
+                       list( $type, $db ) = $candidates[mt_rand( 0, count( $candidates ) - 1 )];
+                       if ( JobQueueGroup::singleton( $db )->isQueueDeprioritized( $type ) ) {
+                               $pendingDBs[$type] = array_diff( $pendingDBs[$type], array( $db ) );
                                $again = true;
                        }
                } while ( $again );
@@ -92,17 +91,6 @@ class nextJobDB extends Maintenance {
                }
        }
 
-       /**
-        * Check if the specified database has a job of the specified type in it.
-        * The type may be false to indicate "all".
-        * @param $type string
-        * @param $dbName string
-        * @return bool
-        */
-       private function checkJob( $type, $dbName ) {
-               return !JobQueueGroup::singleton( $dbName )->get( $type )->isEmpty();
-       }
-
        /**
         * Do all ready periodic jobs for all databases every 5 minutes (and .1% of the time)
         * @return integer
diff --git a/maintenance/proxyCheck.php b/maintenance/proxyCheck.php
new file mode 100644 (file)
index 0000000..2ccf703
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Command line script to check for an open proxy at a specified location.
+ *
+ * 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 Maintenance
+ */
+
+if( PHP_SAPI != 'cli' ) {
+       die( 1 );
+}
+
+/**
+ *
+ */
+$output = '';
+
+/**
+ * Exit if there are not enough parameters, or if it's not command line mode
+ */
+if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $argv ) < 4 ) {
+       $output .= "Incorrect parameters\n";
+} else {
+       /**
+        * Get parameters
+        */
+       $ip = $argv[1];
+       $port = $argv[2];
+       $url = $argv[3];
+       $host = trim(`hostname`);
+       $output = "Connecting to $ip:$port, target $url, this hostname $host\n";
+
+       # Open socket
+       $sock = @fsockopen($ip, $port, $errno, $errstr, 5);
+       if ($errno == 0 ) {
+               $output .= "Connected\n";
+               # Send payload
+               $request = "GET $url HTTP/1.0\r\n";
+#              $request .= "Proxy-Connection: Keep-Alive\r\n";
+#              $request .= "Pragma: no-cache\r\n";
+#              $request .= "Host: ".$url."\r\n";
+#              $request .= "User-Agent: MediaWiki open proxy check\r\n";
+               $request .= "\r\n";
+               @fputs($sock, $request);
+               $response = fgets($sock, 65536);
+               $output .= $response;
+               @fclose($sock);
+       } else {
+               $output .= "No connection\n";
+       }
+}
+
+$output = escapeshellarg( $output );
+
+#`echo $output >> /home/tstarling/open/proxy.log`;
diff --git a/maintenance/proxy_check.php b/maintenance/proxy_check.php
deleted file mode 100644 (file)
index 2ccf703..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * Command line script to check for an open proxy at a specified location.
- *
- * 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 Maintenance
- */
-
-if( PHP_SAPI != 'cli' ) {
-       die( 1 );
-}
-
-/**
- *
- */
-$output = '';
-
-/**
- * Exit if there are not enough parameters, or if it's not command line mode
- */
-if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $argv ) < 4 ) {
-       $output .= "Incorrect parameters\n";
-} else {
-       /**
-        * Get parameters
-        */
-       $ip = $argv[1];
-       $port = $argv[2];
-       $url = $argv[3];
-       $host = trim(`hostname`);
-       $output = "Connecting to $ip:$port, target $url, this hostname $host\n";
-
-       # Open socket
-       $sock = @fsockopen($ip, $port, $errno, $errstr, 5);
-       if ($errno == 0 ) {
-               $output .= "Connected\n";
-               # Send payload
-               $request = "GET $url HTTP/1.0\r\n";
-#              $request .= "Proxy-Connection: Keep-Alive\r\n";
-#              $request .= "Pragma: no-cache\r\n";
-#              $request .= "Host: ".$url."\r\n";
-#              $request .= "User-Agent: MediaWiki open proxy check\r\n";
-               $request .= "\r\n";
-               @fputs($sock, $request);
-               $response = fgets($sock, 65536);
-               $output .= $response;
-               @fclose($sock);
-       } else {
-               $output .= "No connection\n";
-       }
-}
-
-$output = escapeshellarg( $output );
-
-#`echo $output >> /home/tstarling/open/proxy.log`;
index f9557ce..714bb84 100644 (file)
@@ -82,6 +82,7 @@ class RunJobs extends Maintenance {
                        $this->runJobsLog( "Executed $count periodic queue task(s)." );
                }
 
+               $lastTime = time();
                do {
                        $job = ( $type === false )
                                ? $group->pop( JobQueueGroup::TYPE_DEFAULT, JobQueueGroup::USE_CACHE )
@@ -118,8 +119,13 @@ class RunJobs extends Maintenance {
                                        break;
                                }
 
-                               // Don't let any slaves/backups fall behind...
+                               // Don't let any queue slaves/backups fall behind
                                $group->get( $job->getType() )->waitForBackups();
+                               // Don't let any of the main DB slaves get backed up
+                               $timePassed = time() - $lastTime;
+                               if ( $timePassed >= 5 || $timePassed < 0 ) {
+                                       wfWaitForSlaves();
+                               }
                        }
                } while ( $job ); // stop when there are no jobs
        }
diff --git a/maintenance/showCacheStats.php b/maintenance/showCacheStats.php
new file mode 100644 (file)
index 0000000..8f23868
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Show statistics from the cache.
+ *
+ * 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 Maintenance
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script that shows statistics from the cache.
+ *
+ * @ingroup Maintenance
+ */
+class ShowCacheStats extends Maintenance {
+
+       public function __construct() {
+               $this->mDescription = "Show statistics from the cache";
+               parent::__construct();
+       }
+
+       public function getDbType() {
+               return Maintenance::DB_NONE;
+       }
+
+       public function execute() {
+               global $wgMemc;
+
+               // Can't do stats if
+               if ( get_class( $wgMemc ) == 'EmptyBagOStuff' ) {
+                       $this->error( "You are running EmptyBagOStuff, I can not provide any statistics.", true );
+               }
+               $session = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_with_session' ) ) );
+               $noSession = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_without_session' ) ) );
+               $total = $session + $noSession;
+               if ( $total == 0 ) {
+                       $this->error( "You either have no stats or the cache isn't running. Aborting.", true );
+               }
+               $this->output( "Requests\n" );
+               $this->output( sprintf( "with session:      %-10d %6.2f%%\n", $session, $session / $total * 100 ) );
+               $this->output( sprintf( "without session:   %-10d %6.2f%%\n", $noSession, $noSession / $total * 100 ) );
+               $this->output( sprintf( "total:             %-10d %6.2f%%\n", $total, 100 ) );
+
+
+               $this->output( "\nParser cache\n" );
+               $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) );
+               $expired = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_expired' ) ) );
+               $absent = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_absent' ) ) );
+               $stub = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_stub' ) ) );
+               $total = $hits + $expired + $absent + $stub;
+               if ( $total ) {
+                       $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
+                       $this->output( sprintf( "expired:           %-10d %6.2f%%\n", $expired, $expired / $total * 100 ) );
+                       $this->output( sprintf( "absent:            %-10d %6.2f%%\n", $absent, $absent / $total * 100 ) );
+                       $this->output( sprintf( "stub threshold:    %-10d %6.2f%%\n", $stub, $stub / $total * 100 ) );
+                       $this->output( sprintf( "total:             %-10d %6.2f%%\n", $total, 100 ) );
+               } else {
+                       $this->output( "no statistics available\n" );
+               }
+
+               $this->output( "\nImage cache\n" );
+               $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_hit' ) ) );
+               $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_miss' ) ) );
+               $updates = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_update' ) ) );
+               $total = $hits + $misses;
+               if ( $total ) {
+                       $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
+                       $this->output( sprintf( "misses:            %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
+                       $this->output( sprintf( "updates:           %-10d\n", $updates ) );
+               } else {
+                       $this->output( "no statistics available\n" );
+               }
+
+               $this->output( "\nDiff cache\n" );
+               $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_hit' ) ) );
+               $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_miss' ) ) );
+               $uncacheable = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_uncacheable' ) ) );
+               $total = $hits + $misses + $uncacheable;
+               if ( $total ) {
+                       $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
+                       $this->output( sprintf( "misses:            %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
+                       $this->output( sprintf( "uncacheable:       %-10d %6.2f%%\n", $uncacheable, $uncacheable / $total * 100 ) );
+               } else {
+                       $this->output( "no statistics available\n" );
+               }
+       }
+}
+
+$maintClass = "ShowCacheStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/showSiteStats.php b/maintenance/showSiteStats.php
new file mode 100644 (file)
index 0000000..e7359b2
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+
+/**
+ * Show the cached statistics.
+ * Give out the same output as [[Special:Statistics]]
+ *
+ * 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 Maintenance
+ * @author Antoine Musso <hashar at free dot fr>
+ * Based on initSiteStats.php by:
+ * @author Brion Vibber
+ * @author Rob Church <robchur@gmail.com>
+ *
+ * @license GNU General Public License 2.0 or later
+ */
+
+require_once( __DIR__ . '/Maintenance.php' );
+
+/**
+ * Maintenance script to show the cached statistics.
+ *
+ * @ingroup Maintenance
+ */
+class ShowSiteStats extends Maintenance {
+       public function __construct() {
+               parent::__construct();
+               $this->mDescription = "Show the cached statistics";
+       }
+       public function execute() {
+               $fields = array(
+                       'ss_total_views' => 'Total views',
+                       'ss_total_edits' => 'Total edits',
+                       'ss_good_articles' => 'Number of articles',
+                       'ss_total_pages' => 'Total pages',
+                       'ss_users' => 'Number of users',
+                       'ss_images' => 'Number of images',
+               );
+
+               // Get cached stats from slave database
+               $dbr = wfGetDB( DB_SLAVE );
+               $stats = $dbr->selectRow( 'site_stats', '*', '', __METHOD__ );
+
+               // Get maximum size for each column
+               $max_length_value = $max_length_desc = 0;
+               foreach ( $fields as $field => $desc ) {
+                       $max_length_value = max( $max_length_value, strlen( $stats->$field ) );
+                       $max_length_desc  = max( $max_length_desc,  strlen( $desc ) ) ;
+               }
+
+               // Show them
+               foreach ( $fields as $field => $desc ) {
+                       $this->output( sprintf( "%-{$max_length_desc}s: %{$max_length_value}d\n", $desc, $stats->$field ) );
+               }
+       }
+}
+
+$maintClass = "ShowSiteStats";
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/showStats.php b/maintenance/showStats.php
deleted file mode 100644 (file)
index 3036406..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-
-/**
- * Show the cached statistics.
- * Give out the same output as [[Special:Statistics]]
- *
- * 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 Maintenance
- * @author Antoine Musso <hashar at free dot fr>
- * Based on initStats.php by:
- * @author Brion Vibber
- * @author Rob Church <robchur@gmail.com>
- *
- * @license GNU General Public License 2.0 or later
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to show the cached statistics.
- *
- * @ingroup Maintenance
- */
-class ShowStats extends Maintenance {
-       public function __construct() {
-               parent::__construct();
-               $this->mDescription = "Show the cached statistics";
-       }
-       public function execute() {
-               $fields = array(
-                       'ss_total_views' => 'Total views',
-                       'ss_total_edits' => 'Total edits',
-                       'ss_good_articles' => 'Number of articles',
-                       'ss_total_pages' => 'Total pages',
-                       'ss_users' => 'Number of users',
-                       'ss_images' => 'Number of images',
-               );
-
-               // Get cached stats from slave database
-               $dbr = wfGetDB( DB_SLAVE );
-               $stats = $dbr->selectRow( 'site_stats', '*', '', __METHOD__ );
-
-               // Get maximum size for each column
-               $max_length_value = $max_length_desc = 0;
-               foreach ( $fields as $field => $desc ) {
-                       $max_length_value = max( $max_length_value, strlen( $stats->$field ) );
-                       $max_length_desc  = max( $max_length_desc,  strlen( $desc ) ) ;
-               }
-
-               // Show them
-               foreach ( $fields as $field => $desc ) {
-                       $this->output( sprintf( "%-{$max_length_desc}s: %{$max_length_value}d\n", $desc, $stats->$field ) );
-               }
-       }
-}
-
-$maintClass = "ShowStats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/stats.php b/maintenance/stats.php
deleted file mode 100644 (file)
index be448f9..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/**
- * Show statistics from the cache.
- *
- * 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 Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script that shows statistics from the cache.
- *
- * @ingroup Maintenance
- */
-class CacheStats extends Maintenance {
-
-       public function __construct() {
-               $this->mDescription = "Show statistics from the cache";
-               parent::__construct();
-       }
-
-       public function getDbType() {
-               return Maintenance::DB_NONE;
-       }
-
-       public function execute() {
-               global $wgMemc;
-
-               // Can't do stats if
-               if ( get_class( $wgMemc ) == 'EmptyBagOStuff' ) {
-                       $this->error( "You are running EmptyBagOStuff, I can not provide any statistics.", true );
-               }
-               $session = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_with_session' ) ) );
-               $noSession = intval( $wgMemc->get( wfMemcKey( 'stats', 'request_without_session' ) ) );
-               $total = $session + $noSession;
-               if ( $total == 0 ) {
-                       $this->error( "You either have no stats or the cache isn't running. Aborting.", true );
-               }
-               $this->output( "Requests\n" );
-               $this->output( sprintf( "with session:      %-10d %6.2f%%\n", $session, $session / $total * 100 ) );
-               $this->output( sprintf( "without session:   %-10d %6.2f%%\n", $noSession, $noSession / $total * 100 ) );
-               $this->output( sprintf( "total:             %-10d %6.2f%%\n", $total, 100 ) );
-
-
-               $this->output( "\nParser cache\n" );
-               $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_hit' ) ) );
-               $expired = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_expired' ) ) );
-               $absent = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_absent' ) ) );
-               $stub = intval( $wgMemc->get( wfMemcKey( 'stats', 'pcache_miss_stub' ) ) );
-               $total = $hits + $expired + $absent + $stub;
-               if ( $total ) {
-                       $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
-                       $this->output( sprintf( "expired:           %-10d %6.2f%%\n", $expired, $expired / $total * 100 ) );
-                       $this->output( sprintf( "absent:            %-10d %6.2f%%\n", $absent, $absent / $total * 100 ) );
-                       $this->output( sprintf( "stub threshold:    %-10d %6.2f%%\n", $stub, $stub / $total * 100 ) );
-                       $this->output( sprintf( "total:             %-10d %6.2f%%\n", $total, 100 ) );
-               } else {
-                       $this->output( "no statistics available\n" );
-               }
-
-               $this->output( "\nImage cache\n" );
-               $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_hit' ) ) );
-               $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_miss' ) ) );
-               $updates = intval( $wgMemc->get( wfMemcKey( 'stats', 'image_cache_update' ) ) );
-               $total = $hits + $misses;
-               if ( $total ) {
-                       $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
-                       $this->output( sprintf( "misses:            %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
-                       $this->output( sprintf( "updates:           %-10d\n", $updates ) );
-               } else {
-                       $this->output( "no statistics available\n" );
-               }
-
-               $this->output( "\nDiff cache\n" );
-               $hits = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_hit' ) ) );
-               $misses = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_cache_miss' ) ) );
-               $uncacheable = intval( $wgMemc->get( wfMemcKey( 'stats', 'diff_uncacheable' ) ) );
-               $total = $hits + $misses + $uncacheable;
-               if ( $total ) {
-                       $this->output( sprintf( "hits:              %-10d %6.2f%%\n", $hits, $hits / $total * 100 ) );
-                       $this->output( sprintf( "misses:            %-10d %6.2f%%\n", $misses, $misses / $total * 100 ) );
-                       $this->output( sprintf( "uncacheable:       %-10d %6.2f%%\n", $uncacheable, $uncacheable / $total * 100 ) );
-               } else {
-                       $this->output( "no statistics available\n" );
-               }
-       }
-}
-
-$maintClass = "CacheStats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
index 5e5cc8f..030a147 100644 (file)
@@ -523,7 +523,7 @@ class RecompressTracked {
         *
         * Write the new URL to the text table and set the bt_moved flag.
         *
-        * This is done in a single transaction to provide restartable behaviour
+        * This is done in a single transaction to provide restartable behavior
         * without data loss.
         *
         * The transaction is kept short to reduce locking.
index ef28948..20e6678 100644 (file)
@@ -12,8 +12,6 @@
  *
  * @author Timo Tijhof, 2011-2012
  */
-/*global jQuery, QUnit */
-/*jshint eqeqeq:false, eqnull:false, forin:false */
 ( function ( $ ) {
        'use strict';
 
index 76f0259..183b525 100644 (file)
                                                $span.append( childNode );
                                        } );
                                } else {
-                                       // strings, integers, anything else
-                                       // (will soon switch to createTextNode() for non-objects)
-                                       $span.append( node );
+                                       // Let jQuery append nodes, arrays of nodes and jQuery objects
+                                       // other things (strings, numbers, ..) are appended as text nodes (not as HTML strings)
+                                       $span.append( $.type( node ) === 'object' ? node : document.createTextNode( node ) );
                                }
                        } );
                        return $span;
index 1212fd4..4dbf04c 100644 (file)
@@ -42,22 +42,22 @@ var mw = ( function ( $, undefined ) {
                 */
                get: function ( selection, fallback ) {
                        var results, i;
+                       // If we only do this in the `return` block, it'll fail for the
+                       // call to get() from the mutli-selection block.
+                       fallback = arguments.length > 1 ? fallback : null;
 
                        if ( $.isArray( selection ) ) {
                                selection = slice.call( selection );
                                results = {};
-                               for ( i = 0; i < selection.length; i += 1 ) {
+                               for ( i = 0; i < selection.length; i++ ) {
                                        results[selection[i]] = this.get( selection[i], fallback );
                                }
                                return results;
                        }
 
                        if ( typeof selection === 'string' ) {
-                               if ( this.values[selection] === undefined ) {
-                                       if ( fallback !== undefined ) {
-                                               return fallback;
-                                       }
-                                       return null;
+                               if ( !hasOwn.call( this.values, selection ) ) {
+                                       return fallback;
                                }
                                return this.values[selection];
                        }
@@ -86,7 +86,7 @@ var mw = ( function ( $, undefined ) {
                                }
                                return true;
                        }
-                       if ( typeof selection === 'string' && value !== undefined ) {
+                       if ( typeof selection === 'string' && arguments.length > 1 ) {
                                this.values[selection] = value;
                                return true;
                        }
@@ -103,14 +103,14 @@ var mw = ( function ( $, undefined ) {
                        var s;
 
                        if ( $.isArray( selection ) ) {
-                               for ( s = 0; s < selection.length; s += 1 ) {
-                                       if ( this.values[selection[s]] === undefined ) {
+                               for ( s = 0; s < selection.length; s++ ) {
+                                       if ( typeof selection[s] !== 'string' || !hasOwn.call( this.values, selection[s] ) ) {
                                                return false;
                                        }
                                }
                                return true;
                        }
-                       return this.values[selection] !== undefined;
+                       return typeof selection === 'string' && hasOwn.call( this.values, selection );
                }
        };
 
index cb7dd63..5211b0d 100644 (file)
 
                                // If the jQuery selector isn't found within the <ul>,
                                // or if nextnode was invalid or not passed at all,
-                               // then just append it at the end of the <ul> (this is the default behaviour)
+                               // then just append it at the end of the <ul> (this is the default behavior)
                                } else {
                                        $ul.append( $item );
                                }
index ee68abb..3e01d23 100644 (file)
@@ -194,7 +194,7 @@ class VectorTemplate extends BaseTemplate {
                                <!-- jumpto -->
                                <div id="jump-to-nav" class="mw-jump">
                                        <?php $this->msg( 'jumpto' ) ?>
-                                       <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
+                                       <a href="#mw-navigation"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
                                        <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
                                </div>
                                <!-- /jumpto -->
index 79911fe..2fa0cba 100644 (file)
@@ -189,7 +189,7 @@ blockquote {
 pre, code, tt, kbd, samp, .mw-code {
        /*
         * Some browsers will render the monospace text too small, namely Firefox, Chrome and Safari.
-        * Specifying any valid, second value will trigger correct behaviour without forcing a different font.
+        * Specifying any valid, second value will trigger correct behavior without forcing a different font.
         */
        font-family: monospace, Courier;
 }
index 1fe750e..6e1c94f 100644 (file)
@@ -232,6 +232,9 @@ td.mw-label {
 .prefsection table {
        width: 100%;
 }
+.prefsection table.mw-htmlform-matrix {
+       width: auto;
+}
 td.mw-submit {
        white-space: nowrap;
 }
@@ -254,6 +257,11 @@ tr.mw-htmlform-vertical-label td.mw-label {
        white-space: nowrap;
 }
 
+.mw-htmlform-matrix td {
+       padding-left: 0.5em;
+       padding-right: 0.5em;
+}
+
 input#wpSummary {
        width: 80%;
        margin-bottom: 1em;
index 6e212eb..b7320cb 100644 (file)
@@ -37,7 +37,7 @@ if ( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
        # PHPUnit 3.5.0 introduced a nice autoloader based on class name
        require_once( 'PHPUnit/Autoload.php' );
 } else {
-       # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
+       # Keep the old pre PHPUnit 3.5.0 behavior for compatibility
        require_once( 'PHPUnit/TextUI/Command.php' );
 }
 
index 492edb6..cb1cb84 100644 (file)
@@ -7752,7 +7752,7 @@ http://example.com [[Image:foobar.jpg]]
 !!end
 
 !! test
-Short headings with trailing space should match behaviour of Parser::doHeadings (bug 19910)
+Short headings with trailing space should match behavior of Parser::doHeadings (bug 19910)
 !! input
 === 
 The line above must have a trailing space!
@@ -9863,7 +9863,7 @@ section=1
 ==marked==
 !!end
 
-# Test behaviour of bug 19910
+# Test behavior of bug 19910
 !! test
 Sectiion with all-equals
 !! options
index 9739f4c..263553a 100644 (file)
@@ -107,6 +107,22 @@ class TestORMRowTest extends ORMRowTest {
                );
        }
 
+       /**
+        * @since 1.21
+        * @return array
+        */
+       protected function getMockValues() {
+               return array(
+                       'id' => 1,
+                       'str' => 'foobar4645645',
+                       'int' => 42,
+                       'float' => 4.2,
+                       'bool' => '',
+                       'array' => array( 42, 'foobar' ),
+                       'blob' => new stdClass()
+               );
+       }
+
 }
 
 class TestORMRow extends ORMRow {}
index dac5edb..a08910a 100644 (file)
@@ -2072,6 +2072,23 @@ class FileBackendTest extends MediaWikiTestCase {
                        $this->assertEquals( true, $status->isOK(),
                                "Locking of files succeeded with OK status ($backendName)." );
                }
+
+               $status = Status::newGood();
+               $sl = $this->backend->getScopedFileLocks( $paths, LockManager::LOCK_EX, $status );
+               $this->assertType( 'ScopedLock', $sl,
+                       "Scoped locking of files succeeded ($backendName)." );
+               $this->assertEquals( array(), $status->errors,
+                       "Scoped locking of files succeeded ($backendName)." );
+               $this->assertEquals( true, $status->isOK(),
+                       "Scoped locking of files succeeded with OK status ($backendName)." );
+
+               ScopedLock::release( $sl );
+               $this->assertEquals( null, $sl,
+                       "Scoped unlocking of files succeeded ($backendName)." );
+               $this->assertEquals( array(), $status->errors,
+                       "Scoped unlocking of files succeeded ($backendName)." );
+               $this->assertEquals( true, $status->isOK(),
+                       "Scoped unlocking of files succeeded with OK status ($backendName)." );
        }
 
        // test helper wrapper for backend prepare() function
index 26747b9..a4bd512 100644 (file)
@@ -151,14 +151,21 @@ class CSSJanusTest extends MediaWikiTestCase {
                                '#settings td p strong'
                        ),
                        array(
-                               # Not sure how 4+ values should behave,
-                               # testing to make sure changes are detected
-                               '.foo { x-unknown: 1 2 3 4 5; }',
-                               '.foo { x-unknown: 1 4 3 2 5; }',
+                               // Test the colors regex
+                               '.foo { border-color: red green blue white }',
+                               '.foo { border-color: red white blue green }',
                        ),
                        array(
-                               '.foo { x-unknown: 1 2 3 4 5 6; }',
-                               '.foo { x-unknown: 1 4 3 2 5 6; }',
+                               // Test the colors regex harder
+                               '.foo { border-color: red #f00 rgb(255, 0, 0%) rgba(100%, 0, 0, 0) }',
+                               '.foo { border-color: red rgba(100%, 0, 0, 0) rgb(255, 0, 0%) #f00 }',
+                       ),
+                       array(
+                               // Do not bork 4+ values
+                               '.foo { x-unknown: 1 2 3 4 5; }'
+                       ),
+                       array(
+                               '.foo { x-unknown: 1 2 3 4 5 6; }'
                        ),
 
                        // Shorthand / Three notation
@@ -179,6 +186,28 @@ class CSSJanusTest extends MediaWikiTestCase {
                                '.foo { padding: 1px; }'
                        ),
 
+                       // text-shadow and box-shadow
+                       array(
+                               '.foo { box-shadow: -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                               '.foo { box-shadow: 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                       ),
+                       array(
+                               '.foo { box-shadow: inset -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                               '.foo { box-shadow: inset 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                       ),
+                       array(
+                               '.foo { text-shadow: orange 2px 0; }',
+                               '.foo { text-shadow: orange -2px 0; }',
+                       ),
+                       array(
+                               '.foo { text-shadow: 2px 0 orange; }',
+                               '.foo { text-shadow: -2px 0 orange; }',
+                       ),
+                       array(
+                               // Don't mangle zeroes
+                               '.foo { text-shadow: orange 0 2px; }'
+                       ),
+
                        // Direction
                        // Note: This differs from the Python implementation,
                        // see also CSSJanus::fixDirection for more info.
index 235e9ad..741f8b7 100644 (file)
@@ -92,7 +92,7 @@ class MaintenanceFixup extends Maintenance {
                        // Someone generated a MaintenanceFixup instance without calling
                        // simulateShutdown. We'd have to raise a PHPUnit exception to correctly
                        // flag this illegal usage. However, we are already in a destruktor, which
-                       // would trigger undefined behaviour. Hence, we can only report to the
+                       // would trigger undefined behavior. Hence, we can only report to the
                        // error output :( Hopefully people read the PHPUnit output.
                        $name = $this->testCase->getName();
                        fwrite( STDERR, "ERROR! Instance of " . __CLASS__ . " for test $name "
@@ -184,7 +184,7 @@ class MaintenanceTest extends MediaWikiTestCase {
        // Although the following tests do not seem to be too consistent (compare for
        // example the newlines within the test.*StringString tests, or the
        // test.*Intermittent.* tests), the objective of these tests is not to describe
-       // consistent behaviour, but rather currently existing behaviour.
+       // consistent behavior, but rather currently existing behavior.
 
 
        function testOutputEmpty() {
index 97e0533..39ae363 100644 (file)
@@ -17,7 +17,7 @@
                assert.deepEqual( $.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' );
                assert.deepEqual( $.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' );
 
-               // Perhaps this is a bug in colorUtil, but it is the current behaviour so, let's keep
+               // Perhaps this is a bug in colorUtil, but it is the current behavior so, let's keep
                // track of it, so we will know in case it would ever change.
                assert.strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' );
 
index 5fae065..7571b92 100644 (file)
@@ -40,7 +40,7 @@
                assert.strictEqual( $.isEmpty( [] ), true, 'isEmpty: []' );
                assert.strictEqual( $.isEmpty( {} ), true, 'isEmpty: {}' );
 
-               // Documented behaviour
+               // Documented behavior
                assert.strictEqual( $.isEmpty( { length: 0 } ), true, 'isEmpty: { length: 0 }' );
        } );
 
index f23964c..0a9df96 100644 (file)
@@ -81,7 +81,7 @@
                        } );
        }
 
-       QUnit.test( 'Replace', 7, function ( assert ) {
+       QUnit.test( 'Replace', 9, function ( assert ) {
                var parser = mw.jqueryMsg.getMessageFunction();
 
                mw.messages.set( 'simple', 'Foo $1 baz $2' );
@@ -90,7 +90,6 @@
                assert.equal( parser( 'simple', 'bar' ), 'Foo bar baz $2', 'Replacements with less substitutes' );
                assert.equal( parser( 'simple', 'bar', 'quux' ), 'Foo bar baz quux', 'Replacements with all substitutes' );
 
-               /* Temporarily disabling until 2013-03 --Kaldari
                mw.messages.set( 'plain-input', '<foo foo="foo">x$1y&lt;</foo>z' );
 
                assert.equal(
                        'Foo &lt;bar bar="bar"&gt;&amp;gt;&lt;/bar&gt;',
                        'Replacement is not considered html'
                );
-               */
 
                mw.messages.set( 'object-replace', 'Foo $1' );
 
index 45c3c5a..b599b02 100644 (file)
                assert.strictEqual( window.mw, window.mediaWiki, 'mw alias to mediaWiki' );
        } );
 
-       QUnit.test( 'mw.Map', 17, function ( assert ) {
+       QUnit.test( 'mw.Map', 27, function ( assert ) {
                var arry, conf, funky, globalConf, nummy, someValues;
 
-               assert.ok( mw.Map, 'mw.Map defined' );
-
                conf = new mw.Map();
                // Dummy variables
                funky = function () {};
                arry = [];
                nummy = 7;
 
-               // Tests for input validation
-               assert.strictEqual( conf.get( 'inexistantKey' ), null, 'Map.get returns null if selection was a string and the key was not found' );
-               assert.strictEqual( conf.set( 'myKey', 'myValue' ), true, 'Map.set returns boolean true if a value was set for a valid key string' );
+               // Single get and set
+
+               assert.strictEqual( conf.set( 'foo', 'Bar' ), true, 'Map.set returns boolean true if a value was set for a valid key string' );
+               assert.equal( conf.get( 'foo' ), 'Bar', 'Map.get returns a single value value correctly' );
+
+               assert.strictEqual( conf.get( 'example' ), null, 'Map.get returns null if selection was a string and the key was not found' );
+               assert.strictEqual( conf.get( 'example', arry ), arry, 'Map.get returns fallback by reference if the key was not found' );
+               assert.strictEqual( conf.get( 'example', undefined ), undefined, 'Map.get supports `undefined` as fallback instead of `null`' );
+
+               assert.strictEqual( conf.get( 'constructor' ), null, 'Map.get does not look at Object.prototype of internal storage (constructor)' );
+               assert.strictEqual( conf.get( 'hasOwnProperty' ), null, 'Map.get does not look at Object.prototype of internal storage (hasOwnProperty)' );
+
+               conf.set( 'hasOwnProperty', function () { return true; } );
+               assert.strictEqual( conf.get( 'example', 'missing' ), 'missing', 'Map.get uses neutral hasOwnProperty method (positive)' );
+
+               conf.set( 'example', 'Foo' );
+               conf.set( 'hasOwnProperty', function () { return false; } );
+               assert.strictEqual( conf.get( 'example' ), 'Foo', 'Map.get uses neutral hasOwnProperty method (negative)' );
+
+               assert.strictEqual( conf.set( 'constructor', 42 ), true, 'Map.set for key "constructor"' );
+               assert.strictEqual( conf.get( 'constructor' ), 42, 'Map.get for key "constructor"' );
+
+               assert.strictEqual( conf.set( 'ImUndefined', undefined ), true, 'Map.set allows setting value to `undefined`' );
+               assert.equal( conf.get( 'ImUndefined', 'fallback' ), undefined , 'Map.get supports retreiving value of `undefined`' );
+
                assert.strictEqual( conf.set( funky, 'Funky' ), false, 'Map.set returns boolean false if key was invalid (Function)' );
                assert.strictEqual( conf.set( arry, 'Arry' ), false, 'Map.set returns boolean false if key was invalid (Array)' );
                assert.strictEqual( conf.set( nummy, 'Nummy' ), false, 'Map.set returns boolean false if key was invalid (Number)' );
-               assert.equal( conf.get( 'myKey' ), 'myValue', 'Map.get returns a single value value correctly' );
-               assert.strictEqual( conf.get( nummy ), null, 'Map.get ruturns null if selection was invalid (Number)' );
+
                assert.strictEqual( conf.get( funky ), null, 'Map.get ruturns null if selection was invalid (Function)' );
+               assert.strictEqual( conf.get( nummy ), null, 'Map.get ruturns null if selection was invalid (Number)' );
+
+               conf.set( String( nummy ), 'I used to be a number' );
+
+               assert.strictEqual( conf.exists( 'doesNotExist' ), false, 'Map.exists where property does not exist' );
+               assert.strictEqual( conf.exists( 'ImUndefined' ), true, 'Map.exists where value is `undefined`' );
+               assert.strictEqual( conf.exists( nummy ), false, 'Map.exists where key is invalid but looks like an existing key' );
 
                // Multiple values at once
                someValues = {
                        'notExist': null
                }, 'Map.get return includes keys that were not found as null values' );
 
-               assert.strictEqual( conf.exists( 'foo' ), true, 'Map.exists returns boolean true if a key exists' );
-               assert.strictEqual( conf.exists( 'notExist' ), false, 'Map.exists returns boolean false if a key does not exists' );
 
                // Interacting with globals and accessing the values object
                assert.strictEqual( conf.get(), conf.values, 'Map.get returns the entire values object by reference (if called without arguments)' );
 
                conf.set( 'globalMapChecker', 'Hi' );
 
-               assert.ok( false === 'globalMapChecker' in window, 'new mw.Map did not store its values in the global window object by default' );
+               assert.ok( 'globalMapChecker' in window === false, 'new mw.Map did not store its values in the global window object by default' );
 
                globalConf = new mw.Map( true );
                globalConf.set( 'anotherGlobalMapChecker', 'Hello' );