Example #1
0
        /// <summary>
        /// Gets, sets, or restores a value of a legacy configuration option.
        /// </summary>
        private static object GetSetRestore(LocalConfiguration config, string option, object value, IniAction action)
        {
            SQLiteLocalConfig  local    = (SQLiteLocalConfig)config.GetLibraryConfig(SQLiteLibraryDescriptor.Singleton);
            SQLiteLocalConfig  @default = DefaultLocal;
            SQLiteGlobalConfig global   = Global;

            switch (option)
            {
            // local:

            // global:
            case "sqlite.assoc_case":
                Debug.Assert(action == IniAction.Get);
                return(PhpIni.GSR(ref global.AssocCase, 0, value, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
Example #2
0
        /// <summary>
        /// Writes SQLite legacy options and their values to XML text stream.
        /// Skips options whose values are the same as default values of Phalanger.
        /// </summary>
        /// <param name="writer">XML writer.</param>
        /// <param name="options">A hashtable containing PHP names and option values. Consumed options are removed from the table.</param>
        /// <param name="writePhpNames">Whether to add "phpName" attribute to option nodes.</param>
        public static void LegacyOptionsToXml(XmlTextWriter writer, Hashtable options, bool writePhpNames) // GENERICS:<string,string>
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            if (options == null)
                throw new ArgumentNullException("options");

            SQLiteLocalConfig local = new SQLiteLocalConfig();
            SQLiteGlobalConfig global = new SQLiteGlobalConfig();
            PhpIniXmlWriter ow = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("sqlite");

            // local:

            // global:
            ow.WriteOption("sqlite.assoc_case", "AssocCase", 0, global.AssocCase);

            ow.WriteEnd();
        }
Example #3
0
        /// <summary>
        /// Writes SQLite legacy options and their values to XML text stream.
        /// Skips options whose values are the same as default values of Phalanger.
        /// </summary>
        /// <param name="writer">XML writer.</param>
        /// <param name="options">A hashtable containing PHP names and option values. Consumed options are removed from the table.</param>
        /// <param name="writePhpNames">Whether to add "phpName" attribute to option nodes.</param>
        public static void LegacyOptionsToXml(XmlTextWriter writer, Hashtable options, bool writePhpNames) // GENERICS:<string,string>
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            SQLiteLocalConfig  local  = new SQLiteLocalConfig();
            SQLiteGlobalConfig global = new SQLiteGlobalConfig();
            PhpIniXmlWriter    ow     = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("sqlite");

            // local:

            // global:
            ow.WriteOption("sqlite.assoc_case", "AssocCase", 0, global.AssocCase);

            ow.WriteEnd();
        }