PHP Class RequirementCollection

Inheritance: implements IteratorAggregate
Afficher le fichier Open project: pagekit/pagekit Class Usage Examples

Méthodes publiques

Méthode Description
add ( Requirement $requirement ) Adds a Requirement.
addCollection ( RequirementCollection $collection ) Adds a requirement collection to the current set of requirements.
addPhpIniRecommendation ( string $cfgName, boolean | callback $evaluation, boolean $approveCfgAbsence = false, string $testMessage = null, string $helpHtml = null, string | null $helpText = null ) Adds an optional recommendation in form of a php.ini configuration.
addPhpIniRequirement ( string $cfgName, boolean | callback $evaluation, boolean $approveCfgAbsence = false, string $testMessage = null, string $helpHtml = null, string | null $helpText = null ) Adds a mandatory requirement in form of a php.ini configuration.
addRecommendation ( boolean $fulfilled, string $testMessage, string $helpHtml, string | null $helpText = null ) Adds an optional recommendation.
addRequirement ( boolean $fulfilled, string $testMessage, string $helpHtml, string | null $helpText = null ) Adds a mandatory requirement.
all ( ) : array Returns both requirements and recommendations.
getFailedRecommendations ( ) : array Returns the recommendations that were not met.
getFailedRequirements ( ) : array Returns the mandatory requirements that were not met.
getIterator ( ) : Traversable Gets the current RequirementCollection as an Iterator.
getPhpIniConfigPath ( ) : string | false Returns the PHP configuration file (php.ini) path.
getRecommendations ( ) : array Returns all optional recommmendations.
getRequirements ( ) : array Returns all mandatory requirements.
hasPhpIniConfigIssue ( ) : boolean Returns whether a php.ini configuration is not correct.

Method Details

add() public méthode

Adds a Requirement.
public add ( Requirement $requirement )
$requirement Requirement A Requirement instance

addCollection() public méthode

Adds a requirement collection to the current set of requirements.
public addCollection ( RequirementCollection $collection )
$collection RequirementCollection A RequirementCollection instance

addPhpIniRecommendation() public méthode

Adds an optional recommendation in form of a php.ini configuration.
public addPhpIniRecommendation ( string $cfgName, boolean | callback $evaluation, boolean $approveCfgAbsence = false, string $testMessage = null, string $helpHtml = null, string | null $helpText = null )
$cfgName string The configuration name used for ini_get()
$evaluation boolean | callback Either a Boolean indicating whether the configuration should evaluate to true or false, or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
$approveCfgAbsence boolean If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
$testMessage string The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
$helpHtml string The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
$helpText string | null The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

addPhpIniRequirement() public méthode

Adds a mandatory requirement in form of a php.ini configuration.
public addPhpIniRequirement ( string $cfgName, boolean | callback $evaluation, boolean $approveCfgAbsence = false, string $testMessage = null, string $helpHtml = null, string | null $helpText = null )
$cfgName string The configuration name used for ini_get()
$evaluation boolean | callback Either a Boolean indicating whether the configuration should evaluate to true or false, or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
$approveCfgAbsence boolean If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
$testMessage string The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
$helpHtml string The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
$helpText string | null The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

addRecommendation() public méthode

Adds an optional recommendation.
public addRecommendation ( boolean $fulfilled, string $testMessage, string $helpHtml, string | null $helpText = null )
$fulfilled boolean Whether the recommendation is fulfilled
$testMessage string The message for testing the recommendation
$helpHtml string The help text formatted in HTML for resolving the problem
$helpText string | null The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

addRequirement() public méthode

Adds a mandatory requirement.
public addRequirement ( boolean $fulfilled, string $testMessage, string $helpHtml, string | null $helpText = null )
$fulfilled boolean Whether the requirement is fulfilled
$testMessage string The message for testing the requirement
$helpHtml string The help text formatted in HTML for resolving the problem
$helpText string | null The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

all() public méthode

Returns both requirements and recommendations.
public all ( ) : array
Résultat array Array of Requirement instances

getFailedRecommendations() public méthode

Returns the recommendations that were not met.
public getFailedRecommendations ( ) : array
Résultat array Array of Requirement instances

getFailedRequirements() public méthode

Returns the mandatory requirements that were not met.
public getFailedRequirements ( ) : array
Résultat array Array of Requirement instances

getIterator() public méthode

Gets the current RequirementCollection as an Iterator.
public getIterator ( ) : Traversable
Résultat Traversable A Traversable interface

getPhpIniConfigPath() public méthode

Returns the PHP configuration file (php.ini) path.
public getPhpIniConfigPath ( ) : string | false
Résultat string | false php.ini file path

getRecommendations() public méthode

Returns all optional recommmendations.
public getRecommendations ( ) : array
Résultat array Array of Requirement instances

getRequirements() public méthode

Returns all mandatory requirements.
public getRequirements ( ) : array
Résultat array Array of Requirement instances

hasPhpIniConfigIssue() public méthode

Returns whether a php.ini configuration is not correct.
public hasPhpIniConfigIssue ( ) : boolean
Résultat boolean php.ini configuration problem?