aboutsummaryrefslogtreecommitdiffstats
path: root/includes/filebackend/SwiftFileBackend.php
Commit message (Collapse)AuthorAgeFilesLines
* Move SwiftFileBackend to /libsAaron Schulz2016-09-241-1937/+0
| | | | Change-Id: Ied0be9891d70930caf415d75cb3b89043347f47e
* Depedencency cleanups to SwiftFileBackendAaron Schulz2016-09-241-30/+27
| | | | | | | | * Avoid wf* function MediaWiki dependencies. * Don't bother with getLocalClusterInstance() caching for the CLI case. * Give FileBackend a default 'resetOutputBuffer' callback. Change-Id: I359da1ad77c62880ea799b65cd3a16ad673a64eb
* Dependency inject $wgTmpDirectory into FileBackend classesAaron Schulz2016-09-211-1/+1
| | | | Change-Id: I219daffa67ff672bf5bd38921f4b1ca058d96b0f
* Make Status extend StatusValue and start FileBackend updateAaron Schulz2016-09-171-34/+34
| | | | | | | | | | | | | | * This avoids code duplication. * Callers can safely start type-hinting StatusValue as well. * Also moved the wrap() logic out of Status::__construct(), which only wrap() was (and should have been) using. Use "static" as well, so subclass behave properly. * The docs and type-hints in /filebackend are updated as an example. * A migration pattern is to inject a StatusValue wrapper into the backend and use it on all returned statuses, so MediaWiki will still get Status for message methods. Change-Id: Iff9255f34870ea6b0c4b91f6ddc69eea95186aba
* Added Range support to FileBackend::streamFile()Aaron Schulz2016-06-041-2/+32
| | | | | | | | | | | | | | | | | * Added HTTP options headers parameter to streamFile(). * Refactored doStreamFile() to either call StreamFile::stream() or delagate that to the subclass. SwiftFileBackend now relays the full Swift response rather than manually making the headers. This also makes Range headers easy to support. * Made use of this in img_auth.php for performance on private wikis. * Elimate stat call in streamFile() for Swift if "headers" is empty. * Refactored StreamFile a bit to inject request headers instead of using the $_SERVER global. A header options parameter is used instead, which also supports Range. * Removed now unused prepareForStream(). * Cleaned up streamFile() unit tests. Change-Id: I2ccbcbca6caabb8cf65bd6b3084cede2e6ea628a
* Kill mbstring fallbacksMax Semenik2016-04-061-1/+1
| | | | | | | | In the age when we require PHP 5.5, pretending that mbstring emulation is not slow and silly is silly. Bug: T129435 Change-Id: Ic8235c9da9a926df63ec7388900c44eab454eebe
* Many more function case mismatchesReedy2016-03-191-4/+4
| | | | Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
* Convert all array() syntax to []Kunal Mehta2016-02-171-135/+135
| | | | | | | | | | 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
* Stop doing $that = $this in includes/filebackendRicordisamoa2016-02-101-18/+12
| | | | | | Closures support $this as of PHP 5.4 Change-Id: Ib11139ec81336710c22146f9ff714e8afd3aa2cf
* Replace wfBaseConvert with Wikimedia\base_convertReedy2015-11-241-2/+2
| | | | Change-Id: Iadab3d018c3559daf79be90edb23d131729bdb68
* Make Swift iterators throw errors on failureAaron Schulz2015-11-061-3/+3
| | | | | | | | This is in line with FSFileBackend and is provides the calling loop of a way to know the listing failed, rather than just giving incomplete information. Change-Id: I34c66d9dbf84e5f33982d17e61364c1595d3e9f7
* Replace newAccelerator() with getLocalServerInstance()Aaron Schulz2015-11-021-1/+1
| | | | | | The name is clearer and more consistent, with simpler arguments. Change-Id: I7205a99ce033e8b086a52cd02c8a721e99c84b1e
* Make Swift backend respect Content-Type in create/storeAaron Schulz2015-10-261-2/+6
| | | | Change-Id: I479d1fc4f261bdcdc380404db0cb2f2397877759
* Replace some calls to wfGetMainCache()Aaron Schulz2015-10-201-2/+3
| | | | Change-Id: I9ba8fd5918877af6312b0854634bd36211438f00
* Merge "Fixed headers sent in addMissingMetadata()"jenkins-bot2015-08-271-2/+9
|\
| * Fixed headers sent in addMissingMetadata()Aaron Schulz2015-08-051-2/+9
| | | | | | | | | | | | | | | | | | | | | | * This used to relay back *all* of the GET headers, which includes things that are not changeable (Content-Length) or make no sense (x-trans-id). Only send the actual HTTP/metadata headers. Oddly enough sending garbage headers gives a 2XX response, but does not actually change anything in Swift. Bug: T105810 Change-Id: Id4829cf998a6d8763fd26d49cd8d9c16cf5527dd
* | objectcache: Use newAccelerator() fallback instead of try/catchTimo Tijhof2015-08-251-5/+4
| | | | | | | | | | | | | | Also remove confusing use of $wgMemc in LoadMonitorMySQL which should always be the same as wfGetMainCache(). Change-Id: I4fb9d075a37d3d45af71a5026ccf2eb17f24d7b0
* | objectcache: Make first parameter of newAccelerator optionalTimo Tijhof2015-08-241-1/+1
|/ | | | | | Makes it more convenient to use. Change-Id: I1e11f7a759bd2816e47d1c2453cbe39b8f44b2f0
* Cleaned up and split up Swift header parsing methods a bitAaron Schulz2015-08-051-20/+52
| | | | | | * Added tests for the metadata headers portion of the code Change-Id: I8ac65e31212b4cca4592f963e0ca5ad30e1349f7
* Added sanitizeHdrs() tests for SwiftAaron Schulz2015-07-291-0/+1
| | | | Change-Id: I2e3c3225c729e5220ca16f6ef4518da49e7f721c
* Merge "Clear the stat cache in addMissingMetadata() to avoid more POSTs"jenkins-bot2015-07-281-0/+2
|\
| * Clear the stat cache in addMissingMetadata() to avoid more POSTsAaron Schulz2015-07-221-0/+2
| | | | | | | | Change-Id: Icc075e424bdbed6868692ec734dff1e7d2003dd6
* | Improved addMissingMetadata() on POST failureAaron Schulz2015-07-221-3/+2
|/ | | | | | | * If the POST failed but the sha1 was computed, then use and cache that value rather than "false". Change-Id: I42b53c823013ecd9b281406e3d533a21e0de7cfb
* Avoid using trigger_error() in addMissingMetadata()Aaron Schulz2015-07-171-2/+5
| | | | | | | * Just use the normal swift log instead Bug: T105810 Change-Id: Ifa463e6298a1b57ab6a8d92f9defc744619d9fb6
* Use mediawiki/at-ease library for suppressing warningsKunal Mehta2015-06-111-2/+2
| | | | | | | | | | | | | | | 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
* Merge "Converted FileBackendStore to using the WAN cache"jenkins-bot2015-05-181-1/+3
|\
| * Converted FileBackendStore to using the WAN cacheAaron Schulz2015-04-301-1/+3
| | | | | | | | | | Bug: T93141 Change-Id: I76efb0dc45a697c5fdfc50932e1198a6d663a445
* | Consistently name the $this callback variable "$that"Timo Tijhof2015-05-131-18/+18
|/ | | | | | | | 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
* Merge "Fix and make PHPDoc tags in FileBackend more specific"jenkins-bot2015-03-181-0/+5
|\
| * Fix and make PHPDoc tags in FileBackend more specificThiemo Mättig2015-03-181-0/+5
| | | | | | | | | | | | A pure documentation patch. Should almost be a no-brainer. ;-) Change-Id: I9bf4d6056f7cde193fe5882a04a7973af9b5a7f4
* | Merge "Set stat cache when getting local copy files in Swift"jenkins-bot2015-01-141-20/+37
|\ \
| * | Set stat cache when getting local copy files in SwiftAaron Schulz2015-01-091-20/+37
| | | | | | | | | | | | Change-Id: I672051b8d04a5db4da8236deba48b266ec7dd9ab
* | | Updated some try-catch statements: MWException -> ExceptionAaron Schulz2015-01-091-1/+1
|/ / | | | | | | Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
* | Removed remaining profile callsAaron Schulz2015-01-081-2/+0
| | | | | | | | Change-Id: I31c81c78715048004fc8fca0f27d09c1fa71c118
* | Converted some section profiling to scopedProfileInAaron Schulz2015-01-071-4/+4
|/ | | | Change-Id: If69de34a046f4f33fc57b93beaf264f522ce7386
* filebackend: Log more details about backend-fail-internal errorsGilles Dubuc2014-11-171-0/+5
| | | | | | Bug: 73094 Change-Id: I9e45284e3cfd55bc34d87009387a2c1766e2db4a Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/991
* Bumped the default Swift token expiry a bitAaron Schulz2014-09-241-1/+1
| | | | Change-Id: I59f698a024180410ffd0c02290f6d61db5999f12
* Correct variable names in @param to match method declarationsumherirrender2014-08-131-1/+1
| | | | | | | Some @param have a typo in the variable name, some @param's were in wrong order. Change-Id: Ie25806831027112b398f6f4a909c59147ac3a5fa
* Cleanup some docs (includes/[e-l])umherirrender2014-07-241-1/+1
| | | | | | | | | | - 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
* Fixed spacingumherirrender2014-07-241-1/+1
| | | | | | | | | | - 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
* Fixed fatal in SwiftFileBackend when a bogus HTTP status is givenAaron Schulz2014-05-301-2/+3
| | | | | | * Error was "Fatal error: Call to a member function getSize() on a non-object" Change-Id: Id1a1b1add9daee4402b2ed017b95c9a9f0e08170
* Added unicode encoding support flags to FileBackendAaron Schulz2014-05-131-1/+2
| | | | | | | | * Fixed bug where even using Swift/Azure on Windows would disallow non-ASCII file names. bug: 1780 Change-Id: I19ed72da0b099d35cae74fb08eeb22c113da1065
* Made partial file download errors in Swift more usefulAaron Schulz2014-05-011-5/+8
| | | | Change-Id: I97a5cd1ed38508468122e33968b88adf2570a9a3
* Fixed some @params documentation (includes/[file...|upload])umherirrender2014-04-191-2/+2
| | | | | | | | | 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
* Fixed spacingumherirrender2014-03-201-1/+1
| | | | | | | | - 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
* Make use of strong consistency with Ceph RGWAaron Schulz2014-03-191-0/+10
| | | | Change-Id: Ic3b764363e91c3279d3dc017ddce630dae26bec5
* Remove useless "src" param when wrapping doGetFileStatMulti()Aaron Schulz2014-03-031-2/+3
| | | | Change-Id: I6008384ea872d71dcd2d183186a4aee5048b4dd4
* Removed pointless cache bypass in Swift backendAaron Schulz2014-02-251-2/+2
| | | | | | * This was added by mistake in 2af7ad8 apparently Change-Id: Ic4004428095953ce07e1e97da43748eba04f6639
* Added concurrent HEAD request support for SwiftAaron Schulz2014-02-201-55/+83
| | | | | | | | | | | | * 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
* Added some profiling calls to Swift backendAaron Schulz2014-02-181-1/+5
| | | | Change-Id: Ic692c897493fe4388568930c2f4f861b89f2ff78