pcntl_signal is a function, not an extension.
Change-Id: Ic86ec2b1fea4c62e4d8608a8089ea5c073dfa9c7
Follow-up: I66deaa9b346b936b2628ac0511492d20a42fea6c
Currently all the signal constants emit warnings as they are undefined
in PHP 7.4 and throw fatal error in PHP 8, if pcntl is not available.
pcntl extension is not enabled by default, and is not required by
MediaWiki, so this class should throw a better error if it's not
found. The class already has comment that pcntl and posix are required
but this is meaningless since the error and a warning for each constant
would be emitted anyway.
https://www.php.net/manual/en/pcntl.installation.php
Convert RESTARTABLE_SIGNALS constant back to static property as it was,
because we can only use these constants after confirming they exist,
which happens in the constructor.
Bug: T280456
Change-Id: I66deaa9b346b936b2628ac0511492d20a42fea6c
Usages in Installer.php were not removed as the installer is
resetting $wgMemc to an EmptyBagOStuff instance. Removing it
would risk breaking the installer for extensions still using
$wgMemc.
Bug: T160813
Change-Id: I46b837c92cf86474989ee6dd97f1251cf795309f
100% test coverage of code that appears to be working and used, in both
LockManagerGroupFactory and also LockManagerGroup. Where possible I
wrote it as unit tests. One preexisting code path seems to be broken and
I marked the test as skipped. Two methods look unused and perhaps not
especially helpful, so I didn't write tests for them yet in case we want
to just get rid of them instead.
Change-Id: Iaa7354f31c451b87773468609c674a3bf1d4382f
Fix five instances of PhanPluginDuplicateConditionalNullCoalescing;
escape the rest for now.
Bug: T219114
Change-Id: Ic4bb30c43c5315ce6b878b37b432c6e219414f8b
phpdbg is a gdb-style debugger for PHP that is run from the command
line. However, it has a different PHP_SAPI value, so it was impossible
to run maintenance scripts with it (until now).
To avoid having to check both PHP_SAPI values in a bunch of places,
introduce wfIsCLI() to easily check whether running from the
command-line or not.
We're (CI team) interested in generating code coverage with phpdbg
instead of xdebug, hence this patch.
Bug: T184043
Change-Id: Id1f994ca146d7858cd8bb6ab6cdbb7718ff524fb
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:
* the installation process
* forking processes
* integration tests (which must of the existing phpunit tests are)
Depends-On: I5d638ad415fc3840186a0beaa09ac02ea688539b
Change-Id: Ie98bf5af59208f186dba59a9e971c72ea0b63e69
The PHP_SAPI constant has been available since PHP 4.2.0. It's more
concise to use the constant and has less overhead than a function call.
Furthermore, PHP_SAPI rhymes with "happy", whereas "php_sapi_name"
rhymes with "lame". QED, etc.
Change-Id: Ie8c121cb8fcef50536af8d3f66723b458f0bf9af