Esempio n. 1
0
        /// <summary>
        /// Writes Iconv 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 LegacyOptionsToIconv(XmlTextWriter writer, Hashtable options, bool writePhpNames)         // GENERICS:<string,string>
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            var local  = new IconvLocalConfig();
            var global = new IconvGlobalConfig();
            var ow     = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("iconv");

            // local:
            ow.WriteOption("iconv.input_encoding", "InputEncoding", "ISO-8859-1", local.InputEncoding);
            ow.WriteOption("iconv.internal_encoding", "InternalEncoding", "ISO-8859-1", local.InternalEncoding);
            ow.WriteOption("iconv.output_encoding", "OutputEncoding", "ISO-8859-1", local.OutputEncoding);

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

            ow.WriteEnd();
        }
Esempio n. 2
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();
        }
Esempio 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");
            }

            MySqlLocalConfig  local  = new MySqlLocalConfig();
            MySqlGlobalConfig global = new MySqlGlobalConfig();
            PhpIniXmlWriter   ow     = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("mysql");

            // local:
            ow.WriteOption("mysql.default_port", "Port", 3306, local.Port);
            ow.WriteOption("mysql.default_host", "Server", null, local.Server);
            ow.WriteOption("mysql.default_user", "User", null, local.User);
            ow.WriteOption("mysql.default_password", "Password", null, local.Password);
            ow.WriteOption("mysql.connect_timeout", "ConnectTimeout", 0, local.ConnectTimeout);
            ow.WriteOption("mysql.default_command_timeout", "DefaultCommandTimeout", 0, local.DefaultCommandTimeout);

            // global:
            ow.WriteOption("mysql.max_links", "MaxConnections", -1, global.MaxConnections);

            ow.WriteEnd();
        }
Esempio n. 4
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();
        }
Esempio n. 5
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();
        }
Esempio n. 6
0
		/// <summary>
        /// Writes Iconv 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 LegacyOptionsToIconv(XmlTextWriter writer, Hashtable options, bool writePhpNames) // GENERICS:<string,string>
		{
			if (writer == null)
				throw new ArgumentNullException("writer");
			if (options == null)
				throw new ArgumentNullException("options");

            var local = new IconvLocalConfig();
			var global = new IconvGlobalConfig();
			var ow = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("iconv");

            // local:
            ow.WriteOption("iconv.input_encoding", "InputEncoding", "ISO-8859-1", local.InputEncoding);
            ow.WriteOption("iconv.internal_encoding", "InternalEncoding", "ISO-8859-1", local.InternalEncoding);
            ow.WriteOption("iconv.output_encoding", "OutputEncoding", "ISO-8859-1", local.OutputEncoding);

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

			ow.WriteEnd();
		}
Esempio n. 7
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();
		}
Esempio n. 8
0
        /// <summary>
        /// Writes Phalanger BCL 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");
            }

            LibraryConfiguration local = new LibraryConfiguration();
            PhpIniXmlWriter      ow    = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("session");
            ow.WriteOption("session.cache_limiter", "CacheLimiter", "no-cache", PhpSession.DefaultCacheLimiter);
            ow.WriteOption("session.cache_expire", "CacheExpire", 180, PhpSession.DefaultCacheExpire);
            ow.WriteOption("session.serialize_handler", "Serializer", "php", local.Session.Serializer.Name);
            ow.WriteOption("session.gc_probability", "GcProbability", 1, local.Session.GcProbability);
            ow.WriteOption("session.gc_divisor", "GcDivisor", 100, local.Session.GcDivisor);
            ow.WriteOption("session.gc_maxlifetime", "GcMaxLifetime", 1440, local.Session.GcMaxLifetime);
            ow.WriteOption("session.save_path", "SavePath", "", local.Session.SavePath);
            ow.WriteOption("session.cookie_lifetime", "CookieLifetime", 0, PhpSession.DefaultCookieLifetime);
            ow.WriteOption("session.cookie_path", "CookiePath", "/", PhpSession.DefaultCookiePath);
            ow.WriteOption("session.cookie_domain", "CookieDomain", "", PhpSession.DefaultCookieDomain);
            ow.WriteOption("session.cookie_secure", "CookieSecure", false, PhpSession.DefaultCookieSecure);

            ow.StartSection("mailer");
            ow.WriteOption("SMTP", "SmtpServer", "localhost", local.Mailer.SmtpServer);
            ow.WriteOption("smtp_port", "SmtpPort", 25, local.Mailer.SmtpPort);
            ow.WriteOption("sendmail_from", "DefaultFromHeader", null, local.Mailer.DefaultFromHeader);

            ow.StartSection("highlighting");
            ow.WriteOption("highlight.bg", "Background", "#FFFFFF", local.Highlighting.Background);
            ow.WriteOption("highlight.string", "String", "#DD0000", local.Highlighting.String);
            ow.WriteOption("highlight.comment", "Comment", "#FF8000", local.Highlighting.Comment);
            ow.WriteOption("highlight.keyword", "Keyword", "#007700", local.Highlighting.Keyword);
            ow.WriteOption("highlight.html", "Html", "#000000", local.Highlighting.Html);
            ow.WriteOption("highlight.default", "Default", "#0000BB", local.Highlighting.Default);

            ow.StartSection("date");
            ow.WriteOption("date.default_latitude", "Latitude", 31.7667, local.Date.Latitude);
            ow.WriteOption("date.default_longitude", "Longitude", 35.2333, local.Date.Longitude);
            ow.WriteOption("date.sunrise_zenith", "SunriseZenith", 90.83, local.Date.SunriseZenith);
            ow.WriteOption("date.sunset_zenith", "SunsetZenith", 90.83, local.Date.SunsetZenith);
            ow.WriteOption("date.timezone", "TimeZone", null, local.Date.TimeZone.StandardName);

            ow.WriteEnd();
        }
Esempio n. 9
0
        // GENERICS:<string,string>
        /// <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)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            if (options == null)
                throw new ArgumentNullException("options");

            MySqlLocalConfig local = new MySqlLocalConfig();
            MySqlGlobalConfig global = new MySqlGlobalConfig();
            PhpIniXmlWriter ow = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("mysql");

            // local:
            ow.WriteOption("mysql.default_port", "Port", 3306, local.Port);
            ow.WriteOption("mysql.default_host", "Server", null, local.Server);
            ow.WriteOption("mysql.default_user", "User", null, local.User);
            ow.WriteOption("mysql.default_password", "Password", null, local.Password);
            ow.WriteOption("mysql.connect_timeout", "ConnectTimeout", 0, local.ConnectTimeout);
            ow.WriteOption("mysql.default_command_timeout", "DefaultCommandTimeout", 0, local.DefaultCommandTimeout);

            // global:
            ow.WriteOption("mysql.max_links", "MaxConnections", -1, global.MaxConnections);

            ow.WriteEnd();
        }