Exemple #1
0
 public static object setFetchMode(object instance, PhpStack stack)
 {
     object fetch_to_mode = stack.PeekValue(1);
     object fetch_to_dest = stack.PeekValueOptional(2);
     object fetch_to_args = stack.PeekValueOptional(3);
     return ((PDOStatement)instance).setFetchMode(stack.Context, fetch_to_mode, fetch_to_dest, fetch_to_args);
 }
		public static object __construct(object instance, PhpStack stack)
		{
			stack.CalleeName = "__construct";
			
			object arg1 = stack.PeekValue(1);
			stack.RemoveFrame();
			return ((DOMXPath)instance).__construct(stack.Context, arg1);
		}
		public static object item(object instance, PhpStack stack)
		{
			stack.CalleeName = "item";
			
			object arg1 = stack.PeekValue(1);
			stack.RemoveFrame();
			return ((DOMNodeList)instance).item(stack.Context, arg1);
		}
Exemple #4
0
 public static object fetch(object instance, PhpStack stack)
 {
     object style = stack.PeekValueOptional(1);
     object orientation = stack.PeekValueOptional(2);
     object cursor_offset = stack.PeekValueOptional(3);
     stack.RemoveFrame();
     return ((PDOStatement)instance).fetch(stack.Context, style, orientation, cursor_offset);
 }
Exemple #5
0
        public static object __invoke(object/*!*/instance, PhpStack/*!*/stack)
        {
            var closure = (Closure)instance;

            stack.ExpandFrame(closure.@static);

            return closure.lambda(instance, stack);
        }
Exemple #6
0
 public static object __construct(object instance, PhpStack stack)
 {
     object argDSN = stack.PeekValue(1);
     object argUsername = stack.PeekReferenceOptional(2);
     object argPassword = stack.PeekReferenceOptional(3);
     object argDriverOptions = stack.PeekReferenceOptional(4);
     stack.RemoveFrame();
     return ((PDO)instance).__construct(stack.Context, argDSN, argUsername, argPassword, argDriverOptions);
 }
		public static object registerNamespace(object instance, PhpStack stack)
		{
			stack.CalleeName = "registerNamespace";
			
			object arg1 = stack.PeekValue(1);
			
			object arg2 = stack.PeekValue(2);
			stack.RemoveFrame();
			return ((DOMXPath)instance).registerNamespace(stack.Context, arg1, arg2);
		}
Exemple #8
0
        public static object Foo(object instance, PhpStack stack)
        {
            // setup the stack, get arguments from the stack
            stack.CalleeName = "Foo";
            object arg1 = stack.PeekValue(1);
            stack.RemoveFrame();

            // call the actual Foo with arguments obtained from the stack
            return ((MyPhpClass)instance).Foo(stack.Context, arg1);
        }
		public static object __call(object instance, PhpStack stack)
		{
			stack.CalleeName = "__call";
			
			object arg1 = stack.PeekValue(1);
			
			object arg2 = stack.PeekValue(2);
			stack.RemoveFrame();
			return ((SoapClient)instance).__call(stack.Context, arg1, arg2);
		}
Exemple #10
0
        public static object __construct(object instance, PhpStack stack)
        {
            object argFileName = stack.PeekValue(1);
            object argMode = stack.PeekValueOptional(2);
            PhpReference error = stack.PeekReferenceOptional(3);
            stack.RemoveFrame();

            string filename = PHP.Core.Convert.ObjectToString(argFileName);
            int mode = PHP.Core.Convert.ObjectToInteger(argMode);
            return ((SQLiteDatabase)instance).__construct(stack.Context, filename, mode, error);
        }
Exemple #11
0
        /// <summary>
        /// Invokes this callback (must be bound).
        /// </summary>
        /// <param name="args">Arguments to be passed to target function or method (can be <see cref="PhpReference"/>s).</param>
        /// <returns>The value returned by the called function or method (can be a <see cref="PhpReference"/>).</returns>
        internal object InvokeInternal(params object[] args)
        {
            Debug.Assert(IsBound, "Callback must be bound.");
            Debug.Assert(routineDesc != null);            // Since it's possible to call non static method statically we can't use this condition in the assert && (routineDesc.IsStatic || instance != null));

            // push args to PHP stack and invoke the desc
            PhpStack stack = (context != null ? context.Stack : ScriptContext.CurrentContext.Stack);

            if (state == State.BoundToCaller)
            {
                // push the real target name and args as a PhpArray
                stack.AddFrame(targetName, new PhpArray(args));
            }
            else
            {
                stack.AddFrame(args);
            }

            stack.Callback           = true;
            stack.LateStaticBindType = this.lateStaticBindType;
            return(routineDesc.Invoke(instance, stack, callingContext));
        }
Exemple #12
0
 public new static object __toString(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((SplFileInfo)instance).__toString(stack.Context);
 }
Exemple #13
0
 public new static object isFile(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((DirectoryIterator)instance).isFile(stack.Context);
 }
Exemple #14
0
 public static new object __construct(object instance, PhpStack stack)
 {
     var path = stack.PeekValue(1);
     stack.RemoveFrame();
     return ((DirectoryIterator)instance).__construct(stack.Context, path);
 }
Exemple #15
0
 public static object isFile(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((SplFileInfo)instance).isFile(stack.Context);
 }
Exemple #16
0
 public static object lastInsertId(object instance, PhpStack stack)
 {
     object name = stack.PeekValueOptional(1);
     stack.RemoveFrame();
     return ((PDO)instance).lastInsertId(stack.Context, name);
 }
Exemple #17
0
        public static object getModifierNames(object instance, PhpStack stack)
        {
            stack.CalleeName = "getModifierNames";
            object arg1 = stack.PeekValue(1);
            stack.RemoveFrame();

            int typed1 = Core.Convert.ObjectToInteger(arg1);
            return getModifierNames(typed1);
        }
Exemple #18
0
 public static object hasChildren(object instance, PhpStack stack)
 {
     var allowLinks = stack.PeekValueOptional(1);
     stack.RemoveFrame();
     return ((RecursiveDirectoryIterator)instance).hasChildren(stack.Context/*, allowLinks*/);
 }
Exemple #19
0
 public static new object __construct(object instance, PhpStack stack)
 {
     var path = stack.PeekValue(1);
     var flags = stack.PeekValueOptional(2);
     stack.RemoveFrame();
     return ((RecursiveDirectoryIterator)instance).__construct(stack.Context, path, flags);
 }
Exemple #20
0
 public new static object current(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((FilesystemIterator)instance).current(stack.Context);
 }
Exemple #21
0
 public static object current(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((DirectoryIterator)instance).current(stack.Context);
 }
Exemple #22
0
 public static object seek(object instance, PhpStack stack)
 {
     object position = stack.PeekValue(1);
     stack.RemoveFrame();
     return ((DirectoryIterator)instance).seek(stack.Context, position);
 }
Exemple #23
0
 public static object commit(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((PDO)instance).commit(stack.Context);
 }
Exemple #24
0
 public static object __construct(object instance, PhpStack stack)
 {
     var filename = stack.PeekValue(1);
     stack.RemoveFrame();
     return ((SplFileInfo)instance).__construct(stack.Context, filename);
 }
Exemple #25
0
 public static object rollback(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((PDO)instance).rollback(stack.Context);
 }
Exemple #26
0
 public static object getChildren(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((RecursiveDirectoryIterator)instance).getChildren(stack.Context);
 }
Exemple #27
0
 public static object errorInfo(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((PDO)instance).errorInfo(stack.Context);
 }
Exemple #28
0
		/// <summary>
		/// Default callback for <see cref="Map"/>.
		/// </summary>
		/// <param name="instance">Unused.</param>
		/// <param name="stack">A PHP stack.</param>
		/// <returns>A <see cref="PhpArray"/> containing items on the stack (passed as arguments).</returns>
		private static object MapIdentity(object instance, PhpStack stack)
		{
			PhpArray result = new PhpArray(stack.ArgCount, 0);

			for (int i = 1; i <= stack.ArgCount; i++)
			{
				result.Add(PhpVariable.Copy(stack.PeekValueUnchecked(i), CopyReason.PassedByCopy));
			}
			stack.RemoveFrame();

			return result;
		}
Exemple #29
0
 public static object exec(object instance, PhpStack stack)
 {
     object statement = stack.PeekValue(1);
     stack.RemoveFrame();
     return ((PDO)instance).exec(stack.Context, statement);
 }
Exemple #30
0
        public static object export(object instance, PhpStack stack)
        {
            stack.CalleeName = "export";
            object arg1 = stack.PeekValue(1);
            object arg2 = stack.PeekValueOptional(2);
            stack.RemoveFrame();

            Reflector typed1 = arg1 as Reflector;
            if (typed1 == null) { PhpException.InvalidArgumentType("reflector", "Reflector"); return null; }
            bool typed2 = (ReferenceEquals(arg2, Arg.Default)) ? false : Core.Convert.ObjectToBoolean(arg2);

            return export(typed1, typed2);
        }
Exemple #31
0
 public static object inTransaction(object instance, PhpStack stack)
 {
     stack.RemoveFrame();
     return ((PDO)instance).inTransaction(stack.Context);
 }