Exemplo n.º 1
0
        /// <summary>
        /// Add at runtime a constant to a type
        /// </summary>
        /// <param name="typedesc">Type to modify</param>
        /// <param name="attributes">New const attributes</param>
        /// <param name="const_name">Const name</param>
        /// <param name="value">Const value</param>
        /// <remarks>Used by PDO_MYSQL</remarks>
        public void AddConstantToType(DTypeDesc typedesc, PhpMemberAttributes attributes, string const_name, object value)
        {
            Debug.Assert(typedesc != null);

            VariableName  name       = new VariableName(const_name);
            DConstantDesc const_desc = new DConstantDesc(typedesc, attributes, value);

            if (!typedesc.Constants.ContainsKey(name))
            {
                typedesc.Constants.Add(name, const_desc);
            }
        }
Exemplo n.º 2
0
 public void DeclareConstant(string /*!*/ fullName, object value)
 {
     constants[fullName, false] = new DConstantDesc(UnknownModule.RuntimeModule, PhpMemberAttributes.None, value);
 }