PHP Class Ingo_Script_Base, horde

Author: Brent J. Nordquist ([email protected])
Author: Jan Schneider ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_actions array This SHOULD be defined in each subclass.
$_categories array This SHOULD be defined in each subclass.
$_categoryFeatures array This is an associative array with the keys taken from $_actions, each value is a list of strings with the supported feature names. An absent key is interpreted as "all features supported".
$_features array A list of driver features.
$_generated boolean Have the recipes been generated yet?
$_params array The script class' additional parameters.
$_recipes array The recipes that make up the code.
$_special_types array A list of any special types that this driver supports.
$_tests array This SHOULD be defined in each subclass.
$_types array This SHOULD be defined in each subclass.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
activate ( boolean $activate = true, boolean $auto_update = true ) Connects to the backend, uploads the scripts and sets them active.
availableActions ( ) : array Returns the available actions for this driver.
availableCategories ( ) : array Returns the available categories for this driver.
availableCategoryFeatures ( $category ) : array Returns the supported form fields for this driver.
availableTests ( ) : array Returns the available tests for this driver.
availableTypes ( ) : array Returns the available test types for this driver.
canPerform ( ) : boolean Is the perform() function available right now?
excludeRegexp ( ) : string Returns a regular expression that should catch mails coming from most daemons, mailing list, newsletters, and other bulk.
generate ( ) : array Generates the scripts to do the filtering specified in the rules.
hasFeature ( string $feature ) : boolean Returns whether the script driver supports a certain feature.
perform ( integer $change = null ) Performs the filtering specified in the rules.
setParams ( array $params = [] ) : Ingo_Script Updates the parameters.
specialTypes ( ) : array Returns any test types that are special for this driver.

Protected Methods

Method Description
_addItem ( integer $rule, Ingo_Script_Item $item, string $name = null ) Adds an item to the recipe list.
_generate ( ) Generates the scripts to do the filtering specified in the rules.
_insertItem ( integer $rule, Ingo_Script_Item $item, string $name = null, $position ) Inserts an item into the recipe list.
_perform ( $change )
_validRule ( Ingo_Rule $rule ) : boolean Is this a valid rule?

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array A hash containing parameters needed.

_addItem() protected method

Adds an item to the recipe list.
protected _addItem ( integer $rule, Ingo_Script_Item $item, string $name = null )
$rule integer One of the Ingo::RULE_* constants.
$item Ingo_Script_Item An item to add to the recipe list.
$name string A script name.

_generate() protected method

Generates the scripts to do the filtering specified in the rules.
protected _generate ( )

_insertItem() protected method

Inserts an item into the recipe list.
protected _insertItem ( integer $rule, Ingo_Script_Item $item, string $name = null, $position )
$rule integer One of the Ingo::RULE_* constants.
$item Ingo_Script_Item An item to add to the recipe list.
$name string A script name.

_perform() protected method

See also: perform()
protected _perform ( $change )

_validRule() protected method

Is this a valid rule?
protected _validRule ( Ingo_Rule $rule ) : boolean
$rule Ingo_Rule The rule object.
return boolean Whether the rule is valid for this driver.

activate() public method

Connects to the backend, uploads the scripts and sets them active.
public activate ( boolean $activate = true, boolean $auto_update = true )
$activate boolean Activate the script?
$auto_update boolean Only update if auto_update is active?

availableActions() public method

Returns the available actions for this driver.
public availableActions ( ) : array
return array The list of available actions.

availableCategories() public method

Returns the available categories for this driver.
public availableCategories ( ) : array
return array The list of categories.

availableCategoryFeatures() public method

Returns the supported form fields for this driver.
public availableCategoryFeatures ( $category ) : array
return array An array with the supported field names of the requested category.

availableTests() public method

Returns the available tests for this driver.
public availableTests ( ) : array
return array The list of tests actions.

availableTypes() public method

Returns the available test types for this driver.
public availableTypes ( ) : array
return array The list of test types.

canPerform() public method

This is not a duplication of hasFeature() because drivers might override this to do real-time checks if on-demand filtering is not only available theoretically but practically in this very moment.
public canPerform ( ) : boolean
return boolean True if perform() is available, false if not.

excludeRegexp() public method

This is the expression used for procmail's FROM_DAEMON, including all mailinglist headers.
public excludeRegexp ( ) : string
return string A regular expression.

generate() public method

Generates the scripts to do the filtering specified in the rules.
public generate ( ) : array
return array The scripts.

hasFeature() public method

Returns whether the script driver supports a certain feature.
public hasFeature ( string $feature ) : boolean
$feature string A feature name.
return boolean True if this feature is supported.

perform() public method

Performs the filtering specified in the rules.
public perform ( integer $change = null )
$change integer The timestamp of the latest rule change during the current session (uses session value if null).

setParams() public method

Updates the parameters.
public setParams ( array $params = [] ) : Ingo_Script
$params array A hash containing parameters.
return Ingo_Script This object, for chaining.

specialTypes() public method

Returns any test types that are special for this driver.
public specialTypes ( ) : array
return array The list of special types

Property Details

$_actions protected_oe property

This SHOULD be defined in each subclass.
protected array $_actions
return array

$_categories protected_oe property

This SHOULD be defined in each subclass.
protected array $_categories
return array

$_categoryFeatures protected_oe property

This is an associative array with the keys taken from $_actions, each value is a list of strings with the supported feature names. An absent key is interpreted as "all features supported".
protected array $_categoryFeatures
return array

$_features protected_oe property

A list of driver features.
protected array $_features
return array

$_generated protected_oe property

Have the recipes been generated yet?
protected bool $_generated
return boolean

$_params protected_oe property

The script class' additional parameters.
protected array $_params
return array

$_recipes protected_oe property

The recipes that make up the code.
protected array $_recipes
return array

$_special_types protected_oe property

A list of any special types that this driver supports.
protected array $_special_types
return array

$_tests protected_oe property

This SHOULD be defined in each subclass.
protected array $_tests
return array

$_types protected_oe property

This SHOULD be defined in each subclass.
protected array $_types
return array