Pchp.Library.Streams.PhpFilter.AddUserFilter C# (CSharp) Method

AddUserFilter() public static method

Registers a user stream filter.
public static AddUserFilter ( string filter, string classname ) : bool
filter string The name of the filter (may contain wildcards).
classname string The PHP user class (derived from php_user_filter) implementing the filter.
return bool
        public static bool AddUserFilter(string filter, string classname)
        {
            // Note: have to check for wildcard conflicts too (?)
            PhpFilter instance;
            if (GetFilter(filter, false, out instance, null))
            {
                // EX: [PhpFilter.Register] stringtable - filter already exists, check the filter name string?
                return false;
            }

            // Check the given filter for validity?

            UserFilters.Add(filter, classname);
            return true;
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Registers a user stream filter.
        /// </summary>
        /// <param name="filter">The name of the filter (may contain wildcards).</param>
        /// <param name="classname">The PHP user class (derived from <c>php_user_filter</c>) implementing the filter.</param>
        /// <returns><c>true</c> if the filter was succesfully added, <c>false</c> if the filter of such name already exists.</returns>
        public static bool stream_filter_register(string filter, string classname)
        {
            // EX: [stream_filter_register]

            return(PhpFilter.AddUserFilter(filter, classname));
        }