Commit graph

112 commits

Author SHA1 Message Date
Jakub Vrana
7f67fa7fc7 Delete unused variable
Found by PHPStan.

Change-Id: I416069e4199e1cd3cf7a98a32cc1cb09c1525093
2018-12-02 19:21:44 +01:00
Bill Pirkle
085b6e4787 Replace WikiExporter streaming (unbuffered) mode with batched queries
WikiExporter allows streaming mode, using unbuffered mode on
the database connection. We are moving away from this technique.
Instead, do multiple normal queries and retrieve the
information in batches.

Bug: T203424
Change-Id: I582240b67c91a8be993a68c23831c9d86617350e
2018-09-28 10:55:05 -05:00
Bill Pirkle
7592431809 Logging related to WikiExport cleanup and changes in T203424
T203424 (Replace the WikiExporter backup dump streaming mode with batched queries)
removed some outdated database usage techniques.  While making these
changes, we saw some potential cleanup opportunities related
to the $history parameter to WikiExporter.  Additional logging will
inform whether we can do the additional cleanup.  If so, it can be
performed under a separate task.

Bug: T203424
Change-Id: Ic4cef23520795665c89e03f325b891346d1340a9
2018-09-20 09:54:06 -05:00
Umherirrender
150f1a3991 Swap arguments of Title::makeName to fix Special:Export
Follows-up 415243600b.

Bug: T202817
Change-Id: Ica850230a5d70ae70436510811c0fed04bb995bb
2018-08-26 18:10:59 +00:00
Umherirrender
415243600b Use Title::makeName in Special:Export to simplify code
Also adjust param docs

Change-Id: Ia938b38c86da25e73b91a55506d660bc9ca9384f
2018-08-18 03:42:16 +00:00
Aryeh Gregor
90d4f56fe4 Mass conversion of $wgContLang to service
Brought to you by vim macros.

Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
2018-08-11 22:44:29 -06:00
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00:00
Umherirrender
3124a990a2 Use ::class to resolve class names in includes files
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
2018-01-27 20:34:29 +01:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00
Ori Livneh
a603ae73a7 Fix letter-case of several namespace and class names
'Mediawiki\Widget\SelectWithInputWidget' is the only one that shows up
in the logs, but I tidied up a few others I came across.

Change-Id: I700dec858007a8013e6d7b9e37ddf518f223d8b7
2017-10-14 21:43:05 -04:00
WMDE-Fisch
6df9ed1ad6 update mediawiki-codesniffer to 0.11.0 and fix issues
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case  passing by reference

Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
2017-08-11 22:27:51 +02:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
James D. Forrester
232bbccbad includes/specials: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: Ic878feaea72893a1c47ea79ac284e581209e1731
2017-02-28 00:18:28 +00:00
WMDE-Fisch
ae3419f532 Replace some of the deprecated wfGetLBFactory() calls
Change-Id: I87aa0ebe273706438f1634167de8c60f51432878
2017-02-07 14:41:09 +01:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Bartosz Dziewoński
fba68fd23b SpecialExport: Add 'hide-if' to form definition
Change-Id: Ic03620849f863bc4e21347984f84c532c189c4ea
2016-08-22 15:56:42 +00:00
Andrew H
c71eda1ef5 Add X-Robots-Tag header to Special:Export dumps
Adds "X-Robots-Tag: noindex,nofollow" header to Special:Export
dumps so that dumps are not indexed by search engines.

Bug: T91363
Change-Id: Ia96ec40ff185fdfd024312ee3cfe3c736ba8d806
2016-04-24 17:59:27 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
This, that and the other
61b0b77635 fix hardcoded limit on titles in Special:Export
In Special:Export if you enter a category in the "Add pages from
category" textbox, there was a hardcoded limit of 5000 page titles in
the function getPagesFromCategory().

The same is true for a similar function fetching pages by namespace
instead of category, function getPagesFromNamespace().

I have a couple of wikis where we wish to export a nummber of pages
exceeding 5000, so this is inconvenient. In this commit, I have
introduced one new global configuration variable: $wgExportPagelistLimit.

This new configuration variable has had its default set in
includes/DefaultSettings.php to the values the two affected functions
were hardcoded to prior to this patch; 5000 in both instances.

This way, I can adjust the number of pages returned in the
Special:Export page by adjusting the above new variable in
LocalSettings.php.

Change-Id: I6ca9e26eb6bc4a7a2bafd73b9460f445940c8ecb
2016-02-02 02:20:32 +00:00
Florian
6e3b784bf5 Convert Special:Export to OOUI
Bug: T117753
Change-Id: I974e5b2daefd52cc6c3ba75bc0752492fb86c488
2016-01-02 16:25:35 +00:00
PranavK
15b9bdae33 Removed unnecessary blank line in Special:Export page
Bug: T103870
Change-Id: I5b314ef9204ca33d851a9fe88477d0be427e5199
2015-12-10 17:19:17 +05:30
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
jeroendedauw
1ad788ee03 Remove commented out code in SpecialExport
The removed code was about exporting/importing image information,
which is not possible at the moment, but also nobody seems to work on this.

Change-Id: Ie10d3bc23454ca797f41bd12c4e05360233978a2
2015-09-16 16:39:20 +00:00
umherirrender
70f3afd548 Remove unneeded empty lines at begin of if/else/foreach body
An if body must not begin with an empty line

Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271
2015-06-19 20:05:45 +02:00
Florian
fd10cd5b95 Use HTMLForm for Special:Export
* Transform all input fields to use HtmlForm as preparation for enabling
  MediaWiki UI eveywhere.
* Remove protected whitespace for HTMLCheckField (adds empty line to div-layout)
* Add a new HTMLForm input field "Text with Button" and "Namespaceselector with Button"

Bug: T73434
Change-Id: I53cc019c3ca94cec8f3c05500d0c604c1af7f688
2015-06-14 16:48:26 +00:00
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Federico Leva
8d08910bfa Add help link for 8 more special pages
* Links can now be customised on-wiki via system message:
  e928d5bdd0
* Most help pages chosen here are good for any MediaWiki install
  and have been imported on MediaWiki.org. Their license has been
  noted in the appropriate template, only future contributions
  will be in public domain (CC-0) unless we reach old authors.
  An update/discussion was opened at the project talk:
  https://www.mediawiki.org/wiki/Project_talk:PD_help
* The 6 pages on MediaWiki.org have been marked for translation;
  import of previous translations is ongoing. 2 pages are left on Meta
  because importing translatable pages with all translation units may
  be overkill.

Bug: T45591
Change-Id: I5dd91a0b7233556f2da06b65205fee72ea65a55f
2015-05-15 11:25:27 +00:00
ayush_garg
c14edb6271 Export: Preloading the category name through a URL parameter
Bug: T88683
Change-Id: Iff7d4c1e7138c5160dbaa7b2455695837026d6c1
2015-02-22 12:58:44 +00:00
addshore
ec2ead58bb Remove unused globals
These were missed in I4a87a7007f4adc2ab47be1207f1a04a5ccd31323

Change-Id: I1fc0435c1cd359a30cb1a9f5f07ebadd6e14bcf1
2014-08-04 16:26:19 +00:00
Kunal Mehta
ac19499d44 SpecialExport: Use Config instead of globals
Change-Id: I4a87a7007f4adc2ab47be1207f1a04a5ccd31323
2014-08-03 15:10:25 -07:00
umherirrender
768ac15c70 Cleanup some docs (includes/[s-z])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: Ie419638e909a47aa72a274043604247830ee1a81
2014-07-24 19:43:44 +02:00
Siebrand Mazeland
2c10a13c64 Pass phpcs-strict on includes/specials/ (2/3)
Change-Id: Ide979e5b948115afcec59d929516411c2e8346ae
2014-05-10 14:17:32 +00:00
umherirrender
f971300427 Fixed some @params documentation (includes/[specialpage|specials])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Icf6f36bb53322b39cd5c89523dbd0e4ab10b9ec9
2014-04-19 10:16:52 +02:00
umherirrender
65a4ae9fe9 Change Title::getInterwiki() in conditions to Title::isExternal()
Change-Id: Icce26e6194ae96f262029554e05b49117d5e112e
2014-01-02 11:59:10 +01:00
Kunal Mehta
bc798535fd Deprecate SpecialPage::getTitle
Callers should use SpecialPage::getPageTitle, which is
exactly identical.

This is so that in the future we can turn SpecialPage
into a ContextSource, which requires getTitle to return
getContext()->getTitle.

Change-Id: Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40
2013-12-24 12:53:11 -08:00
Siebrand Mazeland
87ec7ad22e Update formatting
Change-Id: I0e334d910a311f067276215b6bff94cd814fc3b3
2013-04-20 10:02:19 +02:00
Siebrand Mazeland
cc6425fc95 Update/fix docs
Change-Id: Ifa3cfc6fe38ea45e70b50683c36e7cbf3bb4ef82
2013-04-12 20:16:22 +00:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
96a5486ed0 Add SpecialPage::getGroupName and use it
Having all group mapping for Special:SpecialPages in the global
$wgSpecialPageGroups is not a good OO style.
Created a method SpecialPage::getGroupName, which than can be overridden
by each subclasses to the featured group name.

Added also SpecialPage::getFinalGroupName to get the groupname on
Special:SpecialPages to handle the customization and
to keep $wgSpecialPageGroups for b/c

Change-Id: I1de3a186f0a59ec5ecb8996c5f805cf164e9637f
2013-03-07 21:15:54 +01:00
IAlex
3f92a5672e Merge "remove space before semicolon" 2013-02-10 12:51:02 +00:00
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
48cd72819e fix some spacing
Change-Id: Ia9650be8b791fd2f0ccbc099436918a9d12d9968
2013-02-04 20:04:26 +00:00
umherirrender
85d8ee1f87 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
2012-10-10 20:14:40 +02:00
umherirrender
aff21af9ae Allow aliased field names with separated syntax
This introduce the syntax from aliased table names for aliased field
names into the abstract database layer:

array( 'alias' => 'field' ) gives 'field AS alias'

This patch also includes changes to query pages, api and some more
places to show, how the new syntax looks in "production".

This allow us to remove the "AS" for Non-PostgreSQL databases, if we
want that.

Change-Id: I5f0de1c2f29092c173aec3de93ffdef436799e8d
2012-08-15 15:16:09 +02:00
Christian Aistleitner
75b7b09975 Stop PHP notices fouling up XML, when exporting all pages
Change-Id: I330fd34daeb2ad82d8d8a63b0ef2cb11f52f1170
2012-03-30 23:01:12 +02:00
Alexandre Emsenhuber
f267f37320 Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since the former now throws deprecation warnings... 2012-03-19 12:30:52 +00:00
Alexandre Emsenhuber
64131c9667 Use local context to get messages 2012-02-23 19:57:42 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00