This class allows rendering of the check report for the web and console application interface.
Example:
php
require_once('path/to/YiiRequirementChecker.php');
$requirementsChecker = new YiiRequirementChecker();
$requirements = array(
array(
'name' => 'PHP Some Extension',
'mandatory' => true,
'condition' => extension_loaded('some_extension'),
'by' => 'Some application feature',
'memo' => 'PHP extension "some_extension" required',
),
);
$requirementsChecker->checkYii()->check($requirements)->render();
If you wish to render the report with your own representation, use YiiRequirementChecker::getResult instead of YiiRequirementChecker::render
Requirement condition could be in format "eval:PHP expression".
In this case specified PHP expression will be evaluated in the context of this class instance.
For example:
php
$requirements = array(
array(
'name' => 'Upload max file size',
'condition' => 'eval:$this->checkUploadMaxFileSize("5M")',
),
);
Note: this class definition does not match ordinary Yii style, because it should match PHP 4.3
and should not use features from newer PHP versions!