示例#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");

			MsSqlLocalConfig local = new MsSqlLocalConfig();
			MsSqlGlobalConfig global = new MsSqlGlobalConfig();
			PhpIniXmlWriter ow = new PhpIniXmlWriter(writer, options, writePhpNames);

			ow.StartSection("mssql");

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