PhpSandbox\PHPSandbox::_include_once PHP Méthode

_include_once() public méthode

Sandbox included once file
public _include_once ( string $file ) : mixed
$file string Included once file to sandbox
Résultat mixed Returns value passed from included once file
    public function _include_once($file)
    {
        if ($file instanceof SandboxedString) {
            $file = strval($file);
        }
        if (!in_array($file, $this->_get_included_files())) {
            $code = @file_get_contents($file, true);
            if ($code === false) {
                trigger_error("include_once('" . $file . "') [function.include-once]: failed to open stream. No such file or directory", E_USER_WARNING);
                return false;
            }
            $this->includes[] = $file;
            return $this->execute($code);
        }
        return null;
    }
PHPSandbox