openscrum/app/check.php

56 lines
1.6 KiB
PHP
Raw Permalink Normal View History

<?php
2013-03-02 22:08:14 +00:00
require_once dirname(__FILE__).'/SymfonyRequirements.php';
$symfonyRequirements = new SymfonyRequirements();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
echo "********************************\n";
echo "* *\n";
echo "* Symfony requirements check *\n";
echo "* *\n";
echo "********************************\n\n";
2013-03-02 22:08:14 +00:00
echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";
echo "** ATTENTION **\n";
echo "* The PHP CLI can use a different php.ini file\n";
echo "* than the one used with your web server.\n";
if ('\\' == DIRECTORY_SEPARATOR) {
echo "* (especially on the Windows platform)\n";
}
2013-03-02 22:08:14 +00:00
echo "* To be on the safe side, please also launch the requirements check\n";
echo "* from your web server using the web/config.php script.\n";
2013-03-02 22:08:14 +00:00
echo_title('Mandatory requirements');
2013-03-02 22:08:14 +00:00
foreach ($symfonyRequirements->getRequirements() as $req) {
echo_requirement($req);
}
2013-03-02 22:08:14 +00:00
echo_title('Optional recommendations');
2013-03-02 22:08:14 +00:00
foreach ($symfonyRequirements->getRecommendations() as $req) {
echo_requirement($req);
}
/**
2013-03-02 22:08:14 +00:00
* Prints a Requirement instance
*/
2013-03-02 22:08:14 +00:00
function echo_requirement(Requirement $requirement)
{
2013-03-02 22:08:14 +00:00
$result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
echo ' ' . str_pad($result, 9);
echo $requirement->getTestMessage() . "\n";
2013-03-02 22:08:14 +00:00
if (!$requirement->isFulfilled()) {
echo sprintf(" %s\n\n", $requirement->getHelpText());
}
}
function echo_title($title)
{
echo "\n** $title **\n\n";
}