From: jenkins-bot Date: Tue, 2 Jun 2015 05:06:52 +0000 (+0000) Subject: Merge "Add List-Unsubscribe header to emails" X-Git-Tag: 1.31.0-rc.0~11219 X-Git-Url: https://git.heureux-cyclage.org/index.php?a=commitdiff_plain;h=6aaddf00c3c4498fcf079f45c26aebe3a909e45c;hp=b2a043f1ef63e770dff3d4f4204561e06b702dbc;p=lhc%2Fweb%2Fwiklou.git Merge "Add List-Unsubscribe header to emails" --- diff --git a/.jshintrc b/.jshintrc index 4bb244030c..d72c31d66f 100644 --- a/.jshintrc +++ b/.jshintrc @@ -21,6 +21,7 @@ "globals": { "mediaWiki": true, "JSON": true, + "OO": true, "jQuery": false, "QUnit": false, "sinon": false diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..12ff31db3a --- /dev/null +++ b/.mailmap @@ -0,0 +1,213 @@ +[BOT] Gerrit Patch Uploader +[BOT] Translation updater bot +Aaron Schulz +Aaron Schulz +Adam Roses Wight +addshore +Adrian Heine +Alex Monk +Alex Monk +Alexander Emsenhuber +Alexander Emsenhuber +Alexander Emsenhuber +Alexia E. Smith +Amir E. Aharoni +Antoine Musso +Antoine Musso +Arlo Breault +aude +Audrey Tang +Audrey Tang +ayush_garg +Bahodir Mansurov +Bartosz Dziewoński +Bartosz Dziewoński +Bartosz Dziewoński +Bene +Brad Jorsch +Brian Wolff +Brion Vibber +Brion Vibber +Brion Vibber +Bryan Davis +C. Scott Ananian +C. Scott Ananian +cacycle@gerrit.wikimedia.org +cenarium +Chad Horohoe +Chiefwei +Chris McMahon +Chris Steipp +Christian Aistleitner +Christian Williams +Christian Williams +Christian Williams +ckoerner +Dan Duvall +dan-nl +Daniel Kinzler +Daniel A. R. Werner +David Chan +Derk-Jan Hartman +Douglas Gardner +DPStokesNZ +Ebrahim Byagowi +Ed Sanders +Elliott Eggleston +eranroz +Erik Bernhardson +Erik Moeller +Erik Moeller +Erwin Dokter +Evan McIntire +Federico Leva +Florianschmidtwelzow +Fomafix +FunPika +Gabriel Wicke +Gabriel Wicke +Gabriel Wicke +Geoffrey Mon +Gergő Tisza +Gergő Tisza +Giftpflanze +Gilles Dubuc +gladoscc +glaisher +Helder +Helder +Hoo man +Inez Korczyński +Inez Korczyński +isarra +Jack Phoenix +Jackmcbarn +Jackmcbarn +jagori +James D. Forrester +Jan Zerebecki +Jaroslav Å karvada +jarrettmunton +Jeff Hall +Jeff Hall +Jeff Janes +jeroendedauw +Jesús Martínez Novo +Jiabao +Jon Robson +Jon Robson +Juliusz Gonera +Juliusz Gonera +JuneHyeon Bae +Kevin Israel +Kunal Mehta +Kunal Mehta +lekshmi +Liangent +Ljudusika +Luis Felipe Schenone +m4tx +Marielle Volz +Marius Hoch +Mark A. Hershberger +Mark A. Hershberger +Mark A. Hershberger +Mark Holmquist +Marko Obrovac +Matthew Flaschen +Matthias Mullie +Max Semenik +mgooley +mjbmr +Moriel Schottlender +Moriel Schottlender +Mormegil +Mukunda Modell +MZMcBride +Namit +Nemo bis +Nik Everett +Niklas Laxström +Nuria Ruiz +Ori.livneh +paladox +Patrick Westerhoff +Peter Coti +Petr Kadlec +physikerwelt (Moritz Schubotz) +PiRSquared17 +PranavK +Prateek Saxena +Prateek Saxena +Purodha +Raimond Spekking +Raimond Spekking +Reza +Ricordisamoa +rillke +rillke +Roan Kattouw +Roan Kattouw +Roan Kattouw +Rob Moen +Rob Moen +Rob Moen +Robert Hoenig +robinhood701 +Rohan +Rummana Yasmeen +Ryan Kaldari +Ryan Kaldari +S Page +Sam Reed +Sam Reed +Sam Smith +Santhosh Thottingal +saper +Schnark +Scimonster +Sean Pringle +Seb35 +Sergio Santoro +Shahyar +Siebrand Mazeland +Siebrand Mazeland +Siebrand Mazeland +Siebrand Mazeland +Southparkfan +Stanislav Malyshev +Stephan Gambke +Stephane Bisson +Stephen Liang +Steven Roddis +Subramanya Sastry +Sucheta Ghoshal +Sumit Asthana +Thalia Chan +TheDJ +Thiemo Mättig (WMDE) +This, that and the other +tholam +Tim Landscheidt +Tim Starling +Timo Tijhof +Timo Tijhof +Timo Tijhof +Tina Johnson +Tony Thomas <01tonythomas@gmail.com> +Trevor Parscal +Trevor Parscal +Trevor Parscal +Tyler Cipriani +Tyler Romeo +umherirrender +Vikas S Yaligar +Vivek Ghaisas +wctaiwan +withoutaname +Yaroslav Melnychuk +Yuri Astrakhan +Yusuke Matsubara +YuviPanda +Željko Filipin +Željko Filipin diff --git a/CREDITS b/CREDITS index 772503455b..22dee7bdad 100644 --- a/CREDITS +++ b/CREDITS @@ -240,6 +240,7 @@ following names for their contribution to the product. * Van de Bugger * Ville Stadista * Vitaliy Filippov +* Vivek Ghaisas * Waldir Pimenta * William Demchick * Yusuke Matsubara diff --git a/Gemfile b/Gemfile index 6f9c0539e0..a67be6b442 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,5 @@ source 'https://rubygems.org' -gem 'mediawiki_selenium', '~> 1.0.1' +gem 'mediawiki_selenium', '~> 1.2.0' gem 'rubocop', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 0b360aedbe..0d0a5c2729 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM astrolabe (1.3.0) parser (>= 2.2.0.pre.3, < 3.0) builder (3.2.2) - childprocess (0.5.5) + childprocess (0.5.6) ffi (~> 1.0, >= 1.0.11) cucumber (1.3.19) builder (>= 2.1.2) @@ -13,11 +13,11 @@ GEM gherkin (~> 2.12) multi_json (>= 1.7.5, < 2.0) multi_test (>= 0.1.2) - data_magic (0.20) + data_magic (0.21) faker (>= 1.1.2) yml_reader (>= 0.4) diff-lcs (1.2.5) - domain_name (0.5.23) + domain_name (0.5.24) unf (>= 0.0.5, < 1.0.0) faker (1.4.3) i18n (~> 0.5) @@ -26,7 +26,7 @@ GEM faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) - ffi (1.9.6) + ffi (1.9.8) gherkin (2.12.2) multi_json (~> 1.3) headless (1.0.2) @@ -37,7 +37,7 @@ GEM mediawiki_api (0.3.1) faraday (~> 0.9, >= 0.9.0) faraday-cookie_jar (~> 0.0, >= 0.0.6) - mediawiki_selenium (1.0.1) + mediawiki_selenium (1.2.0) cucumber (~> 1.3, >= 1.3.10) headless (~> 1.0, >= 1.0.1) json (~> 1.8, >= 1.8.1) @@ -47,12 +47,12 @@ GEM rspec-expectations (~> 2.14, >= 2.14.4) syntax (~> 1.2, >= 1.2.0) thor (~> 0.19, >= 0.19.1) - mime-types (2.4.3) + mime-types (2.6.1) multi_json (1.11.0) multi_test (0.1.2) multipart-post (2.0.0) netrc (0.10.3) - page-object (1.0.3) + page-object (1.1.0) page_navigation (>= 0.9) selenium-webdriver (>= 2.44.0) watir-webdriver (>= 0.6.11) @@ -62,7 +62,8 @@ GEM ast (>= 1.1, < 3.0) powerpack (0.1.0) rainbow (2.0.0) - rest-client (1.7.3) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) rspec-expectations (2.99.2) @@ -84,15 +85,15 @@ GEM thor (0.19.1) unf (0.1.4) unf_ext - unf_ext (0.0.6) + unf_ext (0.0.7.1) watir-webdriver (0.7.0) selenium-webdriver (>= 2.45) - websocket (1.2.1) + websocket (1.2.2) yml_reader (0.5) PLATFORMS ruby DEPENDENCIES - mediawiki_selenium (~> 1.0.1) + mediawiki_selenium (~> 1.2.0) rubocop diff --git a/HISTORY b/HISTORY index 0cf6b08537..07f0fac127 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,551 @@ Change notes from older releases. For current info see RELEASE-NOTES-1.26. +== MediaWiki 1.25 == + +=== Configuration changes in 1.25 === +* $wgPageShowWatchingUsers was removed. +* $wgLocalVirtualHosts has been added to replace $wgConf->localVHosts. +* $wgAntiLockFlags was removed. +* $wgJavaScriptTestConfig was removed. +* Edit tokens returned from User::getEditToken may change on every call. Token + validity must be checked by passing the user-supplied token to + User::matchEditToken rather than by testing for equality with a + newly-generated token. +* (T74951) The UserGetLanguageObject hook may be passed any IContextSource + for its $context parameter. Formerly it was documented as receiving a + RequestContext specifically. +* Profiling was restructured and $wgProfiler now requires an 'output' parameter. + See StartProfiler.sample for details. +* $wgMangleFlashPolicy was added to make MediaWiki's mangling of anything that + might be a flash policy directive configurable. +* ApiOpenSearch now supports XML output. The OpenSearchXml extension should no + longer be used. If extracts and page images are desired, the TextExtracts and + PageImages extensions are required. +* $wgOpenSearchTemplate is deprecated in favor of $wgOpenSearchTemplates. +* Edits are now prepared via AJAX as users type edit summaries. This behavior + can be disabled via $wgAjaxEditStash. +* (T46740) The temporary option $wgIncludejQueryMigrate was removed, along + with the jQuery Migrate library, as indicated when this option was provided in + MediaWiki 1.24. +* ProfilerStandard and ProfilerSimpleTrace were removed. Make sure that any + StartProfiler.php config is updated to reflect this. Xhprof is available + for zend/hhvm. Also, for hhvm, one can consider using its xenon profiler. +* Default value of $wgSVGConverters['rsvg'] now uses the 'rsvg-convert' binary + rather than 'rsvg'. +* Default value of $wgSVGConverters['ImageMagick'] now uses transparent + background with white fallback color, rather than just white background. + * MediaWikiBagOStuff class removed, make sure any object cache config + uses SqlBagOStuff instead. +* The 'daemonized' flag must be set to true in $wgJobTypeConf for any redis + job queues. This means that mediawiki/services/jobrunner service has to + be installed and running for any such queues to work. +* $wgAutopromoteOnce no longer supports the 'view' event. For keeping some + compatibility, any 'view' event triggers will still trigger on 'edit'. +* $wgExtensionDirectory was added for when your extensions directory is somewhere + other than $IP/extensions (as $wgStyleDirectory does with the skins directory). + +=== New features in 1.25 === +* (T64861) Updated plural rules to CLDR 26. Includes incompatible changes + for plural forms in Russian, Prussian, Tagalog, Manx and several languages + that fall back to Russian. +* (T60139) ResourceLoaderFileModule now supports language fallback + for 'languageScripts'. +* Added a new hook, "ContentAlterParserOutput", to allow extensions to modify the + parser output for a content object before links update. +* (T37785) Enhanced recent changes and extended watchlist are now default. + Documentation: https://meta.wikimedia.org/wiki/Help:Enhanced_recent_changes + and https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions. +* (T69341) SVG images will no longer be base64-encoded when being embedded + in CSS. This results in slight size increase before gzip compression (due to + percent-encoding), but up to 20% decrease after it. +* Update jStorage to v0.4.12. +* MediaWiki now natively supports page status indicators: icons (or short text + snippets) usually displayed in the top-right corner of the page. They have + been in use on Wikipedia for a long time, implemented using templates and CSS + absolute positioning. + - Basic wikitext syntax: [[File:Foo.svg|20px]] + - Usage instructions: https://www.mediawiki.org/wiki/Help:Page_status_indicators + - Adjusting custom skins to support indicators: + https://www.mediawiki.org/wiki/Manual:Skinning#Page_status_indicators +* Edit tokens may now be time-limited: passing a maximum age to + User::matchEditToken will reject any older tokens. +* The debug logging internals have been overhauled, and are now using the + PSR-3 interfaces. +* Update CSSJanus to v1.1.1. +* Update lessphp to v0.5.0. +* Added a hook, "ApiOpenSearchSuggest", to allow extensions to provide extracts + and images for ApiOpenSearch output. The semantics are identical to the + "OpenSearchXml" hook provided by the OpenSearchXml extension. +* PrefixSearchBackend hook now has an $offset parameter. Combined with $limit, + this allows for pagination of prefix results. Extensions using this hook + should implement supporting behavior. Not doing so can result in undefined + behavior from API clients trying to continue through prefix results. +* Update jQuery from v1.11.1 to v1.11.3. +* External libraries installed via composer will now be displayed + on Special:Version in their own section. Extensions or skins that are + installed via composer will not be shown in this section as it is assumed + they will add the proper credits to the skins or extensions section. They + can also be accessed through the API via the new siprop=libraries to + ApiQuerySiteInfo. +* Update QUnit from v1.14.0 to v1.16.0. +* Update Moment.js from v2.8.3 to v2.8.4. +* Special:Tags now allows for manipulating the list of user-modifiable change + tags. +* Added 'managetags' user right and 'ChangeTagCanCreate', 'ChangeTagCanDelete', + and 'ChangeTagCanCreate' hooks to allow for managing user-modifiable change + tags. +* Added 'ChangeTagsListActive' hook, to separate the concepts of "defined" and + "active" formerly conflated by the 'ListDefinedTags' hook. +* Added TemplateParser class that provides a server-side interface to cachable + dynamically-compiled Mustache templates (currently uses lightncandy library). +* Clickable anchors for each section heading in the content are now generated + and appear in the gutter on hovering over the heading. +* Added 'CategoryViewer::doCategoryQuery' and 'CategoryViewer::generateLink' hooks + to allow extensions to override how links to pages are rendered within NS_CATEGORY +* (T19665) Special:WantedPages only lists page which having at least one red link + pointing to it. +* New hooks 'ApiMain::moduleManager' and 'ApiQuery::moduleManager', can be + used for conditional registration of API modules. +* New hook 'EnhancedChangesList::getLogText' to alter, remove or add to the + links of a group of changes in EnhancedChangesList. +* A full interface for StatsD metric reporting has been added to the context + interface, reachable via IContextSource::getStats(). +* Move the jQuery Client library from being mastered in MediaWiki as v0.1.0 to a + proper, published library, which is now tagged as v1.0.0. +* A new message (defaulting to blank), 'editnotice-notext', can be shown to users + when they are editing if no edit notices apply to the page being edited. +* (T94536) You can now make the sitenotice appear to logged-in users only by + editing MediaWiki:Anonnotice and replacing its content with "". Setting it to + "-" (default) will continue disable it and fallback to MediaWiki:Sitenotice. +* Modifying the tagging of a revision or log entry is now available via + Special:EditTags, generally accessed via the revision-deletion-like interface + on history pages and Special:Log is likely to be more useful. +* Added 'applychangetags' and 'changetags' user rights. +* (T35235) LogFormatter subclasses are now responsible for formatting the + parameters for API log event output. Extensions should implement the new + getParametersForApi() method in their log formatters. + +==== External libraries ==== +* MediaWiki now requires certain external libraries to be installed. In the past + these were bundled inside the Git repository of MediaWiki core, but now they + need to be installed separately. For users using the tarball, this will be taken + care of and no action will be required. Users using Git will either need to use + composer to fetch dependencies or use the mediawiki/vendor repository which includes + all dependencies for MediaWiki core and ones used in Wikimedia deployment. Detailed + instructions can be found at: + https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries +* The following libraries are now required: +** psr/log + This library provides the interfaces set by the PSR-3 standard (http://www.php-fig.org/psr/psr-3/) + which are used by MediaWiki internally via the + MediaWiki\Logger\LoggerFactory class. + See the structured logging RfC (https://www.mediawiki.org/wiki/Requests_for_comment/Structured_logging) + for more background information. +** cssjanus/cssjanus + This library was formerly bundled with MediaWiki core and has been removed. + It automatically flips CSS for RTL support. +** leafo/lessphp + This library was formerly bundled with MediaWiki core and has been removed. + It compiles LESS files into CSS. +** wikimedia/cdb + This library was formerly a part of MediaWiki core, and has been moved into a separate library. + It provides CDB functions which are used in the Interwiki and Localization caches. + More information about the library can be found at https://www.mediawiki.org/wiki/CDB. +** liuggio/statsd-php-client + This library provides a StatsD client API for logging application metrics to a remote server. + +=== Bug fixes in 1.25 === +* (T73003) No additional code will be generated to try to load CSS-embedded + SVG images in Internet Explorer 6 and 7, as they don't support them anyway. +* (T69021) On Special:BookSources, corrected validation of ISBNs (both + 10- and 13-digit forms) containing "X". +* Page moving was refactored into a MovePage class. As part of that: +** The AbortMove hook was removed. +** MovePageIsValidMove is for extensions to specify whether a page + cannot be moved for technical reasons, and should not be overridden. +** MovePageCheckPermissions is for checking whether the given user is + allowed to make the move. +** Title::moveNoAuth() was deprecated. Use the MovePage class instead. +** Title::moveTo() was deprecated. Use the MovePage class instead. +** Title::isValidMoveOperation() broken down into MovePage::isValidMove() + and MovePage::checkPermissions(). +* (T18530) Multiple autocomments are now formatted in an edit summary. +* (T70361) Autocomments containing "/*" are parsed correctly. +* The Special:WhatLinksHere page linked from 'Number of redirects to this page' + on action=info about a file page does not list file links anymore. +* (T78637) Search bar is not autofocused unless it is empty so that proper scrolling using arrow keys is possible. +* (T50853) Database::makeList() modified to handle 'NULL' separately when building IN clause +* (T85192) Captcha position modified in Usercreate template. As a result: +** extrafields parameter added to Usercreate.php to insert additional data +** 'extend' method added to QuickTemplate to append additional values to any field of data array +* (T86974) Several Title methods now load from the database when necessary + (instead of returning incorrect results) even when the page ID is known. +* (T74070) Duplicate search for archived files on file upload now omits the extension. + This requires the fa_sha1 field being populated. +* Removed rel="archives" from the "View history" link, as it did not pass + HTML validation. +* $wgUseTidy is now set when parserTests are run with the tidy option to match + output on wiki. +* (T37472) update.php will purge ResourceLoader cache unless --nopurge is passed to it. +* (T72109) mediawiki.language should respect $wgTranslateNumerals in convertNumber(). + +=== Action API changes in 1.25 === +* (T67403) XML tag highlighting is now only performed for formats + "xmlfm" and "wddxfm". +* action=paraminfo supports generalized submodules (modules=query+value), + querymodules and formatmodules are deprecated +* action=paraminfo no longer outputs descriptions and other help text by + default. If needed, it may be requested using the new 'helpformat' parameter. +* action=help has been completely rewritten, and outputs help in HTML + rather than plain text. +* Hitting api.php without specifying an action now displays only the help for + the main module, with links to submodule help. +* API help is no longer displayed on errors. +* 'uselang' is now a recognized API parameter; "uselang=user" may be used to + explicitly select the language from the current user's preferences, and + "uselang=content" may be used to select the wiki's content language. +* Default output format for the API is now jsonfm. +* Simplified continuation will return a "batchcomplete" property in the result + when a batch of pages is complete. +* Pretty-printed HTML output now has nicer formatting and (if available) + better syntax highlighting. +* Deprecated list=deletedrevs in favor of newly-added prop=deletedrevisions and + list=alldeletedrevisions. +* prop=revisions will gracefully continue when given too many revids or titles, + rather than just ignoring the extras. +* prop=revisions will no longer die if rvcontentformat doesn't match a + revision's content model; it will instead warn and omit the content. +* If the user has the 'deletedhistory' right, action=query's revids parameter + will now recognize deleted revids. +* prop=revisions may be used as a generator, generating revids. +* (T68776) format=json results will no longer be corrupted when + $wgMangleFlashPolicy is in effect. format=php results will cleanly return an + error instead of returning invalid serialized data. +* Generators may now return data for the generated pages when used with + action=query. +* Query page data for generator=search and generator=prefixsearch will now + include an "index" field, which may be used by the client for sorting the + search results. +* ApiOpenSearch now supports XML output. +* ApiOpenSearch will now output descriptions and URLs as array indexes 2 and 3 + in JSON format. +* (T76051) list=tags will now continue correctly. +* (T76052) list=tags can now indicate whether a tag is defined. +* (T75522) list=prefixsearch now supports continuation +* (T78737) action=expandtemplates can now return page properties. +* (T78690) list=allimages now accepts multiple pipe-separated values + for the 'aimime' parameter. +* prop=info with inprop=protections will now return applicable protection types + with the 'restrictiontypes' key. +* (T85417) When resolving redirects, ApiPageSet will now add the targets of + interwiki redirects to the list of interwiki titles. +* (T85417) When outputting the list of redirect titles, a 'tointerwiki' + property (like the existing 'tofragment' property) will be set. +* Added action=managetags to allow for managing the list of + user-modifiable change tags. Actually modifying the tagging of a revision or + log entry is not implemented yet. +* list=tags has additional properties to indicate 'active' status and tag + sources. +* siprop=libraries was added to ApiQuerySiteInfo to list installed external libraries. +* (T88010) Added action=checktoken, to test a CSRF token's validity. +* (T88010) Added intestactions to prop=info, to allow querying of + Title::userCan() via the API. +* Default type param for query list=watchlist and list=recentchanges has + been changed from all types (e.g. including 'external') to 'edit|new|log'. +* Added formatversion to format=json. Still "experimental" as further changes + to the output formatting might still be made. +* (T73020) Log event details are now always under a 'params' subkey for + list=logevents, and a 'logparams' subkey for list=watchlist and + list=recentchanges. +* Log event details are changing formatting: + * block events now report flags as an array rather than as a comma-separated + list. + * patrol events now report the 'auto' flag as a boolean (absent/empty string + for BC formats) rather than as an integer. + * rights events now report the old and new group lists as arrays rather than + as comma-separated lists. + * merge events use new-style formatting. + * delete/event and delete/revision events use new-style formatting. +* The root node and various other nodes will now always be an object in formats + such as json that distinguish between arrays and objects. + * Except for action=opensearch where the spec requires an array. + +=== Action API internal changes in 1.25 === +* ApiHelp has been rewritten to support i18n and paginated HTML output. + Most existing modules should continue working without changes, but should do + the following: + * Add an i18n message "apihelp-{$moduleName}-description" to replace getDescription(). + * Add i18n messages "apihelp-{$moduleName}-param-{$param}" for each parameter + to replace getParamDescription(). If necessary, the settings array returned + by getParams() can use the new ApiBase::PARAM_HELP_MSG key to override the + message. + * Implement getExamplesMessages() to replace getExamples(). +* Modules with submodules (like action=query) must have their submodules + override ApiBase::getParent() to return the correct parent object. +* The 'APIGetDescription' and 'APIGetParamDescription' hooks are deprecated, + and will have no effect for modules using i18n messages. Use + 'APIGetDescriptionMessages' and 'APIGetParamDescriptionMessages' instead. +* Api formatters will no longer be asked to display the help screen on errors. +* ApiMain::getCredits() was removed. The credits are available in the + 'api-credits' i18n message. +* ApiFormatBase has been changed to support i18n and syntax highlighting via + extensions with the new 'ApiFormatHighlight' hook. Core syntax highlighting + has been removed. +* ApiFormatBase now always buffers. Output is done when + ApiFormatBase::closePrinter is called. +* Much of the logic in ApiQueryRevisions has been split into ApiQueryRevisionsBase. +* The 'revids' parameter supplied by ApiPageSet will now count deleted + revisions as "good" if the user has the 'deletedhistory' right. New methods + ApiPageSet::getLiveRevisionIDs() and ApiPageSet::getDeletedRevisionIDs() are + provided to access just the live or just the deleted revids. +* Added ApiPageSet::setGeneratorData() and ApiPageSet::populateGeneratorData() + to allow generators to include data in the action=query result. +* New hooks 'ApiMain::moduleManager' and 'ApiQuery::moduleManager', can be + used for conditional registration of API modules. +* Added ApiBase::lacksSameOriginSecurity() to allow modules to easily check if + the current request was sent with the 'callback' parameter (or any future + method that breaks the same-origin policy). +* Profiling methods in ApiBase are deprecated and no longer need to be called. +* ApiResult was greatly overhauled. See inline documentation for details. +* ApiResult will automatically convert objects to strings or arrays (depending + on whether a __toString() method exists on the object), and will refuse to + add unsupported value types. + * An informal interface, ApiSerializable, exists to override the default + object conversion. +* ApiResult/ApiFormatBase "raw mode" is deprecated. +* ApiFormatXml now assumes defaults and so on instead of throwing errors when + metadata isn't set. +* (T35235) LogFormatter subclasses are now responsible for formatting log event + parameters for the API. +* Many modules have changed result data formats. While this shouldn't affect + clients not using the experimental formatversion=2, code using + ApiResult::getResultData() without the transformations for backwards + compatibility may need updating, as will code that wasn't following the old + conventions for API boolean output. +* The following methods have been deprecated and may be removed in a future + release: + * ApiBase::getDescription + * ApiBase::getParamDescription + * ApiBase::getExamples + * ApiBase::makeHelpMsg + * ApiBase::makeHelpArrayToString + * ApiBase::makeHelpMsgParameters + * ApiBase::getModuleProfileName + * ApiBase::profileIn + * ApiBase::profileOut + * ApiBase::safeProfileOut + * ApiBase::getProfileTime + * ApiBase::profileDBIn + * ApiBase::profileDBOut + * ApiBase::getProfileDBTime + * ApiBase::getResultData + * ApiFormatBase::setUnescapeAmps + * ApiFormatBase::getWantsHelp + * ApiFormatBase::setHelp + * ApiFormatBase::formatHTML + * ApiFormatBase::setBufferResult + * ApiFormatBase::getDescription + * ApiFormatBase::getNeedsRawData + * ApiMain::setHelp + * ApiMain::reallyMakeHelpMsg + * ApiMain::makeHelpMsgHeader + * ApiResult::setRawMode + * ApiResult::getIsRawMode + * ApiResult::getData + * ApiResult::setElement + * ApiResult::setContent + * ApiResult::setIndexedTagName_recursive + * ApiResult::setIndexedTagName_internal + * ApiResult::setParsedLimit + * ApiResult::beginContinuation + * ApiResult::setContinueParam + * ApiResult::setGeneratorContinueParam + * ApiResult::endContinuation + * ApiResult::size + * ApiResult::convertStatusToArray + * ApiQueryImageInfo::getPropertyDescriptions + * ApiQueryLogEvents::addLogParams +* The following classes have been deprecated and may be removed in a future + release: + * ApiQueryDeletedrevs + +=== Languages updated in 1.25 === + +MediaWiki supports over 350 languages. Many localisations are updated +regularly. Below only new and removed languages are listed, as well as +changes to languages because of Bugzilla reports. + +* Languages added: +** awa (अवधी / Awadhi), thanks to translator 1AnuraagPandey; +** bgn (بلوچی رخشانی / Western Balochi), thanks to translators + Baloch Afghanistan, Ibrahim khashrowdi and Rachitrali; +** ses (Koyraboro Senni), thanks to translator Songhay. +* (T66440) Kazakh (kk) wikis should no longer forcefully reset the user's + interface language to kk where unexpected. +* The Chinese conversion table was substantially updated to fix a lot of + bugs and ensure better reading experience for different variants. + +=== Other changes in 1.25 === +* (T45591) Links to MediaWiki.org translatable help were added to indicators, + mostly in special pages. Local custom target titles can be placed in the + relevant '(namespace-X|action name|special page name)-helppage' system + message. Extensions can use the addHelpLink() function to do the same. +* The skin autodiscovery mechanism, deprecated in MediaWiki 1.23, has been + removed. See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for + migration guide for creators and users of custom skins that relied on it. +* Javascript variables 'wgFileCanRotate' and 'wgFileExtensions' now only + available on Special:Upload. +* (T58257) Set site logo from mediawiki.skinning.interface module instead of + inline styles in the HTML. +* Removed ApiQueryUsers::getAutoGroups(). (deprecated since 1.20) +* Removed XmlDumpWriter::schemaVersion(). (deprecated since 1.20) +* Removed LogEventsList::getDisplayTitle(). (deprecated since 1.20) +* Removed Preferences::trySetUserEmail(). (deprecated since 1.20) +* Removed mw.user.name() and mw.user.anonymous() methods. (deprecated since 1.20) +* Removed 'ok' and 'err' parameters in the mediawiki.api modules. (deprecated + since 1.20) +* Removed 'async' parameter from the mw.Api#getCategories() method. (deprecated + since 1.20) +* Removed 'jquery.json' module. (deprecated since 1.24) + Use the 'json' module and global JSON object instead. +* Deprecated OutputPage::readOnlyPage() and OutputPage::rateLimited(). + Also, the former will now throw an MWException if called with one or more + arguments. +* Removed hitcounters and associated code. +* The "temp" zone of the upload respository is now considered private. If it + already exists (such as under the images/ directory), please make sure that + the directory is not web readable (e.g. via a .htaccess file). +* BREAKING CHANGE: In the XML dump format used by Special:Export and + dumpBackup.php, the and tags now apprear before the + tag, instead of after the and tags. + The new schema version is 0.10, the new schema URI is: + https://www.mediawiki.org/xml/export-0.10.xsd +* MWFunction::call() and MWFunction::callArray() were removed, having being + deprecated in 1.22. +* Deprecated the getInternalLinkAttributes, getInternalLinkAttributesObj, + and getInternalLinkAttributes methods in Linker, and removed + getExternalLinkAttributes method, which was deprecated in MediaWiki 1.18. +* Removed Sites class, which was deprecated in 1.21 and replaced by SiteSQLStore. +* Added wgRelevantArticleId to the client-side config, for use on special pages. +* Deprecated the TitleIsCssOrJsPage hook. Superseded by the + ContentHandlerDefaultModelFor hook since MediaWiki 1.21. +* Deprecated the TitleIsWikitextPage hook. Superseded by the + ContentHandlerDefaultModelFor hook since MediaWiki 1.21. +* Changed parsing of variables in schema (.sql) files: +** The substituted values are no longer parsed. (Formerly, several passes + were made for each variable, so depending on the order in which variables + were defined, variables might have been found inside encoded values. This + is no longer the case.) +** Variables are no longer string encoded when the /*$var*/ syntax is used. + If string encoding is necessary, use the '{$var}' syntax instead. +** Variable names must only consist of one or more of the characters + "A-Za-z0-9_". +** In source text of the form '{$A}'{$B}' or `{$A}`{$B}`, where variable A + does not exist yet variable B does, the latter may not be replaced. + However, this difference is unlikely to arise in practice. +* (T67278) RFC, PMID, and ISBN "magic links" must be surrounded by non-word + characters on both sides. +* The FormatAutocomments hook will now receive $pre and $post as booleans, + rather than as strings that must be prepended or appended to $comment. +* (T30950, T31025) RFC, PMID, and ISBN "magic links" can no longer contain + newlines; but they can contain   and other non-newline whitespace. +* The 'mediawiki.action.edit' ResourceLoader module no longer generates the edit + toolbar, which has been moved to a separate 'mediawiki.toolbar' module. If you + relied on this behavior, update your scripts' dependencies. +* HTMLForm's 'vform' display style has been separated to a subclass. Therefore: + * HTMLForm::isVForm() is now deprecated. + * You can no longer do this: + $form = new HTMLForm( … ); + $form->setDisplayFormat( 'vform' ); // throws exception + Instead, do this: + $form = HTMLForm::factory( 'vform', … ); +* Deprecated Revision methods getRawUser(), getRawUserText() and getRawComment(). +* BREAKING CHANGE: mediawiki.user.generateRandomSessionId: + The alphabet of the prior string returned was A-Za-z0-9 and now it is 0-9A-F +* (T87504) Avoid serving SVG background-images in CSS for Opera 12, which + renders them incorrectly when combined with border-radius or background-size. +* Removed maintenance script dumpSisterSites.php. +* DatabaseBase class constructors must be called using the array argument style. + Ideally, DatabaseBase:factory() should be used instead in most cases. +* Deprecated ParserOutput::addSecondaryDataUpdate and ParserOutput::getSecondaryDataUpdates. + This is a hard deprecation, with getSecondaryDataUpdates returning an empty array and + addSecondaryDataUpdate throwing an exception. These functions will be removed in 1.26, + since they interfere with caching of ParserOutput objects. +* Introduced new hook 'SecondaryDataUpdates' that allows extensions to inject custom updates. +* Introduced new hook 'OpportunisticLinksUpdate' that allows extensions to perform + updates when a page is re-rendered. +* EditPage::attemptSave has been modified not to call handleStatus itself and + instead just returns the Status object. Extension calling it should be aware of + this. +* Removed class DBObject. (unused since 1.10) +* wfDiff() is deprecated. +* The -m (maximum replication lag) option of refreshLinks.php was removed. + It had no effect since MediaWiki 1.18 and should be removed from any cron + jobs or similar scripts you may have set up. +* (T85864) The following messages no longer support raw html: redirectto, + thisisdeleted, viewdeleted, editlink, retrievedfrom, version-poweredby-others, + retrievedfrom, thisisdeleted, viewsourcelink, lastmodifiedat, laggedslavemode, + protect-summary-cascade +* All BloomCache related code has been removed. This was largely experimental. +* $wgResourceModuleSkinStyles no longer supports per-module local or remote paths. They + can only be set for the entire skin. +* Removed global function swap(). (deprecated since 1.24) +* Deprecated the ".php5" file extension entry points and the $wgScriptExtension + configuration variable. Refer to the ".php" files instead. If you want + ".php5" URLs to continue to work, set up redirects. In Apache, this can be + done by enabling mod_rewrite and adding the following rules to your + configuration: + + RewriteEngine On + RewriteBase / + RewriteRule ^(.*)\.php5 $1.php [R=301,L] + +* The global importScriptURI and importStylesheetURI functions, as well as the + loadedScripts object, from wikibits.js (deprecated since 1.17) now emit + warnings through mw.log.warn when accessed. + + +== Compatibility == + +MediaWiki 1.25 requires PHP 5.3.3 or later. There is experimental support for +HHVM 3.3.0. + +MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but +support for them is somewhat less mature. There is experimental support for +Oracle and Microsoft SQL Server. + +The supported versions are: + +* MySQL 5.0.3 or later +* PostgreSQL 8.3 or later +* SQLite 3.3.7 or later +* Oracle 9.0.1 or later +* Microsoft SQL Server 2005 (9.00.1399) + +== Upgrading == + +1.25 has several database changes since 1.24, and will not work without schema +updates. Note that due to changes to some very large tables like the revision +table, the schema update may take quite long (minutes on a medium sized site, +many hours on a large site). + +If upgrading from before 1.11, and you are using a wiki as a commons +repository, make sure that it is updated as well. Otherwise, errors may arise +due to database schema changes. + +If upgrading from before 1.7, you may want to run refreshLinks.php to ensure +new database fields are filled with data. + +If you are upgrading from MediaWiki 1.4.x or earlier, you should upgrade to +1.5 first. The upgrade script maintenance/upgrade1_5.php has been removed +with MediaWiki 1.21. + +Don't forget to always back up your database before upgrading! + +See the file UPGRADE for more detailed upgrade instructions. + +For notes on 1.24.x and older releases, see HISTORY. + == MediaWiki 1.24 == === Configuration changes in 1.24 === @@ -194,6 +740,13 @@ Change notes from older releases. For current info see RELEASE-NOTES-1.26. Special:DeletedContributions * Added DeletedContributionsLineEnding hook allowing extensions to format Special:DeletedContributions lines +* (T69525) You can now make MediaWiki speed up its thumbnail rendering by using + intermediary thumbnails. $wgThumbnailBuckets must be set to a list of target + thumbnail widths; when a new thumbnail needs to be rendered, MediaWiki will + find the smallest bucket smaller than the original but larger than the target + width + $wgThumbnailMinimumBucketDistance, and it will scale that thumbnail, + rather than the original, down to the target size at greater speed in return + for minor loss of fidelity. === Bug fixes in 1.24 === * (bug 50572) MediaWiki:Blockip should support gender diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 deleted file mode 100644 index e74f226581..0000000000 --- a/RELEASE-NOTES-1.25 +++ /dev/null @@ -1,578 +0,0 @@ -Security reminder: If you have PHP's register_globals option set, you must -turn it off. MediaWiki will not work with it enabled. - -== MediaWiki 1.25 == - -THIS IS NOT A RELEASE YET - -MediaWiki 1.25 is an alpha-quality branch and is not recommended for use in -production. - -=== Configuration changes in 1.25 === -* $wgPageShowWatchingUsers was removed. -* $wgLocalVirtualHosts has been added to replace $wgConf->localVHosts. -* $wgAntiLockFlags was removed. -* $wgJavaScriptTestConfig was removed. -* Edit tokens returned from User::getEditToken may change on every call. Token - validity must be checked by passing the user-supplied token to - User::matchEditToken rather than by testing for equality with a - newly-generated token. -* (T74951) The UserGetLanguageObject hook may be passed any IContextSource - for its $context parameter. Formerly it was documented as receiving a - RequestContext specifically. -* Profiling was restructured and $wgProfiler now requires an 'output' parameter. - See StartProfiler.sample for details. -* $wgMangleFlashPolicy was added to make MediaWiki's mangling of anything that - might be a flash policy directive configurable. -* ApiOpenSearch now supports XML output. The OpenSearchXml extension should no - longer be used. If extracts and page images are desired, the TextExtracts and - PageImages extensions are required. -* $wgOpenSearchTemplate is deprecated in favor of $wgOpenSearchTemplates. -* Edits are now prepared via AJAX as users type edit summaries. This behavior - can be disabled via $wgAjaxEditStash. -* (T46740) The temporary option $wgIncludejQueryMigrate was removed, along - with the jQuery Migrate library, as indicated when this option was provided in - MediaWiki 1.24. -* ProfilerStandard and ProfilerSimpleTrace were removed. Make sure that any - StartProfiler.php config is updated to reflect this. Xhprof is available - for zend/hhvm. Also, for hhvm, one can consider using its xenon profiler. -* Default value of $wgSVGConverters['rsvg'] now uses the 'rsvg-convert' binary - rather than 'rsvg'. -* Default value of $wgSVGConverters['ImageMagick'] now uses transparent - background with white fallback color, rather than just white background. - * MediaWikiBagOStuff class removed, make sure any object cache config - uses SqlBagOStuff instead. -* The 'daemonized' flag must be set to true in $wgJobTypeConf for any redis - job queues. This means that mediawiki/services/jobrunner service has to - be installed and running for any such queues to work. -* $wgAutopromoteOnce no longer supports the 'view' event. For keeping some - compatibility, any 'view' event triggers will still trigger on 'edit'. -* $wgExtensionDirectory was added for when your extensions directory is somewhere - other than $IP/extensions (as $wgStyleDirectory does with the skins directory). - -=== New features in 1.25 === -* (T64861) Updated plural rules to CLDR 26. Includes incompatible changes - for plural forms in Russian, Prussian, Tagalog, Manx and several languages - that fall back to Russian. -* (T60139) ResourceLoaderFileModule now supports language fallback - for 'languageScripts'. -* Added a new hook, "ContentAlterParserOutput", to allow extensions to modify the - parser output for a content object before links update. -* (T37785) Enhanced recent changes and extended watchlist are now default. - Documentation: https://meta.wikimedia.org/wiki/Help:Enhanced_recent_changes - and https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions. -* (T69341) SVG images will no longer be base64-encoded when being embedded - in CSS. This results in slight size increase before gzip compression (due to - percent-encoding), but up to 20% decrease after it. -* Update jStorage to v0.4.12. -* MediaWiki now natively supports page status indicators: icons (or short text - snippets) usually displayed in the top-right corner of the page. They have - been in use on Wikipedia for a long time, implemented using templates and CSS - absolute positioning. - - Basic wikitext syntax: [[File:Foo.svg|20px]] - - Usage instructions: https://www.mediawiki.org/wiki/Help:Page_status_indicators - - Adjusting custom skins to support indicators: - https://www.mediawiki.org/wiki/Manual:Skinning#Page_status_indicators -* Edit tokens may now be time-limited: passing a maximum age to - User::matchEditToken will reject any older tokens. -* The debug logging internals have been overhauled, and are now using the - PSR-3 interfaces. -* Update CSSJanus to v1.1.1. -* Update lessphp to v0.5.0. -* Added a hook, "ApiOpenSearchSuggest", to allow extensions to provide extracts - and images for ApiOpenSearch output. The semantics are identical to the - "OpenSearchXml" hook provided by the OpenSearchXml extension. -* PrefixSearchBackend hook now has an $offset parameter. Combined with $limit, - this allows for pagination of prefix results. Extensions using this hook - should implement supporting behavior. Not doing so can result in undefined - behavior from API clients trying to continue through prefix results. -* Update jQuery from v1.11.1 to v1.11.3. -* External libraries installed via composer will now be displayed - on Special:Version in their own section. Extensions or skins that are - installed via composer will not be shown in this section as it is assumed - they will add the proper credits to the skins or extensions section. They - can also be accessed through the API via the new siprop=libraries to - ApiQuerySiteInfo. -* Update QUnit from v1.14.0 to v1.16.0. -* Update Moment.js from v2.8.3 to v2.8.4. -* Special:Tags now allows for manipulating the list of user-modifiable change - tags. -* Added 'managetags' user right and 'ChangeTagCanCreate', 'ChangeTagCanDelete', - and 'ChangeTagCanCreate' hooks to allow for managing user-modifiable change - tags. -* Added 'ChangeTagsListActive' hook, to separate the concepts of "defined" and - "active" formerly conflated by the 'ListDefinedTags' hook. -* Added TemplateParser class that provides a server-side interface to cachable - dynamically-compiled Mustache templates (currently uses lightncandy library). -* Clickable anchors for each section heading in the content are now generated - and appear in the gutter on hovering over the heading. -* Added 'CategoryViewer::doCategoryQuery' and 'CategoryViewer::generateLink' hooks - to allow extensions to override how links to pages are rendered within NS_CATEGORY -* (T19665) Special:WantedPages only lists page which having at least one red link - pointing to it. -* New hooks 'ApiMain::moduleManager' and 'ApiQuery::moduleManager', can be - used for conditional registration of API modules. -* New hook 'EnhancedChangesList::getLogText' to alter, remove or add to the - links of a group of changes in EnhancedChangesList. -* A full interface for StatsD metric reporting has been added to the context - interface, reachable via IContextSource::getStats(). -* Move the jQuery Client library from being mastered in MediaWiki as v0.1.0 to a - proper, published library, which is now tagged as v1.0.0. -* A new message (defaulting to blank), 'editnotice-notext', can be shown to users - when they are editing if no edit notices apply to the page being edited. -* (T94536) You can now make the sitenotice appear to logged-in users only by - editing MediaWiki:Anonnotice and replacing its content with "". Setting it to - "-" (default) will continue disable it and fallback to MediaWiki:Sitenotice. -* Modifying the tagging of a revision or log entry is now available via - Special:EditTags, generally accessed via the revision-deletion-like interface - on history pages and Special:Log is likely to be more useful. -* Added 'applychangetags' and 'changetags' user rights. -* (T35235) LogFormatter subclasses are now responsible for formatting the - parameters for API log event output. Extensions should implement the new - getParametersForApi() method in their log formatters. - -==== External libraries ==== -* MediaWiki now requires certain external libraries to be installed. In the past - these were bundled inside the Git repository of MediaWiki core, but now they - need to be installed separately. For users using the tarball, this will be taken - care of and no action will be required. Users using Git will either need to use - composer to fetch dependencies or use the mediawiki/vendor repository which includes - all dependencies for MediaWiki core and ones used in Wikimedia deployment. Detailed - instructions can be found at: - https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries -* The following libraries are now required: -** psr/log - This library provides the interfaces set by the PSR-3 standard (http://www.php-fig.org/psr/psr-3/) - which are used by MediaWiki internally via the - MediaWiki\Logger\LoggerFactory class. - See the structured logging RfC (https://www.mediawiki.org/wiki/Requests_for_comment/Structured_logging) - for more background information. -** cssjanus/cssjanus - This library was formerly bundled with MediaWiki core and has been removed. - It automatically flips CSS for RTL support. -** leafo/lessphp - This library was formerly bundled with MediaWiki core and has been removed. - It compiles LESS files into CSS. -** wikimedia/cdb - This library was formerly a part of MediaWiki core, and has been moved into a separate library. - It provides CDB functions which are used in the Interwiki and Localization caches. - More information about the library can be found at https://www.mediawiki.org/wiki/CDB. -** liuggio/statsd-php-client - This library provides a StatsD client API for logging application metrics to a remote server. - -=== Bug fixes in 1.25 === -* (T73003) No additional code will be generated to try to load CSS-embedded - SVG images in Internet Explorer 6 and 7, as they don't support them anyway. -* (T69021) On Special:BookSources, corrected validation of ISBNs (both - 10- and 13-digit forms) containing "X". -* Page moving was refactored into a MovePage class. As part of that: -** The AbortMove hook was removed. -** MovePageIsValidMove is for extensions to specify whether a page - cannot be moved for technical reasons, and should not be overridden. -** MovePageCheckPermissions is for checking whether the given user is - allowed to make the move. -** Title::moveNoAuth() was deprecated. Use the MovePage class instead. -** Title::moveTo() was deprecated. Use the MovePage class instead. -** Title::isValidMoveOperation() broken down into MovePage::isValidMove() - and MovePage::checkPermissions(). -* (T18530) Multiple autocomments are now formatted in an edit summary. -* (T70361) Autocomments containing "/*" are parsed correctly. -* The Special:WhatLinksHere page linked from 'Number of redirects to this page' - on action=info about a file page does not list file links anymore. -* (T78637) Search bar is not autofocused unless it is empty so that proper scrolling using arrow keys is possible. -* (T50853) Database::makeList() modified to handle 'NULL' separately when building IN clause -* (T85192) Captcha position modified in Usercreate template. As a result: -** extrafields parameter added to Usercreate.php to insert additional data -** 'extend' method added to QuickTemplate to append additional values to any field of data array -* (T86974) Several Title methods now load from the database when necessary - (instead of returning incorrect results) even when the page ID is known. -* (T74070) Duplicate search for archived files on file upload now omits the extension. - This requires the fa_sha1 field being populated. -* Removed rel="archives" from the "View history" link, as it did not pass - HTML validation. -* $wgUseTidy is now set when parserTests are run with the tidy option to match - output on wiki. -* (T37472) update.php will purge ResourceLoader cache unless --nopurge is passed to it. -* (T72109) mediawiki.language should respect $wgTranslateNumerals in convertNumber(). - -=== Action API changes in 1.25 === -* (T67403) XML tag highlighting is now only performed for formats - "xmlfm" and "wddxfm". -* action=paraminfo supports generalized submodules (modules=query+value), - querymodules and formatmodules are deprecated -* action=paraminfo no longer outputs descriptions and other help text by - default. If needed, it may be requested using the new 'helpformat' parameter. -* action=help has been completely rewritten, and outputs help in HTML - rather than plain text. -* Hitting api.php without specifying an action now displays only the help for - the main module, with links to submodule help. -* API help is no longer displayed on errors. -* 'uselang' is now a recognized API parameter; "uselang=user" may be used to - explicitly select the language from the current user's preferences, and - "uselang=content" may be used to select the wiki's content language. -* Default output format for the API is now jsonfm. -* Simplified continuation will return a "batchcomplete" property in the result - when a batch of pages is complete. -* Pretty-printed HTML output now has nicer formatting and (if available) - better syntax highlighting. -* Deprecated list=deletedrevs in favor of newly-added prop=deletedrevisions and - list=alldeletedrevisions. -* prop=revisions will gracefully continue when given too many revids or titles, - rather than just ignoring the extras. -* prop=revisions will no longer die if rvcontentformat doesn't match a - revision's content model; it will instead warn and omit the content. -* If the user has the 'deletedhistory' right, action=query's revids parameter - will now recognize deleted revids. -* prop=revisions may be used as a generator, generating revids. -* (T68776) format=json results will no longer be corrupted when - $wgMangleFlashPolicy is in effect. format=php results will cleanly return an - error instead of returning invalid serialized data. -* Generators may now return data for the generated pages when used with - action=query. -* Query page data for generator=search and generator=prefixsearch will now - include an "index" field, which may be used by the client for sorting the - search results. -* ApiOpenSearch now supports XML output. -* ApiOpenSearch will now output descriptions and URLs as array indexes 2 and 3 - in JSON format. -* (T76051) list=tags will now continue correctly. -* (T76052) list=tags can now indicate whether a tag is defined. -* (T75522) list=prefixsearch now supports continuation -* (T78737) action=expandtemplates can now return page properties. -* (T78690) list=allimages now accepts multiple pipe-separated values - for the 'aimime' parameter. -* prop=info with inprop=protections will now return applicable protection types - with the 'restrictiontypes' key. -* (T85417) When resolving redirects, ApiPageSet will now add the targets of - interwiki redirects to the list of interwiki titles. -* (T85417) When outputting the list of redirect titles, a 'tointerwiki' - property (like the existing 'tofragment' property) will be set. -* Added action=managetags to allow for managing the list of - user-modifiable change tags. Actually modifying the tagging of a revision or - log entry is not implemented yet. -* list=tags has additional properties to indicate 'active' status and tag - sources. -* siprop=libraries was added to ApiQuerySiteInfo to list installed external libraries. -* (T88010) Added action=checktoken, to test a CSRF token's validity. -* (T88010) Added intestactions to prop=info, to allow querying of - Title::userCan() via the API. -* Default type param for query list=watchlist and list=recentchanges has - been changed from all types (e.g. including 'external') to 'edit|new|log'. -* Added formatversion to format=json. Still "experimental" as further changes - to the output formatting might still be made. -* (T73020) Log event details are now always under a 'params' subkey for - list=logevents, and a 'logparams' subkey for list=watchlist and - list=recentchanges. -* Log event details are changing formatting: - * block events now report flags as an array rather than as a comma-separated - list. - * patrol events now report the 'auto' flag as a boolean (absent/empty string - for BC formats) rather than as an integer. - * rights events now report the old and new group lists as arrays rather than - as comma-separated lists. - * merge events use new-style formatting. - * delete/event and delete/revision events use new-style formatting. -* The root node and various other nodes will now always be an object in formats - such as json that distinguish between arrays and objects. - * Except for action=opensearch where the spec requires an array. - -=== Action API internal changes in 1.25 === -* ApiHelp has been rewritten to support i18n and paginated HTML output. - Most existing modules should continue working without changes, but should do - the following: - * Add an i18n message "apihelp-{$moduleName}-description" to replace getDescription(). - * Add i18n messages "apihelp-{$moduleName}-param-{$param}" for each parameter - to replace getParamDescription(). If necessary, the settings array returned - by getParams() can use the new ApiBase::PARAM_HELP_MSG key to override the - message. - * Implement getExamplesMessages() to replace getExamples(). -* Modules with submodules (like action=query) must have their submodules - override ApiBase::getParent() to return the correct parent object. -* The 'APIGetDescription' and 'APIGetParamDescription' hooks are deprecated, - and will have no effect for modules using i18n messages. Use - 'APIGetDescriptionMessages' and 'APIGetParamDescriptionMessages' instead. -* Api formatters will no longer be asked to display the help screen on errors. -* ApiMain::getCredits() was removed. The credits are available in the - 'api-credits' i18n message. -* ApiFormatBase has been changed to support i18n and syntax highlighting via - extensions with the new 'ApiFormatHighlight' hook. Core syntax highlighting - has been removed. -* ApiFormatBase now always buffers. Output is done when - ApiFormatBase::closePrinter is called. -* Much of the logic in ApiQueryRevisions has been split into ApiQueryRevisionsBase. -* The 'revids' parameter supplied by ApiPageSet will now count deleted - revisions as "good" if the user has the 'deletedhistory' right. New methods - ApiPageSet::getLiveRevisionIDs() and ApiPageSet::getDeletedRevisionIDs() are - provided to access just the live or just the deleted revids. -* Added ApiPageSet::setGeneratorData() and ApiPageSet::populateGeneratorData() - to allow generators to include data in the action=query result. -* New hooks 'ApiMain::moduleManager' and 'ApiQuery::moduleManager', can be - used for conditional registration of API modules. -* Added ApiBase::lacksSameOriginSecurity() to allow modules to easily check if - the current request was sent with the 'callback' parameter (or any future - method that breaks the same-origin policy). -* Profiling methods in ApiBase are deprecated and no longer need to be called. -* ApiResult was greatly overhauled. See inline documentation for details. -* ApiResult will automatically convert objects to strings or arrays (depending - on whether a __toString() method exists on the object), and will refuse to - add unsupported value types. - * An informal interface, ApiSerializable, exists to override the default - object conversion. -* ApiResult/ApiFormatBase "raw mode" is deprecated. -* ApiFormatXml now assumes defaults and so on instead of throwing errors when - metadata isn't set. -* (T35235) LogFormatter subclasses are now responsible for formatting log event - parameters for the API. -* Many modules have changed result data formats. While this shouldn't affect - clients not using the experimental formatversion=2, code using - ApiResult::getResultData() without the transformations for backwards - compatibility may need updating, as will code that wasn't following the old - conventions for API boolean output. -* The following methods have been deprecated and may be removed in a future - release: - * ApiBase::getDescription - * ApiBase::getParamDescription - * ApiBase::getExamples - * ApiBase::makeHelpMsg - * ApiBase::makeHelpArrayToString - * ApiBase::makeHelpMsgParameters - * ApiBase::getModuleProfileName - * ApiBase::profileIn - * ApiBase::profileOut - * ApiBase::safeProfileOut - * ApiBase::getProfileTime - * ApiBase::profileDBIn - * ApiBase::profileDBOut - * ApiBase::getProfileDBTime - * ApiBase::getResultData - * ApiFormatBase::setUnescapeAmps - * ApiFormatBase::getWantsHelp - * ApiFormatBase::setHelp - * ApiFormatBase::formatHTML - * ApiFormatBase::setBufferResult - * ApiFormatBase::getDescription - * ApiFormatBase::getNeedsRawData - * ApiMain::setHelp - * ApiMain::reallyMakeHelpMsg - * ApiMain::makeHelpMsgHeader - * ApiResult::setRawMode - * ApiResult::getIsRawMode - * ApiResult::getData - * ApiResult::setElement - * ApiResult::setContent - * ApiResult::setIndexedTagName_recursive - * ApiResult::setIndexedTagName_internal - * ApiResult::setParsedLimit - * ApiResult::beginContinuation - * ApiResult::setContinueParam - * ApiResult::setGeneratorContinueParam - * ApiResult::endContinuation - * ApiResult::size - * ApiResult::convertStatusToArray - * ApiQueryImageInfo::getPropertyDescriptions - * ApiQueryLogEvents::addLogParams -* The following classes have been deprecated and may be removed in a future - release: - * ApiQueryDeletedrevs - -=== Languages updated in 1.25 === - -MediaWiki supports over 350 languages. Many localisations are updated -regularly. Below only new and removed languages are listed, as well as -changes to languages because of Bugzilla reports. - -* Languages added: -** awa (अवधी / Awadhi), thanks to translator 1AnuraagPandey; -** bgn (بلوچی رخشانی / Western Balochi), thanks to translators - Baloch Afghanistan, Ibrahim khashrowdi and Rachitrali; -** ses (Koyraboro Senni), thanks to translator Songhay. -* (T66440) Kazakh (kk) wikis should no longer forcefully reset the user's - interface language to kk where unexpected. -* The Chinese conversion table was substantially updated to fix a lot of - bugs and ensure better reading experience for different variants. - -=== Other changes in 1.25 === -* (T45591) Links to MediaWiki.org translatable help were added to indicators, - mostly in special pages. Local custom target titles can be placed in the - relevant '(namespace-X|action name|special page name)-helppage' system - message. Extensions can use the addHelpLink() function to do the same. -* The skin autodiscovery mechanism, deprecated in MediaWiki 1.23, has been - removed. See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for - migration guide for creators and users of custom skins that relied on it. -* Javascript variables 'wgFileCanRotate' and 'wgFileExtensions' now only - available on Special:Upload. -* (T58257) Set site logo from mediawiki.skinning.interface module instead of - inline styles in the HTML. -* Removed ApiQueryUsers::getAutoGroups(). (deprecated since 1.20) -* Removed XmlDumpWriter::schemaVersion(). (deprecated since 1.20) -* Removed LogEventsList::getDisplayTitle(). (deprecated since 1.20) -* Removed Preferences::trySetUserEmail(). (deprecated since 1.20) -* Removed mw.user.name() and mw.user.anonymous() methods. (deprecated since 1.20) -* Removed 'ok' and 'err' parameters in the mediawiki.api modules. (deprecated - since 1.20) -* Removed 'async' parameter from the mw.Api#getCategories() method. (deprecated - since 1.20) -* Removed 'jquery.json' module. (deprecated since 1.24) - Use the 'json' module and global JSON object instead. -* Deprecated OutputPage::readOnlyPage() and OutputPage::rateLimited(). - Also, the former will now throw an MWException if called with one or more - arguments. -* Removed hitcounters and associated code. -* The "temp" zone of the upload respository is now considered private. If it - already exists (such as under the images/ directory), please make sure that - the directory is not web readable (e.g. via a .htaccess file). -* BREAKING CHANGE: In the XML dump format used by Special:Export and - dumpBackup.php, the and tags now apprear before the - tag, instead of after the and tags. - The new schema version is 0.10, the new schema URI is: - https://www.mediawiki.org/xml/export-0.10.xsd -* MWFunction::call() and MWFunction::callArray() were removed, having being - deprecated in 1.22. -* Deprecated the getInternalLinkAttributes, getInternalLinkAttributesObj, - and getInternalLinkAttributes methods in Linker, and removed - getExternalLinkAttributes method, which was deprecated in MediaWiki 1.18. -* Removed Sites class, which was deprecated in 1.21 and replaced by SiteSQLStore. -* Added wgRelevantArticleId to the client-side config, for use on special pages. -* Deprecated the TitleIsCssOrJsPage hook. Superseded by the - ContentHandlerDefaultModelFor hook since MediaWiki 1.21. -* Deprecated the TitleIsWikitextPage hook. Superseded by the - ContentHandlerDefaultModelFor hook since MediaWiki 1.21. -* Changed parsing of variables in schema (.sql) files: -** The substituted values are no longer parsed. (Formerly, several passes - were made for each variable, so depending on the order in which variables - were defined, variables might have been found inside encoded values. This - is no longer the case.) -** Variables are no longer string encoded when the /*$var*/ syntax is used. - If string encoding is necessary, use the '{$var}' syntax instead. -** Variable names must only consist of one or more of the characters - "A-Za-z0-9_". -** In source text of the form '{$A}'{$B}' or `{$A}`{$B}`, where variable A - does not exist yet variable B does, the latter may not be replaced. - However, this difference is unlikely to arise in practice. -* (T67278) RFC, PMID, and ISBN "magic links" must be surrounded by non-word - characters on both sides. -* The FormatAutocomments hook will now receive $pre and $post as booleans, - rather than as strings that must be prepended or appended to $comment. -* (T30950, T31025) RFC, PMID, and ISBN "magic links" can no longer contain - newlines; but they can contain   and other non-newline whitespace. -* The 'mediawiki.action.edit' ResourceLoader module no longer generates the edit - toolbar, which has been moved to a separate 'mediawiki.toolbar' module. If you - relied on this behavior, update your scripts' dependencies. -* HTMLForm's 'vform' display style has been separated to a subclass. Therefore: - * HTMLForm::isVForm() is now deprecated. - * You can no longer do this: - $form = new HTMLForm( … ); - $form->setDisplayFormat( 'vform' ); // throws exception - Instead, do this: - $form = HTMLForm::factory( 'vform', … ); -* Deprecated Revision methods getRawUser(), getRawUserText() and getRawComment(). -* BREAKING CHANGE: mediawiki.user.generateRandomSessionId: - The alphabet of the prior string returned was A-Za-z0-9 and now it is 0-9A-F -* (T87504) Avoid serving SVG background-images in CSS for Opera 12, which - renders them incorrectly when combined with border-radius or background-size. -* Removed maintenance script dumpSisterSites.php. -* DatabaseBase class constructors must be called using the array argument style. - Ideally, DatabaseBase:factory() should be used instead in most cases. -* Deprecated ParserOutput::addSecondaryDataUpdate and ParserOutput::getSecondaryDataUpdates. - This is a hard deprecation, with getSecondaryDataUpdates returning an empty array and - addSecondaryDataUpdate throwing an exception. These functions will be removed in 1.26, - since they interfere with caching of ParserOutput objects. -* Introduced new hook 'SecondaryDataUpdates' that allows extensions to inject custom updates. -* Introduced new hook 'OpportunisticLinksUpdate' that allows extensions to perform - updates when a page is re-rendered. -* EditPage::attemptSave has been modified not to call handleStatus itself and - instead just returns the Status object. Extension calling it should be aware of - this. -* Removed class DBObject. (unused since 1.10) -* wfDiff() is deprecated. -* The -m (maximum replication lag) option of refreshLinks.php was removed. - It had no effect since MediaWiki 1.18 and should be removed from any cron - jobs or similar scripts you may have set up. -* (T85864) The following messages no longer support raw html: redirectto, - thisisdeleted, viewdeleted, editlink, retrievedfrom, version-poweredby-others, - retrievedfrom, thisisdeleted, viewsourcelink, lastmodifiedat, laggedslavemode, - protect-summary-cascade -* All BloomCache related code has been removed. This was largely experimental. -* $wgResourceModuleSkinStyles no longer supports per-module local or remote paths. They - can only be set for the entire skin. -* Removed global function swap(). (deprecated since 1.24) -* Deprecated the ".php5" file extension entry points and the $wgScriptExtension - configuration variable. Refer to the ".php" files instead. If you want - ".php5" URLs to continue to work, set up redirects. In Apache, this can be - done by enabling mod_rewrite and adding the following rules to your - configuration: - - RewriteEngine On - RewriteBase / - RewriteRule ^(.*)\.php5 $1.php [R=301,L] - -* The global importScriptURI and importStylesheetURI functions, as well as the - loadedScripts object, from wikibits.js (deprecated since 1.17) now emit - warnings through mw.log.warn when accessed. - - -== Compatibility == - -MediaWiki 1.25 requires PHP 5.3.3 or later. There is experimental support for -HHVM 3.3.0. - -MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but -support for them is somewhat less mature. There is experimental support for -Oracle and Microsoft SQL Server. - -The supported versions are: - -* MySQL 5.0.3 or later -* PostgreSQL 8.3 or later -* SQLite 3.3.7 or later -* Oracle 9.0.1 or later -* Microsoft SQL Server 2005 (9.00.1399) - -== Upgrading == - -1.25 has several database changes since 1.24, and will not work without schema -updates. Note that due to changes to some very large tables like the revision -table, the schema update may take quite long (minutes on a medium sized site, -many hours on a large site). - -If upgrading from before 1.11, and you are using a wiki as a commons -repository, make sure that it is updated as well. Otherwise, errors may arise -due to database schema changes. - -If upgrading from before 1.7, you may want to run refreshLinks.php to ensure -new database fields are filled with data. - -If you are upgrading from MediaWiki 1.4.x or earlier, you should upgrade to -1.5 first. The upgrade script maintenance/upgrade1_5.php has been removed -with MediaWiki 1.21. - -Don't forget to always back up your database before upgrading! - -See the file UPGRADE for more detailed upgrade instructions. - -For notes on 1.24.x and older releases, see HISTORY. - -== Online documentation == - -Documentation for both end-users and site administrators is available on -MediaWiki.org, and is covered under the GNU Free Documentation License (except -for pages that explicitly state that their contents are in the public domain): - - https://www.mediawiki.org/wiki/Documentation - -== Mailing list == - -A mailing list is available for MediaWiki user support and discussion: - - https://lists.wikimedia.org/mailman/listinfo/mediawiki-l - -A low-traffic announcements-only list is also available: - - https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce - -It's highly recommended that you sign up for one of these lists if you're -going to run a public MediaWiki, so you can be notified of security fixes. - -== IRC help == - -There's usually someone online in #mediawiki on irc.freenode.net. diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26 index 6f1120e42c..af9e9d2b64 100644 --- a/RELEASE-NOTES-1.26 +++ b/RELEASE-NOTES-1.26 @@ -42,17 +42,31 @@ changes to languages because of Bugzilla reports. * ChangeTags::tagDescription() will return false if the interface message for the tag is disabled. * Added PageHistoryPager::doBatchLookups hook. +* Added ParserCacheSaveComplete to ParserCache * supportsDirectEditing and supportsDirectApiEditing methods added to -ContentHandler, to provide a way for ApiEditPage and EditPage to check -if direct editing of content is allowed. These methods return false, -by default for the ContentHandler base class and true for TextContentHandler -and it's derivative classes (everything in core). For Content types that -do not support direct editing, an alternative mechanism should be provided -for editing, such as action overrides or specific api modules. + ContentHandler, to provide a way for ApiEditPage and EditPage to check + if direct editing of content is allowed. These methods return false, + by default for the ContentHandler base class and true for TextContentHandler + and it's derivative classes (everything in core). For Content types that + do not support direct editing, an alternative mechanism should be provided + for editing, such as action overrides or specific api modules. * mediaWiki.confirmCloseWindow now returns an object of functions, instead of -one function. The callback can't be called directly any more. The callback function -is replaced with confirmCloseWindow.release(). + one function. The callback can't be called directly any more. The callback + function is replaced with confirmCloseWindow.release(). * Removed maintenance script deleteImageMemcached.php. +* MWFunction::newObj() was removed (deprecated in 1.25). + ObjectFactory::getObjectFromSpec() should be used instead. +* The parser will no longer randomize the string it uses to mark the place of + items that were stripped during parsing. It will use a fixed string instead. + This causes the parser to re-use the regular expressions it uses to search + and replace markers rather than generate novel expressions on each parse. + Re-using regular expressions will improve performance on HHVM and the + forthcoming PHP 7. The interfaces changes accompanying this change are: + - Parser::getRandomString() and Parser::uniqPrefix() have been deprecated. + - The $uniq_prefix argument for Parser::extractTagsAndParams() and the + $prefix argument for StripState::_construct() are deprecated and their + value is ignored. + == Compatibility == diff --git a/api.php b/api.php index a9e56830f3..af7c452550 100644 --- a/api.php +++ b/api.php @@ -88,20 +88,9 @@ if ( $processor ) { $processor->execute(); } -if ( function_exists( 'fastcgi_finish_request' ) ) { - fastcgi_finish_request(); -} - -JobQueueGroup::pushLazyJobs(); - -// Execute any deferred updates -DeferredUpdates::doUpdates(); - // Log what the user did, for book-keeping purposes. $endtime = microtime( true ); -wfLogProfilingData(); - // Log the request if ( $wgAPIRequestLog ) { $items = array( @@ -130,7 +119,5 @@ if ( $wgAPIRequestLog ) { wfDebug( "Logged API request to $wgAPIRequestLog\n" ); } -// Shut down the database. foo()->bar() syntax is not supported in PHP4: we won't ever actually -// get here to worry about whether this should be = or =&, but the file has to parse properly. -$lb = wfGetLBFactory(); -$lb->shutdown(); +$mediawiki = new MediaWiki(); +$mediawiki->doPostOutputShutdown( 'fast' ); diff --git a/autoload.php b/autoload.php index f8b1681638..612bc963ce 100644 --- a/autoload.php +++ b/autoload.php @@ -708,7 +708,6 @@ $wgAutoloadLocalClasses = array( 'MWDocGen' => __DIR__ . '/maintenance/mwdocgen.php', 'MWException' => __DIR__ . '/includes/exception/MWException.php', 'MWExceptionHandler' => __DIR__ . '/includes/exception/MWExceptionHandler.php', - 'MWFunction' => __DIR__ . '/includes/utils/MWFunction.php', 'MWHookException' => __DIR__ . '/includes/Hooks.php', 'MWHttpRequest' => __DIR__ . '/includes/HttpFunctions.php', 'MWMemcached' => __DIR__ . '/includes/objectcache/MemcachedClient.php', @@ -826,6 +825,7 @@ $wgAutoloadLocalClasses = array( 'ObjectFileCache' => __DIR__ . '/includes/cache/ObjectFileCache.php', 'OldChangesList' => __DIR__ . '/includes/changes/OldChangesList.php', 'OldLocalFile' => __DIR__ . '/includes/filerepo/file/OldLocalFile.php', + 'OOUIHTMLForm' => __DIR__ . '/includes/htmlform/OOUIHTMLForm.php', 'OracleInstaller' => __DIR__ . '/includes/installer/OracleInstaller.php', 'OracleUpdater' => __DIR__ . '/includes/installer/OracleUpdater.php', 'OrphanStats' => __DIR__ . '/maintenance/storage/orphanStats.php', @@ -995,6 +995,7 @@ $wgAutoloadLocalClasses = array( 'ResourceLoaderFilePath' => __DIR__ . '/includes/resourceloader/ResourceLoaderFilePath.php', 'ResourceLoaderImage' => __DIR__ . '/includes/resourceloader/ResourceLoaderImage.php', 'ResourceLoaderImageModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderImageModule.php', + 'ResourceLoaderJqueryMsgDataModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderJqueryMsgDataModule.php', 'ResourceLoaderLanguageDataModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderLanguageDataModule.php', 'ResourceLoaderLanguageNamesModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderLanguageNamesModule.php', 'ResourceLoaderModule' => __DIR__ . '/includes/resourceloader/ResourceLoaderModule.php', diff --git a/composer.json b/composer.json index 2f6cc42467..9222aa4d35 100644 --- a/composer.json +++ b/composer.json @@ -25,14 +25,14 @@ "psr/log": "1.0.0", "wikimedia/cdb": "1.0.1", "wikimedia/assert": "0.2.2", - "wikimedia/composer-merge-plugin": "1.0.0", + "wikimedia/composer-merge-plugin": "1.1.0", "wikimedia/utfnormal": "1.0.2", "zordius/lightncandy": "0.21" }, "require-dev": { "jakub-onderka/php-parallel-lint": "~0.8", "justinrainbow/json-schema": "~1.3", - "phpunit/phpunit": "~4.5", + "phpunit/phpunit": "3.7.37", "mediawiki/mediawiki-codesniffer": "0.1.0" }, "suggest": { @@ -50,7 +50,7 @@ }, "scripts": { "lint": "parallel-lint --exclude vendor", - "phpcs": "phpcs $PHPCS_ARGS -s --standard=vendor/mediawiki/mediawiki-codesniffer/MediaWiki --ignore=vendor --encoding=utf-8 --extensions=php,php5,inc,sample", + "phpcs": "phpcs $PHPCS_ARGS -s --standard=vendor/mediawiki/mediawiki-codesniffer/MediaWiki --ignore=vendor,node_modules --encoding=utf-8 --extensions=php,php5,inc,sample", "test": [ "composer lint", "composer phpcs" diff --git a/docs/extension.schema.json b/docs/extension.schema.json index 3b75b726e4..c4c716b660 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -3,6 +3,11 @@ "description": "MediaWiki extension.json schema", "type": "object", "properties": { + "manifest_version": { + "type": "integer", + "description": "Version of the extension.json schema the extension.json file is in.", + "required": true + }, "name": { "type": "string", "description": "The extension's canonical name.", @@ -15,19 +20,7 @@ "type": { "type": "string", "description": "The extension's type, as an index to $wgExtensionCredits.", - "default": "other", - "enum": [ - "api", - "antispam", - "datavalues", - "media", - "parserhook", - "semantic", - "skin", - "specialpage", - "variable", - "other" - ] + "default": "other" }, "author": { "type": [ @@ -37,8 +30,7 @@ "description": "Extension's authors.", "items": { "type": "string" - }, - "additionalItems": false + } }, "version": { "type": "string", @@ -297,12 +289,12 @@ } } }, - "ResourceLoaderModules": { + "ResourceModules": { "type": "object", "description": "ResourceLoader modules to register", "additionalProperties": false, "patternProperties": { - "^[a-zA-Z0-9\\.]+$": { + "^[a-zA-Z0-9-\\.]+$": { "type": "object", "description": "A single ResourceLoader module descriptor", "properties": { @@ -319,7 +311,7 @@ "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath" }, "scripts": { - "type": "array", + "type": ["string", "array"], "description": "Scripts to always include (array of file paths)", "items": { "type": "string" @@ -356,28 +348,28 @@ } }, "debugScripts": { - "type": "array", + "type": ["string", "array"], "description": "Scripts to include in debug contexts", "items": { "type": "string" } }, "loaderScripts": { - "type": "array", + "type": ["string", "array"], "description": "Scripts to include in the startup module", "items": { "type": "string" } }, "dependencies": { - "type": "array", + "type": ["string", "array"], "description": "Modules which must be loaded before this module", "items": { "type": "string" } }, "styles": { - "type": "array", + "type": ["string", "array", "object"], "description": "Styles to always load", "items": { "type": "string" @@ -399,7 +391,7 @@ } }, "messages": { - "type": "array", + "type": ["string", "array"], "description": "Messages to always load", "items": { "type": "string" diff --git a/docs/hooks.txt b/docs/hooks.txt index e15520c19a..131986a7a6 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2238,6 +2238,14 @@ $section: the section number, zero-based, but section 0 is usually empty &$sectionContent: ref to the content of the section. modify this. $showEditLinks: boolean describing whether this section has an edit link +'ParserCacheSaveComplete': Called after a ParserOutput has been committed to +the parser cache. +$parserCache: ParserCache object $parserOutput was stored in +$parserOutput: ParserOutput object that was stored +$title: Title of the page that was parsed to generate $parserOutput +$popts: ParserOptions used for generating $parserOutput +$revId: ID of the revision that was parsed to create $parserOutput + 'ParserTestParser': Called when creating a new instance of Parser in tests/parser/parserTest.inc. $parser: Parser object created diff --git a/img_auth.php b/img_auth.php index 22fd401452..b26e6a5ec9 100644 --- a/img_auth.php +++ b/img_auth.php @@ -46,11 +46,9 @@ $wgArticlePath = false; # Don't let a "/*" article path clober our action path $wgActionPaths = array( "$wgUploadPath/" ); wfImageAuthMain(); -wfLogProfilingData(); -// Commit and close up! -$factory = wfGetLBFactory(); -$factory->commitMasterChanges(); -$factory->shutdown(); + +$mediawiki = new MediaWiki(); +$mediawiki->doPostOutputShutdown( 'fast' ); function wfImageAuthMain() { global $wgImgAuthUrlPathMap; diff --git a/includes/EditPage.php b/includes/EditPage.php index b0da562394..e88baafe56 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1958,11 +1958,13 @@ class EditPage { if ( $this->changeTags && isset( $doEditStatus->value['revision'] ) ) { // If a revision was created, apply any change tags that were requested - ChangeTags::addTags( - $this->changeTags, - isset( $doEditStatus->value['rc'] ) ? $doEditStatus->value['rc']->mAttribs['rc_id'] : null, - $doEditStatus->value['revision']->getId() - ); + $addTags = $this->changeTags; + $revId = $doEditStatus->value['revision']->getId(); + // Defer this both for performance and so that addTags() sees the rc_id + // since the recentchange entry addition is deferred first (bug T100248) + DeferredUpdates::addCallableUpdate( function() use ( $addTags, $revId ) { + ChangeTags::addTags( $addTags, null, $revId ); + } ); } return $status; diff --git a/includes/Import.php b/includes/Import.php index c2fae30952..ee57a9e01e 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -1570,8 +1570,7 @@ class WikiRevision { } // avoid memory leak...? - $linkCache = LinkCache::singleton(); - $linkCache->clear(); + Title::clearCaches(); $page = WikiPage::factory( $this->title ); $page->loadPageData( 'fromdbmaster' ); diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index ea91470e85..f2bd6ba569 100644 --- a/includes/MWTimestamp.php +++ b/includes/MWTimestamp.php @@ -199,42 +199,19 @@ class MWTimestamp { * * @since 1.20 * @since 1.22 Uses Language::getHumanTimestamp to produce the timestamp + * @deprecated since 1.26 Use Language::getHumanTimestamp directly * - * @param MWTimestamp|null $relativeTo The base timestamp to compare to - * (defaults to now). - * @param User|null $user User the timestamp is being generated for (or null - * to use main context's user). - * @param Language|null $lang Language to use to make the human timestamp - * (or null to use main context's language). + * @param MWTimestamp|null $relativeTo The base timestamp to compare to (defaults to now) + * @param User|null $user User the timestamp is being generated for (or null to use main context's user) + * @param Language|null $lang Language to use to make the human timestamp (or null to use main context's language) * @return string Formatted timestamp */ - public function getHumanTimestamp( MWTimestamp $relativeTo = null, - User $user = null, Language $lang = null - ) { - if ( $relativeTo === null ) { - $relativeTo = new self(); - } - if ( $user === null ) { - $user = RequestContext::getMain()->getUser(); - } + public function getHumanTimestamp( MWTimestamp $relativeTo = null, User $user = null, Language $lang = null ) { if ( $lang === null ) { $lang = RequestContext::getMain()->getLanguage(); } - // Adjust for the user's timezone. - $offsetThis = $this->offsetForUser( $user ); - $offsetRel = $relativeTo->offsetForUser( $user ); - - $ts = ''; - if ( Hooks::run( 'GetHumanTimestamp', array( &$ts, $this, $relativeTo, $user, $lang ) ) ) { - $ts = $lang->getHumanTimestamp( $this, $relativeTo, $user ); - } - - // Reset the timezone on the objects. - $this->timestamp->sub( $offsetThis ); - $relativeTo->timestamp->sub( $offsetRel ); - - return $ts; + return $lang->getHumanTimestamp( $this, $relativeTo, $user ); } /** diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 58c49f4bac..d03b76af2e 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -433,37 +433,68 @@ class MediaWiki { // Bug 62091: while exceptions are convenient to bubble up GUI errors, // they are not internal application faults. As with normal requests, this // should commit, print the output, do deferred updates, jobs, and profiling. - wfGetLBFactory()->commitMasterChanges(); + $this->doPreOutputCommit(); $e->report(); // display the GUI error } } catch ( Exception $e ) { MWExceptionHandler::handleException( $e ); } - if ( function_exists( 'register_postsend_function' ) ) { - // https://github.com/facebook/hhvm/issues/1230 - register_postsend_function( array( $this, 'postSendUpdates' ) ); - } elseif ( function_exists( 'fastcgi_finish_request' ) ) { - fastcgi_finish_request(); - $this->postSendUpdates(); - } else { - $this->postSendUpdates(); - } + $this->doPostOutputShutdown( 'normal' ); + } + + /** + * This function commits all DB changes as needed before + * the user can receive a response (in case commit fails) + * + * @since 1.26 + */ + public function doPreOutputCommit() { + // Either all DBs should commit or none + ignore_user_abort( true ); + wfGetLBFactory()->commitMasterChanges(); } /** * This function does work that can be done *after* the * user gets the HTTP response so they don't block on it * + * @param string $mode Use 'fast' to always skip job running * @since 1.26 */ - public function postSendUpdates() { - try { - JobQueueGroup::pushLazyJobs(); - $this->triggerJobs(); - $this->restInPeace(); - } catch ( Exception $e ) { - MWExceptionHandler::handleException( $e ); + public function doPostOutputShutdown( $mode = 'normal' ) { + // Show profiling data if enabled + Profiler::instance()->logDataPageOutputOnly(); + + $that = $this; + $callback = function () use ( $that, $mode ) { + try { + // Assure deferred updates are not in the main transaction + wfGetLBFactory()->commitMasterChanges(); + // Run jobs occasionally, if enabled + if ( $mode === 'normal' ) { + $that->triggerJobs(); + } + // Do deferred updates and job insertion and final commit + $that->restInPeace(); + } catch ( Exception $e ) { + MWExceptionHandler::handleException( $e ); + } + }; + + if ( function_exists( 'register_postsend_function' ) ) { + // https://github.com/facebook/hhvm/issues/1230 + register_postsend_function( $callback ); + } else { + if ( function_exists( 'fastcgi_finish_request' ) ) { + fastcgi_finish_request(); + } else { + // Either all DB and deferred updates should happen or none. + // The later should not be cancelled due to client disconnect. + ignore_user_abort( true ); + } + + $callback(); } } @@ -602,16 +633,13 @@ class MediaWiki { // Actually do the work of the request and build up any output $this->performRequest(); - // Either all DB and deferred updates should happen or none. - // The later should not be cancelled due to client disconnect. - ignore_user_abort( true ); // Now commit any transactions, so that unreported errors after - // output() don't roll back the whole DB transaction - wfGetLBFactory()->commitMasterChanges(); + // output() don't roll back the whole DB transaction and so that + // we avoid having both success and error text in the response + $this->doPreOutputCommit(); // Output everything! $this->context->getOutput()->output(); - } /** @@ -644,7 +672,7 @@ class MediaWiki { * to run a specified number of jobs. This registers a callback to cleanup * the socket once it's done. */ - protected function triggerJobs() { + public function triggerJobs() { $jobRunRate = $this->config->get( 'JobRunRate' ); if ( $jobRunRate <= 0 || wfReadOnly() ) { return; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 770cf47f6e..a3a5a2730a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -591,6 +591,19 @@ class OutputPage extends ContextSource { * @return array Array of module names */ public function getModuleStyles( $filter = false, $position = null ) { + // T97420 + $resourceLoader = $this->getResourceLoader(); + + foreach ( $this->mModuleStyles as $val ) { + $module = $resourceLoader->getModule( $val ); + + if ( $module instanceof ResourceLoaderModule && $module->isPositionDefault() ) { + $warning = __METHOD__ . ': style module should define its position explicitly: ' . $val . ' ' . get_class( $module ); + wfDebugLog( 'resourceloader', $warning ); + wfLogWarning( $warning ); + } + } + return $this->getModules( $filter, $position, 'mModuleStyles' ); } @@ -3008,11 +3021,17 @@ class OutputPage extends ContextSource { // Scripts "only" requests marked for bottom inclusion // If we're in the , use load() calls rather than