Documentation

RequirementCollection
in package
implements IteratorAggregate

A RequirementCollection represents a set of Requirement instances.

Tags
author

Tobias Schultze http://tobion.de

Table of Contents

Interfaces

IteratorAggregate

Properties

$requirements  : array<string|int, Requirement>

Methods

add()  : mixed
Adds a Requirement.
addCollection()  : mixed
Adds a requirement collection to the current set of requirements.
addPhpIniRecommendation()  : mixed
Adds an optional recommendation in form of a php.ini configuration.
addPhpIniRequirement()  : mixed
Adds a mandatory requirement in form of a php.ini configuration.
addRecommendation()  : mixed
Adds an optional recommendation.
addRequirement()  : mixed
Adds a mandatory requirement.
all()  : array<string|int, Requirement>
Returns both requirements and recommendations.
getFailedRecommendations()  : array<string|int, Requirement>
Returns the recommendations that were not met.
getFailedRequirements()  : array<string|int, Requirement>
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<string|int, Requirement>
Returns all optional recommendations.
getRequirements()  : array<string|int, Requirement>
Returns all mandatory requirements.
hasPhpIniConfigIssue()  : bool
Returns whether a php.ini configuration is not correct.

Properties

Methods

addPhpIniRecommendation()

Adds an optional recommendation in form of a php.ini configuration.

public addPhpIniRecommendation(string $cfgName, bool|callable $evaluation[, bool $approveCfgAbsence = false ][, string $testMessage = null ][, string $helpHtml = null ][, string|null $helpText = null ]) : mixed
Parameters
$cfgName : string

The configuration name used for ini_get()

$evaluation : bool|callable

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 : bool = false

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 = null

The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)

$helpHtml : string = null

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 = null

The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

addPhpIniRequirement()

Adds a mandatory requirement in form of a php.ini configuration.

public addPhpIniRequirement(string $cfgName, bool|callable $evaluation[, bool $approveCfgAbsence = false ][, string $testMessage = null ][, string $helpHtml = null ][, string|null $helpText = null ]) : mixed
Parameters
$cfgName : string

The configuration name used for ini_get()

$evaluation : bool|callable

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 : bool = false

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 = null

The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)

$helpHtml : string = null

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 = null

The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

addRecommendation()

Adds an optional recommendation.

public addRecommendation(bool $fulfilled, string $testMessage, string $helpHtml[, string|null $helpText = null ]) : mixed
Parameters
$fulfilled : bool

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 = null

The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

addRequirement()

Adds a mandatory requirement.

public addRequirement(bool $fulfilled, string $testMessage, string $helpHtml[, string|null $helpText = null ]) : mixed
Parameters
$fulfilled : bool

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 = null

The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)

getIterator()

Gets the current RequirementCollection as an Iterator.

public getIterator() : Traversable
Return values
Traversable

A Traversable interface

getPhpIniConfigPath()

Returns the PHP configuration file (php.ini) path.

public getPhpIniConfigPath() : string|false
Return values
string|false

php.ini file path

hasPhpIniConfigIssue()

Returns whether a php.ini configuration is not correct.

public hasPhpIniConfigIssue() : bool
Return values
bool

php.ini configuration problem?


        
On this page

Search results