public static void Eval(Php54Scope Scope, Php54Var Variable) { IPhp54Function EvalFunction; try { EvalFunction = Scope.Runtime.CreateMethodFromPhpCode(Variable.StringValue, "eval()"); } catch (Exception Exception) { Console.WriteLine(Exception); return; } EvalFunction.Execute(Scope); }
public void Execute(Php54Scope Scope) { if (StaticScope == null) { this.StaticScope = new Php54Scope(Scope.Runtime); } var OldStaticScope = Scope.StaticScope; try { Scope.StaticScope = this.StaticScope; Code(Scope); } finally { Scope.StaticScope = OldStaticScope; } }
public static Php54Var GetGlobal(Php54Scope Scope, string Name) { return Scope.Runtime.GlobalScope.GetVariable(Name); }
public static void Echo(Php54Scope Scope, Php54Var Variable) { //Scope.Php54Runtime.TextWriter.Write(Variable); Console.Out.Write(Variable); }
public void Reset() { this.ConstantScope = new Php54Scope(this); this.GlobalScope = new Php54Scope(this); this.ShutdownFunction = null; OutputFunctions.__ob_reset(); }
public static void Include(Php54Scope Scope, string Path, bool IsRequire, bool IsOnce) { var Runtime = Scope.Runtime; var FullPath = new FileInfo(Path).FullName; if (IsOnce) { if (Runtime.IncludedPaths.Contains(FullPath)) return; } var Method = Scope.Runtime.CreateMethodFromPhpFile(File.ReadAllText(FullPath), FullPath); Method.Execute(Scope); //Scope.Php54Runtime.TextWriter.Write(Variable); //Console.Out.Write(Variable); //throw(new NotImplementedException("Can't find path '" + Path + "' Require:" + IsRequire + ", Once:" + IsOnce + "")); }
public static Php54Var GetStatic(Php54Scope Scope, string Name) { return Scope.StaticScope.GetVariable(Name); }
public void Execute(Php54Scope Scope) { if (CachedFunction == null) { CachedFunction = CodeGenerator(); } CachedFunction.Execute(Scope); }