PhpSandbox\PHPSandbox::_require PHP Méthode

_require() public méthode

Sandbox required file
public _require ( string $file ) : mixed
$file string Required file to sandbox
Résultat mixed Returns value passed from required file
    public function _require($file)
    {
        if ($file instanceof SandboxedString) {
            $file = strval($file);
        }
        $code = @file_get_contents($file, true);
        if ($code === false) {
            trigger_error("require('" . $file . "') [function.require]: 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;
        }
        if (!in_array($file, $this->_get_included_files())) {
            $this->includes[] = $file;
        }
        return $this->execute($code);
    }
PHPSandbox