C# Class Pchp.Library.Streams.PhpFilter

Base class for PHP stream filters.
Inheritance: IFilter
Show file Open project: iolevel/peachpie Class Usage Examples

Protected Properties

Property Type Description
parameters object

Private Properties

Property Type Description
GetFilter bool
MergeFilterNames Pchp.Core.PhpArray

Public Methods

Method Description
AddSystemFilter ( IFilterFactory factory ) : bool

Register a built-in stream filter factory.

AddUserFilter ( string filter, string classname ) : bool

Registers a user stream filter.

Filter ( Context ctx, TextElement input, bool closing ) : TextElement

Processes the input (either of type string or byte[]) data and returns the filtered data in one of the formats above or null.

GetFilterNames ( ) : PhpArray

Retrieves the list of registered filters.

OnClose ( ) : void

Called when the containig stream is being closed.

OnCreate ( ) : void

Called when the filter is attached to a stream.

PhpFilter ( object parameters ) : System

Creates a new instance of the PhpFilter.

Private Methods

Method Description
GetFilter ( string filter, bool instantiate, PhpFilter &instance, object parameters ) : bool

Searches for a filter implementation in the known PhpFilter descendants.

MergeFilterNames ( ICollection filterList, PhpArray rv ) : PhpArray

Merges the individual string[] into one PhpArray (numeric keys).

Method Details

AddSystemFilter() public static method

Register a built-in stream filter factory.
public static AddSystemFilter ( IFilterFactory factory ) : bool
factory IFilterFactory The filter factory.
return bool

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

Filter() public abstract method

Processes the input (either of type string or byte[]) data and returns the filtered data in one of the formats above or null.
public abstract Filter ( Context ctx, TextElement input, bool closing ) : TextElement
ctx Pchp.Core.Context
input TextElement
closing bool
return TextElement

GetFilterNames() public static method

Retrieves the list of registered filters.
public static GetFilterNames ( ) : PhpArray
return Pchp.Core.PhpArray

OnClose() public method

Called when the containig stream is being closed.
public OnClose ( ) : void
return void

OnCreate() public method

Called when the filter is attached to a stream.
public OnCreate ( ) : void
return void

PhpFilter() public method

Creates a new instance of the PhpFilter.
public PhpFilter ( object parameters ) : System
parameters object The parameters.
return System

Property Details

parameters protected property

An additional mixed parameter passed at stream_filter_append/prepend.
protected object parameters
return object