index.php 1.24 KB
Newer Older
1
<?php
2 3 4 5 6
/**
 * @var YiiRequirementChecker $this
 * @var array $summary
 * @var array[] $requirements
 */
7 8 9 10 11 12 13 14

echo "\nYii Application Requirement Checker\n\n";

echo "This script checks if your server configuration meets the requirements\n";
echo "for running Yii application.\n";
echo "It checks if the server is running the right version of PHP,\n";
echo "if appropriate PHP extensions have been loaded, and if php.ini file settings are correct.\n";

15 16 17 18 19
$header = 'Check conclusion:';
echo "\n{$header}\n";
echo str_pad('', strlen($header), '-')."\n\n";

foreach ($requirements as $key => $requirement) {
20 21 22 23 24 25 26 27 28 29 30 31
    if ($requirement['condition']) {
        echo $requirement['name'].": OK\n";
        echo "\n";
    } else {
        echo $requirement['name'].': '.($requirement['mandatory'] ? 'FAILED!!!' : 'WARNING!!!')."\n";
        echo 'Required by: '.strip_tags($requirement['by'])."\n";
        $memo = strip_tags($requirement['memo']);
        if (!empty($memo)) {
            echo 'Memo: '.strip_tags($requirement['memo'])."\n";
        }
        echo "\n";
    }
32 33 34
}

$summaryString = 'Errors: '.$summary['errors'].'   Warnings: '.$summary['warnings'].'   Total checks: '.$summary['total'];
35
echo str_pad('', strlen($summaryString), '-')."\n";
36 37
echo $summaryString;

Alexander Makarov committed
38
echo "\n\n";