PHP Class Ingo_Script_Base, horde

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

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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

_addItem() protected méthode

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 méthode

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

_insertItem() protected méthode

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 méthode

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

_validRule() protected méthode

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

activate() public méthode

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 méthode

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

availableCategories() public méthode

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

availableCategoryFeatures() public méthode

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

availableTests() public méthode

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

availableTypes() public méthode

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

canPerform() public méthode

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
Résultat boolean True if perform() is available, false if not.

excludeRegexp() public méthode

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

generate() public méthode

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

hasFeature() public méthode

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

perform() public méthode

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 méthode

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

specialTypes() public méthode

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

Property Details

$_actions protected_oe property

This SHOULD be defined in each subclass.
protected array $_actions
Résultat array

$_categories protected_oe property

This SHOULD be defined in each subclass.
protected array $_categories
Résultat 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
Résultat array

$_features protected_oe property

A list of driver features.
protected array $_features
Résultat array

$_generated protected_oe property

Have the recipes been generated yet?
protected bool $_generated
Résultat boolean

$_params protected_oe property

The script class' additional parameters.
protected array $_params
Résultat array

$_recipes protected_oe property

The recipes that make up the code.
protected array $_recipes
Résultat array

$_special_types protected_oe property

A list of any special types that this driver supports.
protected array $_special_types
Résultat array

$_tests protected_oe property

This SHOULD be defined in each subclass.
protected array $_tests
Résultat array

$_types protected_oe property

This SHOULD be defined in each subclass.
protected array $_types
Résultat array