91b826befe148e9420093fc034522ad714970c30
3 require_once dirname(__FILE__
).'/SymfonyRequirements.php';
5 $symfonyRequirements = new SymfonyRequirements();
7 $iniPath = $symfonyRequirements->getPhpIniConfigPath();
9 echo "********************************\n";
11 echo "* Symfony requirements check *\n";
13 echo "********************************\n\n";
15 echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";
17 echo "** ATTENTION **\n";
18 echo "* The PHP CLI can use a different php.ini file\n";
19 echo "* than the one used with your web server.\n";
20 if ('\\' == DIRECTORY_SEPARATOR
) {
21 echo "* (especially on the Windows platform)\n";
23 echo "* To be on the safe side, please also launch the requirements check\n";
24 echo "* from your web server using the web/config.php script.\n";
26 echo_title('Mandatory requirements');
29 foreach ($symfonyRequirements->getRequirements() as $req) {
30 /** @var $req Requirement */
31 echo_requirement($req);
32 if (!$req->isFulfilled()) {
37 echo_title('Optional recommendations');
39 foreach ($symfonyRequirements->getRecommendations() as $req) {
40 echo_requirement($req);
43 exit($checkPassed ? 0 : 1);
46 * Prints a Requirement instance
48 function echo_requirement(Requirement
$requirement)
50 $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
51 echo ' ' . str_pad($result, 9);
52 echo $requirement->getTestMessage() . "\n";
54 if (!$requirement->isFulfilled()) {
55 echo sprintf(" %s\n\n", $requirement->getHelpText());
59 function echo_title($title)
61 echo "\n** $title **\n\n";