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;
}
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); }