Improved dependency checking

This commit is contained in:
Dylan K. Taylor 2017-03-10 21:51:05 +00:00
parent d41bdfc31c
commit 2cb98c48c2

View File

@ -398,11 +398,6 @@ namespace pocketmine {
++$errors; ++$errors;
} }
if(!extension_loaded("sockets")){
$logger->critical("Unable to find the Socket extension.");
++$errors;
}
$pthreads_version = phpversion("pthreads"); $pthreads_version = phpversion("pthreads");
if(substr_count($pthreads_version, ".") < 2){ if(substr_count($pthreads_version, ".") < 2){
$pthreads_version = "0.$pthreads_version"; $pthreads_version = "0.$pthreads_version";
@ -431,24 +426,22 @@ namespace pocketmine {
"); ");
} }
if(!extension_loaded("curl")){ $extensions = [
$logger->critical("Unable to find the cURL extension."); "curl" => "cURL",
++$errors; "json" => "JSON",
} "mbstring" => "Multibyte String",
"yaml" => "YAML",
"openssl" => "OpenSSL",
"sockets" => "Sockets",
"zip" => "Zip",
"zlib" => "Zlib"
];
if(!extension_loaded("yaml")){ foreach($extensions as $ext => $name){
$logger->critical("Unable to find the YAML extension."); if(!extension_loaded($ext)){
++$errors; $logger->critical("Unable to find the $name ($ext) extension.");
} ++$errors;
}
if(!extension_loaded("zlib")){
$logger->critical("Unable to find the Zlib extension.");
++$errors;
}
if(!extension_loaded("openssl")){
$logger->critical("Unable to find the OpenSSL extension.");
++$errors;
} }
if($errors > 0){ if($errors > 0){