bootstrap: do not complain about xdebug if mode is 'off'

if xdebug.mode=off, the performance impact is the same as if xdebug wasn't loaded.
This commit is contained in:
Dylan K. Taylor 2022-08-19 16:44:52 +01:00
parent 10b799fadb
commit 1b852ac290
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -37,6 +37,7 @@ namespace pocketmine {
use Webmozart\PathUtil\Path;
use function defined;
use function extension_loaded;
use function function_exists;
use function getcwd;
use function phpversion;
use function preg_match;
@ -160,7 +161,7 @@ namespace pocketmine {
if(PHP_DEBUG !== 0){
$logger->warning("This PHP binary was compiled in debug mode. This has a major impact on performance.");
}
if(extension_loaded("xdebug")){
if(extension_loaded("xdebug") && (!function_exists('xdebug_info') || count(xdebug_info('mode')) !== 0)){
$logger->warning("Xdebug extension is enabled. This has a major impact on performance.");
}
if(((int) ini_get('zend.assertions')) !== -1){