Exemple #1
0
            /// <summary>
            /// Registers legacy ini-options.
            /// </summary>
            internal static void RegisterLegacyOptions()
            {
                var d = new GetSetDelegate(GetSet);

                //Register("mbstring.internal_encoding", IniFlags.Supported | IniFlags.Local, d, s);
                Register("mbstring.func_overload", IniFlags.Supported | IniFlags.Local, d, MultiByteString.ExtensionName);
            }
        /// <summary>
        /// Registers legacy ini-options.
        /// </summary>
        internal static void RegisterLegacyOptions()
        {
            const string s = "mysql";
            var          d = new GetSetDelegate(GetSet);

            // local:
            Register("mysql.trace_mode", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mysqli.default_port", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.default_port", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysqli.default_socket", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mysql.default_socket", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mysqli.default_host", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.default_host", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysqli.default_user", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.default_user", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysqli.default_pw", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.default_password", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.connect_timeout", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.default_command_timeout", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mysql.connection_string", IniFlags.Supported | IniFlags.Local, d, s);

            // global:
            Register("mysql.allow_persistent", IniFlags.Unsupported | IniFlags.Global, d, s);
            Register("mysql.max_persistent", IniFlags.Unsupported | IniFlags.Global, d, s);
            Register("mysql.max_links", IniFlags.Supported | IniFlags.Global, d, s);
            Register("mysql.max_pool_size", IniFlags.Supported | IniFlags.Global, d, s);
        }
Exemple #3
0
            /// <summary>
            /// Registers legacy ini-options.
            /// </summary>
            static void RegisterLegacyOptions()
            {
                const string   s = "zlib";
                GetSetDelegate d = new GetSetDelegate(GetSet);

                Register("zlib.output_compression", IniFlags.Supported | IniFlags.Global, d, s);
                Register("zlib.output_compression_level", IniFlags.Supported | IniFlags.Global, d, s);
                Register("zlib.output_handler", IniFlags.Supported | IniFlags.Global, d, s);
            }
Exemple #4
0
            /// <summary>
            /// Registers legacy ini-options.
            /// </summary>
            internal static void RegisterLegacyOptions()
            {
                const string   s = "iconv";
                GetSetDelegate d = new GetSetDelegate(GetSet);

                Register("iconv.input_encoding", IniFlags.Supported | IniFlags.Local, d, s);
                Register("iconv.internal_encoding", IniFlags.Supported | IniFlags.Local, d, s);
                Register("iconv.output_encoding", IniFlags.Supported | IniFlags.Local, d, s);
            }
Exemple #5
0
        /// <summary>
        /// Registeres a standard configuration option.
        /// Not thread safe.
        /// </summary>
        /// <param name="name">A case-sensitive unique option name.</param>
        /// <param name="flags">Flags.</param>
        /// <param name="gsr">A delegate pointing to a method which will perform option's value getting, setting, and restoring.</param>
        /// <param name="extension">A case-sensitive name of the extension which the option belongs to. Can be a <B>null</B> reference.</param>
        /// <remarks>
        /// Registered options are known to <c>ini_get</c>, <c>ini_set</c>, and <c>ini_restore</c> PHP functions.
        /// </remarks>
        /// <exception cref="ArgumentNullException"><paramref name="name"/> is a <B>null</B> reference.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="gsr"/> is a <B>null</B> reference.</exception>
        /// <exception cref="ArgumentException">An option with specified name has already been registered.</exception>
        public static void Register(string name, IniFlags flags, GetSetDelegate gsr, string extension = null)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (gsr == null)
            {
                throw new ArgumentNullException(nameof(gsr));
            }

            _options.Add(name, new OptionDefinition(flags, gsr, extension));
        }
Exemple #6
0
            public Registrator()
            {
                Context.RegisterConfiguration <IPhpSessionConfiguration>(new SessionConfiguration());

                GetSetDelegate gsrsession = SessionConfiguration.Gsr;

                Register("session.auto_start", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
                Register("session.save_handler", IniFlags.Supported | IniFlags.Local | IniFlags.Http, gsrsession);
                Register("session.serialize_handler", IniFlags.Supported | IniFlags.Local | IniFlags.Http, gsrsession);
                Register("session.name", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
                Register("session.cookie_lifetime", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
                Register("session.cookie_path", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
                Register("session.cookie_domain", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
                Register("session.cookie_secure", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
                Register("session.cookie_httponly", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
            }
Exemple #7
0
        /// <summary>
        /// Registers legacy ini-options.
        /// </summary>
        internal static void RegisterLegacyOptions()
        {
            const string s = "mssql";
            var          d = new GetSetDelegate(GetSet);

            // global:
            Register("mssql.max_links", IniFlags.Supported | IniFlags.Global, d, s);
            Register("mssql.secure_connection", IniFlags.Supported | IniFlags.Global, d, s);
            Register("mssql.allow_persistent", IniFlags.Unsupported | IniFlags.Global, d, s);
            Register("mssql.max_persistent", IniFlags.Unsupported | IniFlags.Global, d, s);

            // local:
            Register("mssql.connect_timeout", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mssql.timeout", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mssql.batchsize", IniFlags.Supported | IniFlags.Local, d, s);
            Register("mssql.min_error_severity", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mssql.min_message_severity", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mssql.compatability_mode", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mssql.textsize", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mssql.textlimit", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mssql.datetimeconvert", IniFlags.Unsupported | IniFlags.Local, d, s);
            Register("mssql.max_procs", IniFlags.Unsupported | IniFlags.Local, d, s);
        }
Exemple #8
0
 internal OptionDefinition(IniFlags flags, GetSetDelegate gsr, string extension)
 {
     this.Flags     = flags;
     this.Gsr       = gsr;
     this.Extension = extension;
 }
Exemple #9
0
        static void RegisterStandard()
        {
            // single instances of the delegate:
            var gsrcore    = new GetSetDelegate(GsrCore);
            var gsrsession = new GetSetDelegate(GsrSession);
            var gsrmail    = new GetSetDelegate(GsrMail);

            //

            Register("allow_call_time_pass_reference", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("allow_url_fopen", IniFlags.Supported | IniFlags.Local, gsrcore);
            Register("allow_webdav_methods", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("always_populate_raw_post_data", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("arg_separator.input", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("arg_separator.output", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("asp_tags", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("assert.active", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("assert.bail", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("assert.callback", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("assert.quiet_eval", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("assert.warning", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("async_send", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("auto_append_file", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("auto_detect_line_endings", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("auto_prepend_file", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("browscap", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("cgi.force_redirect", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("cgi.redirect_status_env", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("cgi.rfc2616_headers", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("child_terminate", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("debugger.enabled", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("debugger.host", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("debugger.port", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("default_charset", IniFlags.Supported | IniFlags.Local | IniFlags.Http, s_emptyGsr);
            Register("default_mimetype", IniFlags.Supported | IniFlags.Local | IniFlags.Http, s_emptyGsr);
            Register("default_socket_timeout", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("define_syslog_variables", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("disable_classes", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("disable_functions", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("display_errors", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("display_startup_errors", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("doc_root", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("enable_dl", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("engine", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("error_append_string", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("error_log", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("error_prepend_string", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("error_reporting", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("expose_php", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("extension_dir", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("fastcgi.impersonate", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("file_uploads", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("from", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("gpc_order", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("html_errors", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("docref_root", IniFlags.Supported | IniFlags.Local, gsrcore);
            Register("docref_ext", IniFlags.Supported | IniFlags.Local, gsrcore);
            Register("ignore_repeated_errors", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("ignore_repeated_source", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("ignore_user_abort", IniFlags.Supported | IniFlags.Local | IniFlags.Http, s_emptyGsr);
            Register("implicit_flush", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("include_path", IniFlags.Supported | IniFlags.Local, gsrcore);
            Register("last_modified", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("log_errors", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("log_errors_max_len", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("magic_quotes_gpc", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("magic_quotes_runtime", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("magic_quotes_sybase", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("max_execution_time", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("max_input_time", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("memory_limit", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("mime_magic.magicfile", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("open_basedir", IniFlags.Supported | IniFlags.Global, gsrcore);
            Register("output_buffering", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("output_handler", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("post_max_size", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrcore);
            Register("precision", IniFlags.Supported | IniFlags.Local, gsrcore);
            Register("register_argc_argv", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("register_globals", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("register_long_arrays", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("report_memleaks", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("safe_mode", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("safe_mode_allowed_env_vars", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("safe_mode_exec_dir", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("safe_mode_gid", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("safe_mode_include_dir", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("safe_mode_protected_env_vars", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("session.auto_start", IniFlags.Supported | IniFlags.Global | IniFlags.Http, s_emptyGsr);
            Register("session.save_handler", IniFlags.Supported | IniFlags.Local | IniFlags.Http, s_emptyGsr);
            Register("session.serialize_handler", IniFlags.Supported | IniFlags.Local | IniFlags.Http, gsrsession);
            Register("session.name", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrsession);
            Register("short_open_tag", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("sql.safe_mode", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("track_errors", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("unserialize_callback_func", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("upload_max_filesize", IniFlags.Supported | IniFlags.Global | IniFlags.Http, gsrcore);
            Register("upload_tmp_dir", IniFlags.Supported | IniFlags.Global, s_emptyGsr);
            Register("url_rewriter.tags", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("user_agent", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("user_dir", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("variables_order", IniFlags.Supported | IniFlags.Local, s_emptyGsr);
            Register("warn_plus_overloading", IniFlags.Unsupported | IniFlags.Global, s_emptyGsr);
            Register("xbithack", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("y2k_compliance", IniFlags.Unsupported | IniFlags.Local, s_emptyGsr);
            Register("zend.ze1_compatibility_mode", IniFlags.Supported | IniFlags.Local, s_emptyGsr);

            // mail
            Register("SMTP", IniFlags.Supported | IniFlags.Local, gsrmail);
            Register("smtp_port", IniFlags.Supported | IniFlags.Local, gsrmail);
            Register("sendmail_from", IniFlags.Supported | IniFlags.Local, gsrmail);
            Register("mail.add_x_header", IniFlags.Supported | IniFlags.Local, gsrmail);
            Register("mail.force_extra_parameters", IniFlags.Supported | IniFlags.Local, gsrmail);
        }
Exemple #10
0
        public static void FastSetValue <T>(this PropertyInfo property, T t, object value)
        {
            MethodInfo m = property.GetSetMethod();

            GetSetDelegate <T>(m, property.PropertyType)(t, m, value);
        }