Commit graph

26 commits

Author SHA1 Message Date
Umherirrender
e89bcc78cb Fix caller name in File::getDescriptionText
Seeing {closure} in the logs as caller is not helpful

Change-Id: I415e2bb691650bc34adfb750c7a70a5d29176849
2018-09-30 16:52:06 +02:00
Fomafix
73f94fd8cd Add type hint Language where possible
Also use ?? instead of ?: to check for null.

Change-Id: I058b61d7e06cdefecdafa82f60109cc386e2a809
2018-08-12 10:20:11 +02:00
Aaron Schulz
8804df2da5 filerepo: clean up remote description cache keys
Hash the file name portion and make the string constant portions
more relevant to what the keys are actually used for (e.g. there
is no URL parameter in the key)

Bug: T198279
Change-Id: Idf6f97db26f5be291cdd3a50a91346677fe9c3e6
2018-06-27 08:25:47 +01:00
WMDE-Fisch
2330c9afad Replace deprecated ObjectCache and CommentStore calls in filerepo
Change-Id: I0e863dc8e4bc6dac938a2ed437c2691aace19690
2018-05-07 11:00:23 +02:00
Thiemo Kreuz
645d96b0e1 Fix and improve PHPDoc type hints in FileBackend and FileRepo
Change-Id: I311b4a6777946b451d70c6fdb2133dbbd73f159f
2018-04-19 10:32:09 +02:00
Aaron Schulz
dd359741cc Move DB errors to Rdbms namespace
Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
2017-04-15 10:47:41 -07:00
Aaron Schulz
58ecdd060c Fix assortment of IDEA warnings
Change-Id: I3fb482232483f37bf73ebbeb405056794109e618
2017-02-11 18:12:42 -08:00
Erik Bernhardson
d67197fa11 Cleanup some incorrect return annotations
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.

Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.

This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.

Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
2016-12-12 10:15:05 -08:00
Aaron Schulz
f525c72590 Rename getSlaveDB() FileRepo method to getReplicaDB()
The old name is left as an alias.

Change-Id: I60ab2cd5ce05df4247d5e25b017d2debee56554e
2016-11-18 07:42:39 -08:00
Aaron Schulz
8585cc9ffb Fix numerous FileRepo IDEA warnings
Change-Id: I3522f37b675efffb68dec9d125faacd8c8776e64
2016-10-05 16:38:15 -07:00
Aaron Schulz
04103860a2 Allow description text caching for ForeignDBFile
A large amount of real time is spent in fetching Commons
descriptions pages from wikipedias, according to xenon
flame graphs.

Change-Id: I3935bf8bf23da58b734f897d7a1979e9b2f7e5c8
2016-04-14 01:26:59 +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
victorbarbu
df622c4195 Provide short URL to file description page in imageinfo API
Bug: T122439
Change-Id: I0f00b986e6095bdb9b8d6af6fbc5b01995227e02
2016-01-12 15:48:52 +02:00
umherirrender
969349e945 Fix declaration of ForeignDBFile::delete()
Strict Standards: Declaration of ForeignDBFile::delete() should be
compatible with that of LocalFile::delete()

Followed-Up: I60cab27e0708a818c77791cc89194b6dd726da0b
Change-Id: I11d32c0a529ec76978cde38c038b4984ca13e8ba
2014-05-08 05:01:14 +00:00
umherirrender
957adbef22 Fixed some @params documentation (includes/[file...|upload])
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: I8804ebe0922d3a414863b162a2110e0b9e49b80f
2014-04-19 17:19:17 +02:00
Siebrand Mazeland
417d4fbbfa Update documentation for file repo related classes
Change-Id: I626d972f92934afc9349e11d3a5550c4044dcb53
2013-12-04 23:06:53 +01:00
Siebrand Mazeland
bb39b5a6e4 Update formatting of file repo classes
Change-Id: I780070e07352d84d7cda7628994b28b04e8a1ebf
2013-11-23 21:00:11 +01:00
Brian Wolff
bd7ebdec65 Add option to chose what language to fetch file description in.
I want to get the file description in a language other then
the user language in an extension (I5e6bc45f9751).

Change-Id: Ifcae821a51f4207e7816e710d3b3857c7ed438b6
2013-09-24 20:19:33 -03:00
Siebrand Mazeland
9b7889b84b Use American English spelling for behavior
Spotted in ipbreason-dropdown by Shirayuki.

Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
2013-03-04 10:24:57 +01:00
umherirrender
678f2da99d Pass user to File::recordUpload to avoid $wgUser
Moves the giving of a user one level up, because File::recordUpload2
already needs this (and fallback to $wgUser).
Can also use the user for the watching of the file, which was using
$wgUser before.

Change-Id: I697ae0df65b07ea59ab11b62804853cdc03cb172
2013-02-23 12:46:28 +00:00
Reedy
e028051140 Add a handful of missing @return
Change-Id: I21b218e6694600a2d2df4dd0a6b2b5cd2e10f1f9
2013-02-16 17:51:13 +01:00
umherirrender
7633886019 Follow up: I1b017e13 - Fix Strict Standards
Strict Standards: Declaration of ForeignDBFile::publish() should be
compatible with that of LocalFile::publish() in
\includes\filerepo\file\ForeignDBFile.php on line 122

Change-Id: If3de7ec3a6794752bfe6ef7644b66497c1ad9c8b
2012-11-24 15:15:32 +01:00
Reedy
68f50015c7 Improved/added parameter documentation
Change-Id: Ie48852acb434f6b62fda0b13b13e076f833d8975
2012-05-18 03:58:15 +01:00
Alexandre Emsenhuber
d5381d0ea0 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Iad15427368d13a6cc11c8512b7265e8c7b8878a5
2012-05-07 09:11:33 +02:00
Antoine Musso
394c8b5234 enhance filerepo doc structure 2012-02-08 15:51:16 +00:00
Aaron Schulz
ef75030835 Moved File classes to filerepo/file (as well as ArchivedFile) 2011-11-16 22:55:48 +00:00
Renamed from includes/filerepo/ForeignDBFile.php (Browse further)