PHP 클래스 RequirementCollection

상속: implements IteratorAggregate
파일 보기 프로젝트 열기: pagekit/pagekit 1 사용 예제들

공개 메소드들

메소드 설명
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.

메소드 상세

add() 공개 메소드

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

addCollection() 공개 메소드

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

addPhpIniRecommendation() 공개 메소드

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() 공개 메소드

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() 공개 메소드

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() 공개 메소드

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() 공개 메소드

Returns both requirements and recommendations.
public all ( ) : array
리턴 array Array of Requirement instances

getFailedRecommendations() 공개 메소드

Returns the recommendations that were not met.
public getFailedRecommendations ( ) : array
리턴 array Array of Requirement instances

getFailedRequirements() 공개 메소드

Returns the mandatory requirements that were not met.
public getFailedRequirements ( ) : array
리턴 array Array of Requirement instances

getIterator() 공개 메소드

Gets the current RequirementCollection as an Iterator.
public getIterator ( ) : Traversable
리턴 Traversable A Traversable interface

getPhpIniConfigPath() 공개 메소드

Returns the PHP configuration file (php.ini) path.
public getPhpIniConfigPath ( ) : string | false
리턴 string | false php.ini file path

getRecommendations() 공개 메소드

Returns all optional recommmendations.
public getRecommendations ( ) : array
리턴 array Array of Requirement instances

getRequirements() 공개 메소드

Returns all mandatory requirements.
public getRequirements ( ) : array
리턴 array Array of Requirement instances

hasPhpIniConfigIssue() 공개 메소드

Returns whether a php.ini configuration is not correct.
public hasPhpIniConfigIssue ( ) : boolean
리턴 boolean php.ini configuration problem?