$ GLOBALS null в include - PullRequest
       55

$ GLOBALS null в include

0 голосов
/ 18 февраля 2020
function instant_info($item_name)
{
    global $_LANG, $woExpire_on, $wo_domain;
    $GLOBALS['item_name'] = $item_name;
    $GLOBALS['wo_domain'] = $wo_domain;
    $GLOBALS['woExpire_on'] = $woExpire_on;
    $a = dir("content/addons/");
    while (false !== ($entry = $a->read()))
    {
        if (is_dir('content/addons/'.$entry) && $entry != '.' && $entry != '..') {
            if (file_exists("content/addons/".$entry."/functions/instant_info.php")) {
                include_once("content/addons/".$entry."/functions/instant_info.php");
            }
        }

    }
    $a->close();
    if(empty($GLOBALS['info'])) { $GLOBALS['info'] = 'None'; }
    return $GLOBALS['info'];
}

Когда я использую echo instant_info('test_info'), я не получаю никакого вывода, я сделал тест и во включенном файле все переменные пусты в функции instant_info('test_info'), но я использую $ GLOBALS, почему эти переменные не передаются включить файл? (во включенном файле я установил $GLOBALS['info'])

...