better php extention recognizion

This commit is contained in:
1Day 2022-01-12 08:36:10 +01:00
parent 94b66250c0
commit 4a51c20fcc
3 changed files with 4 additions and 10 deletions

View file

@ -6,8 +6,6 @@ $required_extentions = array("openssl", "gd", "mysql", "PDO", "mbstring", "token
$requirements = [
"php" => "7.4",
"mysql" => "5.7.22",
];
function checkPhpVersion()
@ -33,7 +31,6 @@ function getMySQLVersion()
function getZipVersion()
{
global $requirements;
$output = shell_exec('zip -v');
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
@ -45,7 +42,6 @@ function getZipVersion()
function getGitVersion()
{
global $requirements;
$output = shell_exec('git --version');
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
@ -57,7 +53,6 @@ function getGitVersion()
function getTarVersion()
{
global $requirements;
$output = shell_exec('tar --version');
preg_match('@[0-9]+\.[0-9]+@', $output, $version);
@ -75,9 +70,8 @@ function checkExtensions()
$extentions = get_loaded_extensions();
foreach ($required_extentions as $ext) {
if (!in_array($ext, $extentions)) {
if(!preg_grep("/^(?=.*".$ext.").*$/", $extentions))
array_push($not_ok, $ext);
}
}
return $not_ok;

View file

@ -66,10 +66,11 @@ if (!isset($_GET['step'])) {
version: <?php echo getMySQLVersion(); ?> (minimum required <?php echo $requirements["mysql"]; ?>)</p>
<p class="<?php print(sizeof(checkExtensions()) == 0 ? "ok" : "notok"); ?>"> Missing
extentions: <?php print(sizeof(checkExtensions()) == 0 ? "None" : "");
php-extentions: <?php print(sizeof(checkExtensions()) == 0 ? "none" : "");
foreach (checkExtensions() as $ext) {
echo $ext . ", ";
} ?> (try to install anyway)</p>
}
print(sizeof(checkExtensions()) == 0 ? "" : "(Proceed anyway)");?></p>
<!-- <p class="<?php print(getZipVersion() === "OK" ? "ok" : "notok"); ?>"> Zip
version: <?php echo getZipVersion(); ?> </p> -->

View file

@ -1 +0,0 @@
locked