diff options
author | Kunal Mehta <legoktm@member.fsf.org> | 2018-01-02 22:51:44 -0800 |
---|---|---|
committer | Kunal Mehta <legoktm@member.fsf.org> | 2018-01-03 23:00:37 -0800 |
commit | 251a0b97e5bb8711bac1784e90f9b7d61377e7da (patch) | |
tree | 560293cc6766ce2ff0a003d3aae3865b2a8bb229 /maintenance/generateLocalAutoload.php | |
parent | 2e248f0bb20cbdf7738a6d44a843eb546c3bbf23 (diff) | |
download | mediawikicore-251a0b97e5bb8711bac1784e90f9b7d61377e7da.tar.gz mediawikicore-251a0b97e5bb8711bac1784e90f9b7d61377e7da.zip |
Treat phpdbg as run from the command line when checking PHP_SAPI
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
Diffstat (limited to 'maintenance/generateLocalAutoload.php')
-rw-r--r-- | maintenance/generateLocalAutoload.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/maintenance/generateLocalAutoload.php b/maintenance/generateLocalAutoload.php index bec11a0de1d5..189858c5af5d 100644 --- a/maintenance/generateLocalAutoload.php +++ b/maintenance/generateLocalAutoload.php @@ -1,6 +1,6 @@ <?php -if ( PHP_SAPI != 'cli' ) { +if ( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) { die( "This script can only be run from the command line.\n" ); } |