* Do not do the connection init step if the same DB handle as
wfGetDB( DB_MASTER ) is being used to avoid clobbering it.
* Remove begin(), since only one of the subclasses wants
transactions. That one now uses startAtomic() now.
* Make getConnection() throw an error for bad config instead
of return null, which was not documented or expected.
Change-Id: Ib09a7972d6569c29e83e329a8f7f9f47a393b896
* 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
doOperationsInternal() already set "preserveCache" but never actually
filled it in to begin with. This should lower round trips if sync checks
are enabled.
Change-Id: Ica67b8d66e7602faed842408365edbd466688f61
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
Convenience aside, this lets multiwrite backends do async replication for
"store" operations safely, buy keeping a handle to the source file that
prevents it from getting prematurely deleted before the post-send writes
to the secondary backends can happen.
Bug: T91869
Change-Id: I1254de527c47835c35fed6e526b42953c1b2b2ca
I searched for /\$(\S+) = (.+?\(.*?\);)\n.*?\$\1\[/, ignored
everything involving isset(), unset() or array assigments, then
skimmed through the remaining results and changed things where they
made sense. These changes were not automated, so please review them.
Change-Id: Ib37b4c66fc57648470f151ad412210b3629c2538
The local temporary file might not live long enough to be
copied into storage during post-send.
Bug: T128124
Change-Id: Ifb5260958db008ec8b9f4db90f95a42e5ecaeadc
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
The content type detector will now inspect the file contents
to better handle extensionless files.
Also dependency inject the callback and make the default one
use FileInfo.
Change-Id: Iad59bf6c6a416b706f976a4c425763fd30e2debb
Normalize all headers to lower case at the start of the
FileBackend operation methods. This makes it easy for
subclasses to check for certain headers, e.g. content-type.
Change-Id: Ia69976326d17a51bcaa61f2781aa669ae7bd9c28
* This will defer writes to non-master backends till the
end up the web request. This is useful for multi-DC setups.
Bug: T112708
Change-Id: I118c07764dd4a4f4f2590d4548238df12860e750
* A backend with this set (normally 1) will be used for
non-latest reads. This can be used to prefer a local,
replicated, backend instead of one farther away (for
multi-DC setups)
* Note that listings still come from the master always.
Bug: T112708
Change-Id: Ic4bf4ba5a2c9ef78abd11dbd0d4b48c73cad6923
* Just return the ScopedLock itself without wrappig it in an array.
This also makes getScopedLocksForOps() actually return the correct
type according to the docs
Change-Id: Ic2d01d56c3fcb22af3adb5e5d4d1586d62316552
Also remove confusing use of $wgMemc in LoadMonitorMySQL which
should always be the same as wfGetMainCache().
Change-Id: I4fb9d075a37d3d45af71a5026ccf2eb17f24d7b0
* 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
* If the POST failed but the sha1 was computed, then use
and cache that value rather than "false".
Change-Id: I42b53c823013ecd9b281406e3d533a21e0de7cfb
* 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
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
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
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
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
- 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
- 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