PhpSandbox\PHPSandbox::_require_once PHP Méthode

_require_once() public méthode

Sandbox required once file
public _require_once ( string $file ) : mixed
$file string Required once file to sandbox
Résultat mixed Returns value passed from required once file
    public function _require_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("require_once('" . $file . "') [function.require-once]: failed to open stream. No such file or directory", E_USER_WARNING);
                trigger_error("Failed opening required '" . $file . "' (include_path='" . get_include_path() . "')", E_USER_ERROR);
                return false;
            }
            $this->includes[] = $file;
            return $this->execute($code);
        }
        return null;
    }
PHPSandbox