Commit graph

23 commits

Author SHA1 Message Date
Brian Wolff
b89e3dd182 Follow-up e33d6f45a. Fix some mistakes w/ limit on QueryPage
Fix some rather embarrassing mistakes. See comments on e33d6f45a.

Also change the behaviour when someone sets an offset higher than
max allowed. Returning a page with 0 results and broken prev/next
links is poor UI imo.

Change-Id: Ibfc983675ae0c600eeccd5e361550e9b5f96f5fd
2016-03-03 15:53:55 -05: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
Ricordisamoa
0455368c0c Stop doing $that = $this in includes/specialpage
Closures support $this as of PHP 5.4

Change-Id: Ib586150a50751873e9c3d12239f6ff8adedf70af
2016-02-11 00:29:22 +01:00
Marius Hoch
08548cbf39 Slightly simplify QueryPage::outputResults
By removing/ deprecating unused things.

Change-Id: Ib9f7439eeeb261a60903eb23f13c65038ebe4945
2016-01-03 20:46:20 +01:00
Aaron Schulz
3ab0c7d4d7 Added IDatabase::doAtomicSection() convenience method
This can replace startAtomic/endAtomic pairs.

Bug: T122115
Change-Id: I01c8e4773ec2b42dbe87a5508a10b997be103c11
2015-12-28 23:11:56 +00:00
Brian Wolff
e33d6f45a4 Make query pages not accept offset > 10000 in miser mode
Most query pages use LIMIT/OFFSET paging, which is inefficient
if someone puts an offset of a billion. Add a limit for the
max offset size that will be respected.

Bug: T107265
Change-Id: I422f9e446d1ee1aebb4057234c829192cf44b953
2015-11-03 17:03:50 -07:00
Aaron Schulz
0dbc4fc2e0 Removed used of resultObject() in QueryPage
Change-Id: I7aa6902a7e1a0c93e28b209de995976d5891cdfb
2015-09-26 10:54:43 -07:00
Thiemo Mättig
a5c9c9607e Add public keywords to the QueryPage base class
A lot more methods do not have visibility keywords. Some probably
should be private, a lot need to be protected, but all this will be
a breaking change. In this patch I'm focusing on methods that are
already used as public methods. The added public keyword is not a
breaking change because it's the default anyway.

Change-Id: I52e34209557b00f97a4e68250afbeb7647b64146
2015-07-18 14:51:07 -05:00
daniel
9f34e31d33 Allow limit and offset to be restricted in subclasses of QueryPage.php
Change-Id: Ib54b50619a0f412e53f92d48821221a243f19756
2015-06-18 19:51:10 +00:00
Vivek Ghaisas
9f5b6f5aeb Fix whitespace issues around parentheses
Fix issues found by MediaWiki.WhiteSpace.SpaceyParenthesis sniff.

Bug: T102617
Change-Id: Iec7f71e64081659fba373ec20d9d2006306a98f4
2015-06-16 22:14:02 +03:00
Jack Phoenix
37bab4a45a Allow QueryPage subclasses to use a different "no results" message than "specialpage-empty"
Child classes wishing to show a different message, such as wikiHow's
NewArticleBoost extension, need to override showEmptyText() to display
their custom message via the appropriate OutputPage method(s).

Change-Id: If488e2c81b225eb651e52bcca0fea08b8e685286
2015-05-03 02:18:43 +03:00
Aaron Schulz
f57044aa87 Made QueryPage::preprocessResults also use the vslow group
Change-Id: If5893ef9e2a18684c8cd1ce1b6149742b392a3c3
2015-04-10 02:31:35 -07:00
Kevin Israel
74faccfa26 Change case of class names to match declarations
Found by running tests under a version of PHP patched to report
case mismatches as E_STRICT errors.

User classes:
* MIMEsearchPage
* MostlinkedTemplatesPage
* SpecialBookSources
* UnwatchedpagesPage

Internal classes:
* DOMXPath
* stdClass
* XMLReader

Did not change:
* testautoLoadedcamlCLASS
* testautoloadedserializedclass

Change-Id: Idc8caa82cd6adb7bab44b142af2b02e15f0a89ee
2014-12-19 16:01:26 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Aaron Schulz
a4a44f7731 Changed some DatabaseBase type hints to IDatabase
Change-Id: I1158c71f110b140473f56d5cbe352da1f4513ad9
2014-12-09 01:05:22 -08:00
Chad Horohoe
90d90dad6e Remove hitcounters and associated code
The hitcounter implementation in MediaWiki is flawed
and needs removal. For proper metrics, it is suggested to use
something like Piwik or Google Analytics.

RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: I0e5006a7e8a09c800f8fa4effa9399e8afdd7a57
2014-10-20 13:01:55 -07:00
Kevin Israel
3daf61814d Remove redundant $db->resultObject() calls
DatabaseBase::query() already passes the value returned by the
database driver (usually an object or resource for SELECT queries)
through $db->resultObject(). There is no need to pass it through
the method a second time to get a ResultWrapper.

Change-Id: I5d34ab2bffb7f236d2f824b4ef0e8670f89d4599
2014-09-19 20:35:55 +00:00
jenkins-bot
30646afb36 Merge "Add Special:MediaStatistics page for file type stats" 2014-09-19 08:03:42 +00:00
Brian Wolff
e632eba946 Add Special:MediaStatistics page for file type stats
There used to be a bot on commons that did this, but it broke, and
this seems like the sort of thing that should be built in to
MediaWiki anyhow.

In order to do this, it abuses the querycache table somewhat
(Storing non-titles things in the title column).

Also changes the link on Special:Statistics for number of
uploads to link to new page. It seemed appropriate to link
to more detailed statistics instead of to Special:ListFiles.

Change-Id: I9ab768584b02a32b450d5f3981ff775ee07fecfa
2014-09-18 14:28:57 -03:00
Aaron Schulz
8abeaaf24a Made QueryPage use startAtomic() for trx handling
Change-Id: I0a2e8e05c96dbc582ecc045876497737020f441a
2014-09-16 17:29:19 -07:00
Kunal Mehta
21424161ba includes/specialpage: Use Config instead of globals (almost!)
SpecialPageFactory is very scary and will need some refactoring
to be de-globalified.

Change-Id: I1de6301e195d94faddf134a53b456029b1079ec8
2014-08-07 18:28:22 +01:00
umherirrender
e262d63d3e Remove return value from QueryPage::execute
The parent SpecialPage::execute also has no return and not all return
statements in QueryPage::execute actual return a value

Change-Id: If7a38ca5ed1107b6a5a740acae54295534950696
2014-07-27 15:48:19 +00:00
Kevin Israel
ffa3518ed5 Move QueryPage and abstract subclasses to specialpage folder
... now that f508561f7b ("Moved $wgQueryPages stuff out of the global
scope and into a function") has been merged, which eliminated hardcoding
of the pathname except in the AutoLoader.

WantedQueryPage is moved to a separate file.

Bug: 60445
Change-Id: If2019492722083819b82afa6302670b94b181098
2014-06-24 20:03:21 -04:00
Renamed from includes/QueryPage.php (Browse further)