le-phare / le-phare.github.io

The Faros site
https://faros.lephare.com
4 stars 2 forks source link

Script de vérification des prérequis : faux négatifs #102

Closed thislg closed 4 months ago

thislg commented 1 year ago

Il faudrait améliorer le script de check pour autoriser les notations alternatives (Off = 0 par exemple).

pierreboissinot commented 4 months ago

il me semble que c'est géré depuis, @MorganVERNIERS pourrais-tu vérifier stp ?

MorganVERNIERS commented 4 months ago

Effectivement, cela a déjà été géré.

function check_value_phpini(string $keyValue, string $expected): bool
{
    $check = false;

    if ('off' == strtolower($expected)) {
        $check = ('' == $keyValue || '0' == $keyValue || 'off' == $keyValue || 'Off' == $keyValue);
    } elseif ('on' == strtolower($expected)) {
        $check = ('1' == $keyValue || 'on' == $keyValue || 'On' == $keyValue);
    } elseif ('<' == $expected[0] || '>' == $expected[0]) {
        $check = check_comparator_int_phpini($keyValue, $expected);
    } else {
        $check = strtolower($expected) === strtolower($keyValue);
    }

    return $check;
}