Commit graph

335 commits

Author SHA1 Message Date
Aaron Schulz
8d1eecab49 Allow "." in filebackend container prefixes
* This character in $wgDBname seems to be common enough.
  The wiki ID is the default container prefix, and if it
  is not accepted, then confusing errors occur that block
  all file uploads. The case of dots is handled now.
* Improved variable naming in resolveStoragePath().

Bug: T46066
Change-Id: I68458a876855894d01e8cf880bd6cfcfdae17bd0
2015-06-26 06:49:20 +00:00
Bartosz Dziewoński
1021f20100 Fix instances of preg_quote() without second parameter
This might work in specific cases, depending on the string we're
quoting, but is never correct. The instance in SpecialAllMessages.php
was resulting in incorrect behavior (and log spam, T103879).

Searched for this regex: preg_quote\((?:\([^)]+?\)|[^,()])+?\)

Change-Id: Icc88775970f4927ddf953e5ad7c5c19d59491573
2015-06-25 19:43:56 +02:00
umherirrender
6b24d10b6d Fix some line indent of string concat
Change-Id: I5883c9cd57d106168648b4502051b4b49046fea2
2015-06-19 20:52:43 +02: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
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
jenkins-bot
5161541d87 Merge "Converted FileBackendStore to using the WAN cache" 2015-05-18 08:34:10 +00:00
Timo Tijhof
19bff2537e Consistently name the $this callback variable "$that"
Most are already, but some had differnet names. In PHP 5.4+ this is
redundant as they inherit automatically, but we need these for PHP 5.3
compatibility. Settle on "$that" to make these easier to find.

Change-Id: I0b68b2c550fde9c2da53d844421e34b8df0c42ed
2015-05-13 23:05:07 +01:00
Aaron Schulz
b86b9a6549 Tweaked TempFSFile::bind() param type docs
Change-Id: I53de37b3da756ca42447edd60c14cd6d43b56ee2
2015-05-02 00:13:57 +00:00
Aaron Schulz
48cffdff82 Converted FileBackendStore to using the WAN cache
Bug: T93141
Change-Id: I76efb0dc45a697c5fdfc50932e1198a6d663a445
2015-04-30 01:30:38 +00:00
jenkins-bot
b7ec2c9b33 Merge "Fix and make PHPDoc tags in FileBackend more specific" 2015-03-18 16:45:20 +00:00
Thiemo Mättig
d71f05290e Fix and make PHPDoc tags in FileBackend more specific
A pure documentation patch. Should almost be a no-brainer. ;-)

Change-Id: I9bf4d6056f7cde193fe5882a04a7973af9b5a7f4
2015-03-18 17:22:52 +01:00
Aaron Schulz
8d2f7b9178 Never treat persistent stat cache as "latest" in FileBackend
bug: T89184
Change-Id: I035c0f85a641efa0e4e3209b2bcf9847c08ab0d2
2015-02-10 23:30:55 +00:00
Aaron Schulz
a611ebf1ff Changed FileBackend exceptions to subclass Exception
Change-Id: Ic7d4d6cf0dde3e93ef78758b1a6b03f78c9bcdba
2015-01-17 14:48:00 -08:00
jenkins-bot
29790fbc04 Merge "Set stat cache when getting local copy files in Swift" 2015-01-14 21:26:11 +00:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Aaron Schulz
d81ad30744 Set stat cache when getting local copy files in Swift
Change-Id: I672051b8d04a5db4da8236deba48b266ec7dd9ab
2015-01-09 23:18:26 +00:00
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Aaron Schulz
4ff8136807 Removed remaining profile calls
Change-Id: I31c81c78715048004fc8fca0f27d09c1fa71c118
2015-01-08 02:49:33 -08:00
Aaron Schulz
3226337f17 Converted some section profiling to scopedProfileIn
Change-Id: If69de34a046f4f33fc57b93beaf264f522ce7386
2015-01-07 14:19:06 -08:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Ricordisamoa
12dec5d85d Fix some stuttering in comments and documentation
Change-Id: I9c0088b9aab37335203cad45a1d6fa8ac3f43321
2014-12-17 19:44:10 +00:00
Ricordisamoa
fc5fd5c37a Typo fixes and non-code tweaks
Skipped replacements:
* prefered → preferred
* prolly → probably

Skipped files:
* resources/lib/jquery.ui/jquery.ui.mouse.js
* resources/lib/jquery/jquery.form.js

Change-Id: Ib7923f362ddfca1b892bf5d601785d6b5aa5d44c
2014-12-12 18:31:15 +00:00
umherirrender
489d793882 Fixed spacing
- Added/removed spaces around parenthesis
- Added newline in empty blocks
- Added space after switch/foreach/function
- Use tabs at begin of line
- Add newline at end of file

Change-Id: I244cdb2c333489e1020931bf4ac5266a87439f0d
2014-12-05 22:28:07 +01:00
Gilles Dubuc
a6f2310cc7 filebackend: Log more details about backend-fail-internal errors
Bug: 73094
Change-Id: I9e45284e3cfd55bc34d87009387a2c1766e2db4a
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/991
2014-11-17 23:36:47 +00:00
Gilles Dubuc
d984dcbcd6 Improve doPrepareInternal error messages
Bug: 73229
Change-Id: Iee6c478d02c3d6f8d5f7d516c799d9bd53b0272f
2014-11-10 19:52:13 +01:00
Aaron Schulz
54f1b2373b Tweaked some of the default LockManager ttls
Change-Id: Ic2c58ef02dc686f38840fe974a9d2858cd15c019
2014-10-23 22:19:19 -07:00
Aaron Schulz
2565f65ff0 Bumped the default Swift token expiry a bit
Change-Id: I59f698a024180410ffd0c02290f6d61db5999f12
2014-09-24 17:04:01 -07:00
Aaron Schulz
d1bc7d2cd9 Removed some b/c code from file backend
Change-Id: Ie8dbff588b067a202b24dfeaf792301c1077f08b
2014-09-12 00:54:24 -07:00
umherirrender
3b2b6a2773 Add missing @param to function docs
Change-Id: I47fa96a976f55a1a93cb75397285edb8c7f4cd8a
2014-08-14 20:22:52 +02:00
umherirrender
21e0c1c533 Correct variable names in @param to match method declarations
Some @param have a typo in the variable name,
some @param's were in wrong order.

Change-Id: Ie25806831027112b398f6f4a909c59147ac3a5fa
2014-08-13 21:48:28 +02:00
rillke
c31fbf073e Unify the spelling of MIME in documentation
Writing MIME as written in Wikipedia and some documentation clean up.

Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4
2014-08-07 23:38:45 +02:00
umherirrender
5fa2717c67 Specifiy mixed doc param in FSFile
Change-Id: I406e46da6ece2e2f9436783a0280afa7cfa9807c
2014-07-28 19:04:51 +02:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- 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: I41a84e8e1dec39170aa655250325ffc485eaeaef
2014-07-24 19:43:03 +02:00
umherirrender
4ee680a8b3 Fixed spacing
- Removed spaces after not operator (!)
- Removed spaces inside array index
- use tab as indent instead of spaces
- Add newline at end of file
- Removed spaces after casts

Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b
2014-07-24 11:53:04 +02:00
umherirrender
abfa0d7854 Standardize @todo
Always use lowercase @todo
Changed some "@FIXME" to "@todo FIXME: "

Change-Id: I016d1f9511e6f3bbd22427f0fffeccd77ab5e0db
2014-07-23 22:27:20 +02:00
umherirrender
53c420e278 Fixed spacing
- use tab as indent instead of spaces
- Added space after closures "function"
- Added spaces around string_concat
- Added newline inside empty blocks
- Removed four spaces after comma

Change-Id: I4425b0c6a69b36f40acfea6511b8950cf09ce2b2
2014-07-20 21:41:41 +02:00
umherirrender
de39f3e019 Use some callable hints on @param docs
Callbacks can be given as a string or array, so the hint 'callable' is
used.

Change-Id: I3842606f74c8c3705dffc70bf13e31f44a37fa65
2014-07-03 21:20:35 +02:00
Aaron Schulz
0fa9a391e3 filebackend: Avoid using popen() when "parallelize" is disabled
Bug: 66467
Change-Id: Iaf8eb2ecfad166e26e265a98933399dc4bc255a3
2014-06-18 20:12:03 +00:00
Aaron Schulz
4e72a7dfa4 Fixed FSFileOpHandle comment
Change-Id: Ie89d18f173f4fb172c35317cee9403e5f5f43d47
2014-06-13 10:17:33 -07:00
Aaron Schulz
c36eb818f8 Made FSFileBackend use closures for doExecuteOpHandlesInternal()
Change-Id: I8401a92384cb454eb79a4607b350c50d432a9510
2014-06-12 13:40:03 -07:00
Aaron Schulz
c699000ae0 Fixed fatal in SwiftFileBackend when a bogus HTTP status is given
* Error was "Fatal error: Call to a member function getSize() on a non-object"

Change-Id: Id1a1b1add9daee4402b2ed017b95c9a9f0e08170
2014-05-30 11:48:14 -07:00
Aaron Schulz
1d59d6152e Improved FileBackend failure logging a bit
* This partly follows up on 2cfce9f

Change-Id: I9d15f44d8000f52fd7b307d358c895452ee96a8d
2014-05-22 17:37:33 -07:00
Aaron Schulz
399198c28e Replace FOR UPDATE with LockManager use in LocalFile::lock()
* This avoids excess contention where inserts of rows for
  similarly named files get blocked. This often would effect
  users of UploadWizard or any bot doing mass uploads.

Change-Id: Ie7a328f7d4f03aa249770804417347a50356ea42
2014-05-20 14:22:52 -07:00
Aaron Schulz
0d54e6e0bf Added unicode encoding support flags to FileBackend
* Fixed bug where even using Swift/Azure on Windows
  would disallow non-ASCII file names.

bug: 1780
Change-Id: I19ed72da0b099d35cae74fb08eeb22c113da1065
2014-05-13 14:11:36 -07:00
Aaron Schulz
45c1d73bdb Made partial file download errors in Swift more useful
Change-Id: I97a5cd1ed38508468122e33968b88adf2570a9a3
2014-05-01 22:44:24 +00:00
jenkins-bot
f0d1e12ffa Merge "Avoid bogus IE extension check errors in img_auth.php" 2014-04-22 20:59:04 +00:00
Aaron Schulz
a650998aa7 Avoid bogus IE extension check errors in img_auth.php
Change-Id: I57083d3fe0517b94d3b786970b412e6ec51cf5f0
2014-04-21 19:30:48 -07:00
Aaron Schulz
603d8970c3 Made TempFSFile try to purge files on fatals too
Change-Id: I3e80bea0d869be989c951dfb35a218bb66c9de17
2014-04-21 11:18:39 -07:00
jenkins-bot
a21d59cc6e Merge "Make room for preloadFileStat() call in FileBackend::doOperationsInternal" 2014-04-21 17:13:35 +00:00
jenkins-bot
e40b19ed4e Merge "Bail out on FileBackend operations if the initial stat calls failed" 2014-04-21 17:13:33 +00:00