コード例 #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();
        }
コード例 #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");
            }

            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();
        }
コード例 #3
0
ファイル: Configuration.cs プロジェクト: jiahao42/weverca
        /// <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();
        }
コード例 #4
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();
        }
コード例 #5
0
        /// <summary>
        /// WrServers PDO legacy options and their values to XML text stream.
        /// Skips options whose values are the same as default values of Phalanger.
        /// </summary>
        /// <param name="wrServerr">XML wrServerr.</param>
        /// <param name="options">A hashtable containing PHP names and option values. Consumed options are removed from the table.</param>
        /// <param name="wrServerPhpNames">Whether to add "phpName" attribute to option nodes.</param>
        public static void LegacyOptionsToXml(XmlTextWriter wrServerr, Hashtable options, bool wrServerPhpNames) // GENERICS:<string,string>
        {
            if (wrServerr == null)
                throw new ArgumentNullException("wrServerr");
            if (options == null)
                throw new ArgumentNullException("options");

            PDOSQLServerLocalConfig local = new PDOSQLServerLocalConfig();
            PDOSQLServerGlobalConfig global = new PDOSQLServerGlobalConfig();
            PhpIniXmlWriter ow = new PhpIniXmlWriter(wrServerr, options, wrServerPhpNames);

            ow.StartSection("pdo");

            // local:

            // global:

            ow.WriteEnd();
        }
コード例 #6
0
        // GENERICS:<string,string>
        /// <summary>
        /// Writes PDO 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");

            PDOMySQLocalConfig local = new PDOMySQLocalConfig();
            PDOMySQLGlobalConfig global = new PDOMySQLGlobalConfig();
            PhpIniXmlWriter ow = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("pdo");

            // local:

            // global:

            ow.WriteEnd();
        }
コード例 #7
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();
        }
コード例 #8
0
ファイル: ZipConfiguration.cs プロジェクト: jiahao42/weverca
        /// <summary>
        /// Writes Zip 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");
            }

            ZipLocalConfig  local  = new ZipLocalConfig();
            ZipGlobalConfig global = new ZipGlobalConfig();
            PhpIniXmlWriter ow     = new PhpIniXmlWriter(writer, options, writePhpNames);

            ow.StartSection("Zip");

            // local:

            // global:

            ow.WriteEnd();
        }
コード例 #9
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();
        }
コード例 #10
0
ファイル: Configuration.cs プロジェクト: dw4dev/Phalanger
        /// <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");

            GdLocalConfig local = new GdLocalConfig();
            GdGlobalConfig global = new GdGlobalConfig();
            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();
        }
コード例 #11
0
ファイル: Configuration.cs プロジェクト: Ashod/Phalanger
		/// <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();
		}
コード例 #12
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();
        }