Exemplo n.º 1
0
 public virtual void __set(PhpValue prop, PhpValue value)
 {
     if (_underlayingArray != null)
     {
         if ((_flags & ARRAY_AS_PROPS) != 0)
         {
             if (value.IsAlias)
             {
                 _underlayingArray.SetItemAlias(prop, value.Alias);
             }
             else
             {
                 _underlayingArray.SetItemValue(prop, value.DeepCopy());
             }
         }
         else
         {
             // TODO: err
         }
     }
     else if (_underlayingObject != null)
     {
         Operators.PropertySetValue(default(RuntimeTypeHandle), _underlayingObject, prop, value);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Associates data, or info, with the object currently pointed to by the iterator.
 /// </summary>
 public virtual void setInfo(PhpValue data)
 {
     if (!storage.IntrinsicEnumerator.AtEnd)
     {
         storage.IntrinsicEnumerator.CurrentValue.Array[Keys.Info] = data.DeepCopy();
     }
 }
Exemplo n.º 3
0
        public void offsetSet(object @object, PhpValue value)
        {
            if (@object == null)
            {
                throw ObjectNullException();
            }

            _map[WeakEntryKey.CreateWeak(@object)] = value.DeepCopy();
        }
Exemplo n.º 4
0
 public virtual void offsetSet(PhpValue index, PhpValue newval)
 {
     if (_underlayingArray != null)
     {
         _underlayingArray[index.ToIntStringKey()] = newval.DeepCopy();
     }
     else
     {
         Operators.PropertySetValue(default(RuntimeTypeHandle), _underlayingObject, index, newval);
     }
 }
Exemplo n.º 5
0
 public virtual void __set(PhpValue prop, PhpValue value)
 {
     if (_underlayingArray != null)
     {
         if ((_flags & ARRAY_AS_PROPS) != 0)
         {
             _underlayingArray[prop.ToIntStringKey()] = value.DeepCopy();
         }
         else
         {
             // TODO: err
         }
     }
     else if (_underlayingObject != null)
     {
         Operators.PropertySetValue(default(RuntimeTypeHandle), _underlayingObject, prop, value);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Searches for a filter implementation in the known <see cref="PhpFilter"/> descendants.
        /// </summary>
        /// <param name="ctx">Runtime context.</param>
        /// <param name="filter">The name of the filter (may contain wildcards).</param>
        /// <param name="instantiate"><c>true</c> to fille <paramref name="instance"/> with a new instance of that filter.</param>
        /// <param name="instance">Filled with a new instance of an implemented filter if <paramref name="instantiate"/>.</param>
        /// <param name="parameters">Additional parameters for the filter.</param>
        /// <returns><c>true</c> if a filter with the given name was found.</returns>
        internal static bool GetFilter(Context ctx, string filter, bool instantiate, out PhpFilter instance, PhpValue parameters)
        {
            foreach (var factory in _filterFactories)
            {
                if (factory.GetImplementedFilter(ctx, filter, instantiate, out instance, parameters))
                {
                    if (instance != null)
                    {
                        instance.filtername = filter;
                        instance.@params    = parameters.DeepCopy();
                    }

                    return(true);
                }
            }

            instance = null;
            return(false);
        }