mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
PluginDescription: use result of phpversion() to check if extension is loaded
technically phpstan should account for this with the extension_loaded() check, but it currently doesn't and it's not worth fighting with it when the fix is so simple anyway.
This commit is contained in:
parent
bbe428a874
commit
cdda74ef93
@ -28,7 +28,6 @@ use function array_map;
|
||||
use function array_values;
|
||||
use function constant;
|
||||
use function defined;
|
||||
use function extension_loaded;
|
||||
use function is_array;
|
||||
use function phpversion;
|
||||
use function preg_match;
|
||||
@ -230,11 +229,11 @@ class PluginDescription{
|
||||
*/
|
||||
public function checkRequiredExtensions(){
|
||||
foreach($this->extensions as $name => $versionConstrs){
|
||||
if(!extension_loaded($name)){
|
||||
$gotVersion = phpversion($name);
|
||||
if($gotVersion === false){
|
||||
throw new PluginException("Required extension $name not loaded");
|
||||
}
|
||||
|
||||
$gotVersion = phpversion($name);
|
||||
foreach($versionConstrs as $constr){ // versionConstrs_loop
|
||||
if($constr === "*"){
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user