Ejemplo n.º 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");
            }

            ZlibLocalConfig  local  = new ZlibLocalConfig();
            ZlibGlobalConfig global = new ZlibGlobalConfig();
            PhpIniXmlWriter  ow     = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("zlib");

            //ow.WriteOption("zlib.output_compression", "OutputCompression", "Off", "Off");
            //ow.WriteOption("zlib.output_compression_level", "OutputCompression", -1, -1);

            //// 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();
        }
Ejemplo n.º 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)
        {
            ZlibLocalConfig  local    = (ZlibLocalConfig)config.GetLibraryConfig(ZlibLibraryDescriptor.Singleton);
            ZlibLocalConfig  @default = DefaultLocal;
            ZlibGlobalConfig 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 "zlib.output_compression":
                Debug.Assert(action == IniAction.Get, "Setting zlib.output_compression is not currently implemented.");
                return(false);

            case "zlib.output_compression_level":
                Debug.Assert(action == IniAction.Get, "Setting zlib.output_compression_level is not currently implemented.");
                return(-1);

            case "zlib.output_handler":
                Debug.Assert(action == IniAction.Get, "Setting zlib.output_handler is not currently implemented.");
                return("");
            }

            Debug.Fail("Option '" + option + "' is not currently supported.");
            return(null);
        }
Ejemplo n.º 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");

            ZlibLocalConfig local = new ZlibLocalConfig();
			ZlibGlobalConfig global = new ZlibGlobalConfig();
			PhpIniXmlWriter ow = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("zlib");

            //ow.WriteOption("zlib.output_compression", "OutputCompression", "Off", "Off");
            //ow.WriteOption("zlib.output_compression_level", "OutputCompression", -1, -1);

            //// 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();
		}