예제 #1
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)
        {
            MsSqlLocalConfig  local    = (MsSqlLocalConfig)config.GetLibraryConfig(MsSqlLibraryDescriptor.Singleton);
            MsSqlLocalConfig  @default = DefaultLocal;
            MsSqlGlobalConfig 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);
        }
예제 #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)
        {
            IconvLocalConfig  local    = (IconvLocalConfig)config.GetLibraryConfig(IconvLibraryDescriptor.Singleton);
            IconvLocalConfig  @default = DefaultLocal;
            IconvGlobalConfig global   = Global;

            //[iconv]
            //;iconv.input_encoding = ISO-8859-1
            //;iconv.internal_encoding = ISO-8859-1
            //;iconv.output_encoding = ISO-8859-1

            switch (option)
            {
            //// local:

            case "iconv.input_encoding":
                return(PhpIni.GSR(ref local.InputEncoding, @default.InputEncoding, value, action));

            case "iconv.internal_encoding":
                return(PhpIni.GSR(ref local.InternalEncoding, @default.InternalEncoding, value, action));

            case "iconv.output_encoding":
                return(PhpIni.GSR(ref local.OutputEncoding, @default.OutputEncoding, value, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
예제 #3
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)
        {
            ZipLocalConfig  local    = (ZipLocalConfig)config.GetLibraryConfig(ZipLibraryDescriptor.Singleton);
            ZipLocalConfig  @default = DefaultLocal;
            ZipGlobalConfig global   = Global;

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

            //    // global:

            //}

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
예제 #4
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)
        {
            SQLiteLocalConfig  local    = (SQLiteLocalConfig)config.GetLibraryConfig(SQLiteLibraryDescriptor.Singleton);
            SQLiteLocalConfig  @default = DefaultLocal;
            SQLiteGlobalConfig global   = Global;

            switch (option)
            {
            // local:

            // global:
            case "sqlite.assoc_case":
                Debug.Assert(action == IniAction.Get);
                return(PhpIni.GSR(ref global.AssocCase, 0, value, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
예제 #5
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);
        }
예제 #6
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)
        {
            MySqlLocalConfig  local    = (MySqlLocalConfig)config.GetLibraryConfig(MySqlLibraryDescriptor.Singleton);
            MySqlLocalConfig  @default = DefaultLocal;
            MySqlGlobalConfig global   = Global;

            switch (option)
            {
            // local:

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

            case "mysql.default_port": return(PhpIni.GSR(ref local.Port, @default.Port, value, action));

            case "mysql.default_host": return(PhpIni.GSR(ref local.Server, @default.Server, value, action));

            case "mysql.default_user": return(PhpIni.GSR(ref local.User, @default.User, value, action));

            case "mysql.default_password": return(PhpIni.GSR(ref local.Password, @default.Password, value, action));

            case "mysql.default_command_timeout": return(PhpIni.GSR(ref local.DefaultCommandTimeout, @default.DefaultCommandTimeout, value, action));

            case "mysql.connection_string": return(PhpIni.GSR(ref local.ConnectionString, null, value, action));

            // global:

            case "mysql.max_links":
                Debug.Assert(action == IniAction.Get);
                return(PhpIni.GSR(ref global.MaxConnections, -1, null, action));

            case "mysql.max_pool_size":
                return(PhpIni.GSR(ref global.MaxPoolSize, 100, value, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
예제 #7
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)
        {
            LibraryConfiguration local    = (LibraryConfiguration)config.GetLibraryConfig(LibraryDescriptor.Singleton);
            LibraryConfiguration @default = DefaultLocal;

            switch (option)
            {
            case "sendmail_from": return(PhpIni.GSR(ref local.Mailer.DefaultFromHeader, @default.Mailer.DefaultFromHeader, value, action));

            case "SMTP": return(PhpIni.GSR(ref local.Mailer.SmtpServer, @default.Mailer.SmtpServer, value, action));

            case "smtp_port": return(PhpIni.GSR(ref local.Mailer.SmtpPort, @default.Mailer.SmtpPort, value, action));

            case "mail.add_x_header": return(PhpIni.GSR(ref local.Mailer.AddXHeader, @default.Mailer.AddXHeader, value, action));

            case "highlight.bg": return(PhpIni.GSR(ref local.Highlighting.Background, @default.Highlighting.Background, value, action));

            case "highlight.comment": return(PhpIni.GSR(ref local.Highlighting.Comment, @default.Highlighting.Comment, value, action));

            case "highlight.default": return(PhpIni.GSR(ref local.Highlighting.Default, @default.Highlighting.Default, value, action));

            case "highlight.html": return(PhpIni.GSR(ref local.Highlighting.Html, @default.Highlighting.Html, value, action));

            case "highlight.keyword": return(PhpIni.GSR(ref local.Highlighting.Keyword, @default.Highlighting.Keyword, value, action));

            case "highlight.string": return(PhpIni.GSR(ref local.Highlighting.String, @default.Highlighting.String, value, action));

            case "session.serialize_handler": return(PhpSession.GsrSerializer(local, @default, value, action));

            case "session.cache_expire": return(PhpSession.GsrCacheExpire(value, action));

            case "session.cache_limiter": return(PhpSession.GsrCacheLimiter(value, action));

            case "session.save_path": return(PhpIni.GSR(ref local.Session.SavePath, @default.Session.SavePath, value, action));

            case "session.gc_maxlifetime": return(PhpIni.GSR(ref local.Session.GcMaxLifetime, @default.Session.GcMaxLifetime, value, action));

            case "session.gc_probability": return(PhpIni.GSR(ref local.Session.GcProbability, @default.Session.GcProbability, value, action));

            case "session.gc_divisor": return(PhpIni.GSR(ref local.Session.GcDivisor, @default.Session.GcDivisor, value, action));

            case "session.cookie_lifetime": return(PhpSession.GsrCookieLifetime(value, action));

            case "session.cookie_path": return(PhpSession.GsrCookiePath(value, action));

            case "session.cookie_domain": return(PhpSession.GsrCookieDomain(value, action));

            case "session.cookie_secure": return(PhpSession.GsrCookieSecure(value, action));

            case "date.default_latitude": return(PhpIni.GSR(ref local.Date.Latitude, @default.Date.Latitude, value, action));

            case "date.default_longitude": return(PhpIni.GSR(ref local.Date.Longitude, @default.Date.Longitude, value, action));

            case "date.sunrise_zenith": return(PhpIni.GSR(ref local.Date.SunriseZenith, @default.Date.SunriseZenith, value, action));

            case "date.sunset_zenith": return(PhpIni.GSR(ref local.Date.SunsetZenith, @default.Date.SunsetZenith, value, action));

            case "date.timezone": return(PhpTimeZone.GsrTimeZone(local, @default, value, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }