Пример #1
0
        /// <summary>
        /// Writes MySql 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");
            }

            GetTextLocalConfig  local  = new GetTextLocalConfig();
            GetTextGlobalConfig global = new GetTextGlobalConfig();
            PhpIniXmlWriter     ow     = new PhpIniXmlWriter(writer, options, writePhpNames);

            //ow.StartSection("gd2");

            //// local:
            //ow.WriteOption("mssql.connect_timeout", "ConnectTimeout", 5, local.ConnectTimeout);
            //ow.WriteOption("mssql.timeout", "Timeout", 60, local.Timeout);
            //ow.WriteOption("mssql.batchsize", "BatchSize", 0, local.BatchSize);

            //// global:
            //ow.WriteOption("mssql.max_links", "MaxConnections", -1, global.MaxConnections);
            //ow.WriteOption("mssql.secure_connection", "NTAuthentication", false, global.NTAuthentication);

            //ow.WriteEnd();
        }
Пример #2
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)
        {
            GetTextLocalConfig  local    = (GetTextLocalConfig)config.GetLibraryConfig(GetTextLibraryDescriptor.Singleton);
            GetTextLocalConfig  @default = DefaultLocal;
            GetTextGlobalConfig global   = Global;

            //switch (option)
            //{
            //// local:

            //case "mssql.connect_timeout":
            //return PhpIni.GSR(ref local.ConnectTimeout, @default.ConnectTimeout, value, action);

            //case "mssql.timeout":
            //return PhpIni.GSR(ref local.Timeout, @default.Timeout, value, action);

            //case "mssql.batchsize":
            //return PhpIni.GSR(ref local.BatchSize, @default.BatchSize, value, action);

            //// global:

            //case "mssql.max_links":
            //Debug.Assert(action == IniAction.Get);
            //return PhpIni.GSR(ref global.MaxConnections, 0, null, action);

            //case "mssql.secure_connection":
            //Debug.Assert(action == IniAction.Get);
            //return PhpIni.GSR(ref global.NTAuthentication, false, null, action);
            //}

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
Пример #3
0
        /// <summary>
        /// Writes MySql 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");

            GetTextLocalConfig local = new GetTextLocalConfig();
            GetTextGlobalConfig global = new GetTextGlobalConfig();
            PhpIniXmlWriter ow = new PhpIniXmlWriter(writer, options, writePhpNames);

            //ow.StartSection("gd2");

            //// local:
            //ow.WriteOption("mssql.connect_timeout", "ConnectTimeout", 5, local.ConnectTimeout);
            //ow.WriteOption("mssql.timeout", "Timeout", 60, local.Timeout);
            //ow.WriteOption("mssql.batchsize", "BatchSize", 0, local.BatchSize);

            //// global:
            //ow.WriteOption("mssql.max_links", "MaxConnections", -1, global.MaxConnections);
            //ow.WriteOption("mssql.secure_connection", "NTAuthentication", false, global.NTAuthentication);

            //ow.WriteEnd();
        }