Commit graph

120 commits

Author SHA1 Message Date
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
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
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
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
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
Aaron Schulz
2565f65ff0 Bumped the default Swift token expiry a bit
Change-Id: I59f698a024180410ffd0c02290f6d61db5999f12
2014-09-24 17:04:01 -07: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
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
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
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
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
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +00:00
Aaron Schulz
6112acac29 Make use of strong consistency with Ceph RGW
Change-Id: Ic3b764363e91c3279d3dc017ddce630dae26bec5
2014-03-19 17:27:48 +00:00
Aaron Schulz
4f7a786fbe Remove useless "src" param when wrapping doGetFileStatMulti()
Change-Id: I6008384ea872d71dcd2d183186a4aee5048b4dd4
2014-03-03 10:02:31 -08:00
Aaron Schulz
96ae9c07e3 Removed pointless cache bypass in Swift backend
* This was added by mistake in 2af7ad8 apparently

Change-Id: Ic4004428095953ce07e1e97da43748eba04f6639
2014-02-25 17:44:24 -08:00
Aaron Schulz
6b1a60a1ca Added concurrent HEAD request support for Swift
* This adds a new preloadFileStat() method to FileBackend.
* FileBackend::doOperations() makes use of this instead of primeFileCache().
  The later was mostly useless due to the 'latest' flag, which stat entries
  rarely had (and since they use add(), 'latest' ones do not override the
  non-'latest' ones).
* Simplified primeContainerCache/primeFileCache to no longer accept
  FileOp objects and made sure nothing passes those in anymore.

Change-Id: Iee3878cadd69c3a594c701c0aff81aab5f473de5
2014-02-20 08:50:08 +00:00
Aaron Schulz
6d377ae0e3 Added some profiling calls to Swift backend
Change-Id: Ic692c897493fe4388568930c2f4f861b89f2ff78
2014-02-18 11:32:51 -08:00
Aaron Schulz
0259fccfe3 Actually write-back the container cache in SwiftFileBackend
Change-Id: Ia072dd09c1fa5b4dec20a80e69425f7364488362
2014-02-16 07:33:13 +00:00
Aaron Schulz
3d670f1719 Reduce the amount of Swift auth cache keys used on wiki farms
Change-Id: Ic0a2f744d5d94bfb22286a19be3de0c37ecdf519
2014-02-12 07:07:20 +00:00
Aaron Schulz
288941aa53 Fixed broken auth caching for Swift
* A set() call was missing since 2af7ad8

Change-Id: I62b277e886c7ce6142a4d20f705b8337c3e4be58
2014-02-12 06:29:44 +00:00
Aaron Schulz
914fb04afa Simplified Swift backend to use maxConns flag in MultiHttpClient
Change-Id: Iee3756a490243511be86676c01d0a47940529e0b
2014-02-12 00:08:48 +00:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
Siebrand Mazeland
0cef781886 Fix CodeSniffer errors and warnings
Change-Id: Idc74e34634d88625773fb8f73315f61edfa67e28
2014-02-05 11:20:17 +01:00
Aaron Schulz
da802de2f2 Use "rb" instead of "rb+" for Swift store operation handles
bug: 60318
Change-Id: I411b2505287d4e4addff3231f9374775353b347b
2014-02-03 23:17:19 +00:00
jenkins-bot
0db4c8d514 Merge "Always return an array from SwiftFileBackend::addMissingMetadata" 2014-01-27 17:59:48 +00:00
Bryan Davis
03efc39055 Always return an array from SwiftFileBackend::addMissingMetadata
Correct the behavior of SwiftFileBackend::addMissingMetadata to match
the documentation and calling code expectations by always returning an
array.

Bug: 60477
Change-Id: I8d12888a6ebfa23502f8cf3a28866dcb00a18ec8
2014-01-27 09:54:25 -08:00
addshore
6e57736499 Fix phpdoc in SwiftFileBackend
Docs for $status and $code were swapped.

Change-Id: I88bd81b671f0e9a4176483fb744e45f2477672b5
2014-01-27 16:07:55 +00:00
Aaron Schulz
688200c607 Fixed use of X-Newest in Swift backend
Change-Id: I9c9572269cd5366272070ccba954c3bd417aa696
2014-01-15 16:48:59 -08:00
Aaron Schulz
f46cd2a593 Fixed wrong usage of $tmpFile in Swift backend
Change-Id: I21293be38c53b4dca3030c26a201f70d8ed243f3
2014-01-15 13:05:01 -08:00
Aaron Schulz
c00ab2af44 Fixed temp URL breakage in Swift
* The API behavior is not well-documented in that it wants the HMAC
  to use the unencoded object name. CloudFiles had this same issue.

bug: 59894
Change-Id: I3f0c80eed55991bb85d0c12f98927efa19af6760
2014-01-13 19:50:41 +00:00
Aaron Schulz
12d88861c5 Fixed silly doc typos
Change-Id: I53792affed74aa5985f82994b886b13603e23c65
2014-01-09 20:25:25 -08:00
jenkins-bot
00e5290c56 Merge "filebackend: Added supported for retrieving file metadata/headers" 2014-01-09 18:36:43 +00:00
Aaron Schulz
6fe98000b5 Made use of proper backend-fail-store message
Change-Id: I89d275926530b16f5660863608b89541d72c9f33
2014-01-08 15:43:56 -08:00
Aaron Schulz
10c0a19195 Added sanity check for doGetLocalCopyMulti() in Swift
* This better handles the case of /tmp being full or something

Change-Id: Ibf4fed0fd053f82ef5ede46b6c2ec72feee95699
2014-01-08 15:02:32 -08:00
Aaron Schulz
ac14c1c8a6 filebackend: Added supported for retrieving file metadata/headers
* This can be useful for carrying over metadata when copying files around
* Also fixed a bug in sanitizeHdrs() for Swift (broken content-disposition)

Change-Id: I4534e9acac2b306086797b3677f85c05b98e39fc
2014-01-08 13:22:11 -08:00
Aaron Schulz
2af7ad827d Removed cloudfiles dependency in SwiftFileBackend
* Added a new curl multi wrapper under libs/.
* Used the new MultiHttpClient class instead of CloudFiles
* Removed CDN related config and code as it does not work.
  well due to mutating files and tiny purge rate limits by CDNs.
* Also removed the unused and esoteric 'swiftAnonUser' parameter.
* Support concurrent 'describe' operations.
* Set ACLs on containers on intial PUT instead of in two steps.
  Previously if the second step failed, prepare() would never
  set the ACLs correctly since it aborts if the container exists.
* Improve token deletion to only trigger on 401s rather than other
  random errors like 50X timeouts.
* Removed duplicative getResponse* code by just using one closure
  called for both the concurrent and serial cases. Both cases are
  now funneled through doExecuteOpHandlesInternal().
* Add the MD5 to stat info, as it might be useful for speeding up
  the copy scripts in some cases (when both backends have md5 set).
* Avoid use of trigger_error() since there is a swift log group.
* A few other small code cleanups.

Change-Id: I1adb3e2df6df8cf01d3ad74158de96ea9a79da2e
2014-01-07 23:56:34 -08:00
Aaron Schulz
a0878fe2b4 filebackend: exception handling cleanups
* Split out FileBackendException class and reduced direct use of MWException

Change-Id: I325c1798b6d90972c12a5dccc37989af34d857f3
2013-12-07 23:22:07 -07:00
jenkins-bot
ba7c6b4594 Merge "Remove leading underscore from methods _getResponse*" 2013-11-24 03:20:23 +00:00
Siebrand Mazeland
26d203e2e5 Remove leading underscore from methods _getResponse*
Resolves CodeSniffer warning PSR2.Methods.MethodDeclaration.Underscore

Change-Id: I6cf0fccb47a7e1070999ee510b4d3e0112c41cea
2013-11-24 03:11:57 +00:00
Siebrand Mazeland
8f90b1cfa8 Fix various type and reference issues
Change-Id: Iced174d9f94faf80c5fa21e15fa6c81b6d8fa21c
2013-11-23 20:50:02 +01:00
Siebrand Mazeland
34a4bcbd48 Update documentation of file backend classes
Change-Id: I2113aecc53f1b361d9c276113bc0a9f7076cd21c
2013-11-23 19:24:43 +01:00