Move the relevant options to the config file instead, and add some hacky
code to force that config file if none was passed. "--help" works even
without the previous hack.
Bug: T90875
Change-Id: I84421e3eeaad0f88be83477cb99d6524abe13b77
MediaWiki still supports PHP 7.2+, but we want to mainly test in newer versions
of PHP. Setting minimum_target_php_version to 7.2 this lets us run phan without
phan trying to get us to make PHP 7.2-incompatible changes to 'appease' PHP 8.0
or whatever later changes.
Some switches of generic 'resource' type-hinting to 'resource|object' to inform
phan to ignore this (triggering PHPCS at the time, ah well), rather than trying
to hint the specific novel PHP encapsulation classes to that have replaced them
from PHP 8.0 onwards but don't yet exist, and fixes from where we were checking
the results of implode and explode.
Bug: T293924
Change-Id: I629e3fb3adfad73beb3d424a07e643c2e079d9bb
Also remove the unmaintained kafka-php package from the from "suggested"
and "dev" composer dependencies, as this is now no longer used.
Change-Id: If5668974f417b627df95bce47db18d46fa03327c
This appears impossible to use because the request is always made
with `Content-Type: application/json`.
* It seems unreasonable for an Etcd server to not support JSON.
* It seems unreasonable for an Etcd server to respond with YAML
to a JSON request.
* It seems unlikely that anyone would prefer YAML over JSON for
the automated encoding and decoding of fully automated inter-service
communication.
Change-Id: I290e03e17d547c3dc675820bb024c940e02e097a
Some node modules include PHP scripts, and these files shouldn't be
analyzed.
This could be improved further by excluding `extensions/*/{node_modules,vendor}`,
but I wasn't able to find a way to represent this for php-parallel-lint
without listing each directory individually.
For comparison, .phpcs.xml has this line to exclude dependencies:
<exclude-pattern type="relative">^(\.git|coverage|node_modules|vendor)/*</exclude-pattern>
Change-Id: I285eb32f67b71eaf111c9c9cd12f8205ba97eaf3
Also, re-alpha-sort the lists of external libraries in the release
notes file.
Bug: T287972
Depends-On: Ib55a7fc8968ec7e951d4e4d160db0601aaff74ea
Change-Id: If9fd7efd0f232a567204fee0b7b093f6edacd456
Also note in RELEASE-NOTES about promotion from require-dev to require
Depends-On: Ibfdbd2a479bd13d95e00fb41c2dd26b6ea6ea561
Change-Id: Ie1368ea2e5799b6b1e3f991b8156b967e12e0210
All libraries and extensions require ^0.5.0 so this should Just Work™.
Bug: T287972
Depends-On: I38ff3873df866cd896c9028dc6277ac7aac8a932
Change-Id: I0689e447d7b603a347869aa442a58602f45b2647
Removed use of Psr\SimpleCache\CacheInterface in favor of BagOStuff, as
the latter is a tried-and-true abstraction and the former offers no real
upfront benefits since the caching patterns of SettingsBuilder are quite
basic at this time.
The simplicity of cache interface use is largely in part to the minimal
probabilistic stampede protection implementation within CachedSource
which is left untouched by this change.
Bug: T294748
Change-Id: Ie59b37a8d5c7bf96225757fa9eb9d2c762476713
Not yet sure if config validation makes sense in production,
possibly before we write into cache we can validate, and then
trust that the cached values are all valid. This patch just
adds ability to validate the configuration.
"justinrainbow/json-schema" is already a transitive dependency
and is already in vendor.
Change-Id: Ib039c897a36a7e1911309fd29514657042b1b139
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
Changes since 2.2.4:
* Fix minify CLI to work from within vendor directory.
* Remove true/false !0/!1 micro optimisation. (T237042)
Depends-On: Id2f2061ac5c7389840b73ad138a91df73a40877f
Change-Id: I1f437781dd8f0cea516693a6e15fe3f95a0aa2ad
This is required by Parsoid 0.15.0-a6.
I don't need to increment the Parsoid version here since it is
not using semantic versioning. The caret will allow upgrades until the
Glorious Future of 1.0.0.
Depends-On: I72346a431f556555410f6af64bdb10140ea9bd8a
Change-Id: Idefebb725444d244252623533b8469214324f931