The `SettingsBuilder` now accepts a PSR-16 cache interface with which to
store and query settings before attempting to load from each source. By
default, no cache is used, but any object that implements the
`Psr\SimpleCache\CacheInterface` may be provided to the constructor.
An explicit dependency on "psr/simple-cache" has been added to
`composer.json`. Note that this dependency already existed in vendor
albeit it as a transitive one.
An APCu based `SharedMemoryCache` adapter is provided as a canonical
PSR-16 compliant interface for production use.
Sources are now queued by the `SettingsBuilder` when calling `load()`.
If a cache interface has been provided, and the source is considered
cacheable (implements `CacheableSource`), then it is wrapped as a
`CachedSource` which will query the cache first before loading from the
wrapped source.
Cache stampedes are mitigated using probabilistic early expiry. The
implementation for this was partially based on symfony/cache-contract
source code but also from the Wikipedia article and paper referenced
therein.
See https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration
Bug: T294748
Change-Id: I52ab3899731546876ee58265bd4a1927886746dc
If php-yaml extension in installed, use that. Otherwise
we fallback to symfony Yaml parser.
php-yaml is about 20 times faster then symfony, for default-settings.yaml
it will take PHP-yaml 6ms to load it vs 100ms for symfony. But given
that the result will be cached, it's better not to bring in
a required native dependency.
Bug: T294751
Change-Id: I3ffde926c3f264cacf39810ff7bd338c9f78823d
DB hostnames are extremely useful in getting the info when they are on
different MariaDB versions for example or their table stats need
refreshing.
Time fields are not being counted as numbers in Logstash because these
values are conflicting with other values that are string. Let's fix it.
Bug: T295706
Change-Id: Iff1c1087a7b64a51b5cbd7ecf13afc87d452c352
This will be useful for the Growth team, which intends
to release a DB table that currently resides at the x1 cluster.
Bug: T291966
Change-Id: I55fa417e779a0aa847c7b8e630977553641f46df
For comment and content the class mw-history-suppressed is added
additional, should be the same for the user.
Follow-Up: I08f14f712479e1b170c606e2b64857f8386acd76
Change-Id: I7d477913952b9cc67314d1ec96f83db2846a74cb
Don't just cut off the message key at 25 characters, it makes
debugging very annoying. But do cut off the parameter at some
reasonable length, it could be arbitrarily large.
Change-Id: I8a2665434d6370477eb36a6827eb634e230d280a
This feature enables the SettingsBuilder to be able to set php-ini
environment variables at run-time.
We just do so by specifying the various key/value pairs to the `php-ini`
key like below:
```
"php-ini": {
"key": "value",
...
}
```
This will allow us to set things like `display_errors`, `memory_limits` etc.
Bug: T294752
Change-Id: I2ff0e7abc010342537bbaf1e1b71fb84d02a153b
The config file path can be overridden, so we should use the defined
constant rather than hardcoding a path. The intention of this logic
is to purge cache with the active config changes, so it's more correct
to check the mtime of the file in use.
Change-Id: Iac5fa2af4021ab8c1a0532b46b3bbc02641c682a
* Swap == for ===
* Rename a couple of local variables to match common naming patterns
* Remove old chdir(); not needed now the code no longer uses commandLine.inc
Change-Id: Iabae9b6f4bf57309a7f06cb6740db60e473e1ff2
Fix return value of UndeletePage by preserving warnings from fileStatus
and revisionStatus.
The only user-facing difference is that now revision and file errors are
handled together, i.e. included in the same error message.
Also hard-deprecated now unused PageArchive methods. The only usage
seems to be in Ext:Video, which has a full copy of core's
SpecialUndelete anyway...
Bug: T290021
Change-Id: I30394f818220120b421d6b07a26d1e03bfbbc999
Add a config flag to allow for partial output on error. An extra
configuration variable is exported with the result so the client can
know that an error occurred during serialization.
Misc:
* Remove the unneeded $out variable null declaration
Bug: T294786
Change-Id: I8f8f504cf614cbd81323f536e7ea255a4aff5907
Those "$comment ?? ''" are a bit ugly, but the other way around is
changing the return values of some ::getDescription implementations,
which is dangerous, at least.
Change-Id: I07e6b58258c256d19b058c56280150b70a46b407
It can be difficult to distinguish between ParserOutput and OutputPage
values, since both are often named $out or $output. Use more
distinctive variable names to make it easier to read the code (and use
code search) for uses of the OutputPageParserOutput hook, where both
types are present in close proximity.
See T293860 for an instance of this confusion biting us in production,
and I386e99df01f889a80de26e861142bdb606aa649d for a related tidying-up
in Wikibase.
Change-Id: I0ccb7484eb3b2e2ae6a5a85c3e08d7d48b1e6146
This method was renamed in 1.37 to ::hasReducedExpiry() and only has a
single use in core (and no uses outside of core, as far as I can
tell). Rename the single use and deprecate the old name.
Code search:
https://codesearch.wmcloud.org/search/?q=hasDynamicContent&i=nope
Change-Id: Ie2bea78e31433a01a5590becc06f32294b04522e
The default not configured value for $wgLocalHTTPProxy is false, not
null. So in MultiHttpClient make sure it defaults to false and check for
false when deciding whether to use the proxy.
MWHttpRequest already has the correct behavior.
Bug: T296312
Change-Id: I3962c24f9cb159fb7d1e194e59c8bef5261371c3