mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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 array_values;
|
||||||
use function constant;
|
use function constant;
|
||||||
use function defined;
|
use function defined;
|
||||||
use function extension_loaded;
|
|
||||||
use function is_array;
|
use function is_array;
|
||||||
use function phpversion;
|
use function phpversion;
|
||||||
use function preg_match;
|
use function preg_match;
|
||||||
@ -230,11 +229,11 @@ class PluginDescription{
|
|||||||
*/
|
*/
|
||||||
public function checkRequiredExtensions(){
|
public function checkRequiredExtensions(){
|
||||||
foreach($this->extensions as $name => $versionConstrs){
|
foreach($this->extensions as $name => $versionConstrs){
|
||||||
if(!extension_loaded($name)){
|
$gotVersion = phpversion($name);
|
||||||
|
if($gotVersion === false){
|
||||||
throw new PluginException("Required extension $name not loaded");
|
throw new PluginException("Required extension $name not loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
$gotVersion = phpversion($name);
|
|
||||||
foreach($versionConstrs as $constr){ // versionConstrs_loop
|
foreach($versionConstrs as $constr){ // versionConstrs_loop
|
||||||
if($constr === "*"){
|
if($constr === "*"){
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user