Lisphp_Environment::full PHP Method

full() public static method

public static full ( )
    public static function full()
    {
        $scope = new Lisphp_Scope(self::sandbox());
        $scope->let('use', new Lisphp_Runtime_Use());
        $scope->let('from', new Lisphp_Runtime_From());
        $scope->let('*env*', $_ENV);
        $scope->let('*server*', $_SERVER);
        return $scope;
    }

Usage Example

Example #1
0
function balrog_front_controller($baseDir)
{
    $environment = Lisphp_Environment::full();
    $scope = new Lisphp_Scope($environment);
    $scope['require'] = new Lisphp_Runtime_PHPFunction(function ($file) use($scope) {
        $program = Lisphp_Program::load(__DIR__ . '/' . $file . '.lisphp');
        return $program->execute($scope);
    });
    $scope['base-dir'] = $baseDir;
    $filename = __DIR__ . '/front-controller.lisphp';
    $program = Lisphp_Program::load($filename);
    $program->execute($scope);
}
All Usage Examples Of Lisphp_Environment::full
Lisphp_Environment