bootstrap: add a giant yellow warning about JIT

This commit is contained in:
Dylan K. Taylor 2021-07-17 18:59:59 +01:00
parent 432999a7d7
commit 2588895ab0
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -139,6 +139,24 @@ namespace pocketmine {
if(\Phar::running(true) === ""){
$logger->warning("Non-packaged installation detected. This will degrade autoloading speed and make startup times longer.");
}
if(function_exists('opcache_get_status')){
$jitEnabled = opcache_get_status(false)["jit"]["on"] ?? false;
if($jitEnabled !== false){
$logger->warning(<<<'JIT_WARNING'
--------------------------------------- ! WARNING ! ---------------------------------------
You're using PHP 8.0 with JIT enabled. This provides significant performance improvements.
HOWEVER, it is EXPERIMENTAL, and has already been seen to cause weird and unexpected bugs.
Proceed with caution.
If you want to report any bugs, make sure to mention that you are using PHP 8.0 with JIT.
To turn off JIT, change `opcache.jit` to `0` in your php.ini file.
-------------------------------------------------------------------------------------------
JIT_WARNING
);
}
}
}
/**