5
return !isset($_SERVER['HTTP_HOST']);
9
* Checks a configuration.
11
function check($boolean, $message, $help = '', $fatal = false)
13
echo $boolean ? " OK " : sprintf("[[%s]] ", $fatal ? ' ERROR ' : 'WARNING');
14
echo sprintf("$message%s\n", $boolean ? '' : ': FAILED');
18
echo " *** $help ***\n";
21
die("You must fix this problem before resuming the check.\n");
27
* Gets the php.ini path used by the current PHP interpretor.
29
* @return string the php.ini path
31
function get_ini_path()
33
if ($path = get_cfg_var('cfg_file_path'))
38
return 'WARNING: not using a php.ini file';
43
echo '<html><body><pre>';
46
echo "********************************\n";
48
echo "* symfony requirements check *\n";
50
echo "********************************\n\n";
52
echo sprintf("php.ini used by PHP: %s\n\n", get_ini_path());
56
echo "** WARNING **\n";
57
echo "* The PHP CLI can use a different php.ini file\n";
58
echo "* than the one used with your web server.\n";
59
if ('\\' == DIRECTORY_SEPARATOR)
61
echo "* (especially on the Windows platform)\n";
63
echo "* If this is the case, please launch this\n";
64
echo "* utility from your web server.\n";
65
echo "** WARNING **\n";
69
echo "\n** Mandatory requirements **\n\n";
70
check(version_compare(phpversion(), '5.2.4', '>='), sprintf('PHP version is at least 5.2.4 (%s)', phpversion()), 'Current version is '.phpversion(), true);
73
echo "\n** Optional checks **\n\n";
74
check(class_exists('PDO'), 'PDO is installed', 'Install PDO (mandatory for Propel and Doctrine)', false);
75
if (class_exists('PDO'))
77
$drivers = PDO::getAvailableDrivers();
78
check(count($drivers), 'PDO has some drivers installed: '.implode(', ', $drivers), 'Install PDO drivers (mandatory for Propel and Doctrine)');
80
check(class_exists('DomDocument'), 'PHP-XML module is installed', 'Install and enable the php-xml module (required by Propel)', false);
81
check(class_exists('XSLTProcessor'), 'XSL module is installed', 'Install and enable the XSL module (recommended for Propel)', false);
82
check(function_exists('token_get_all'), 'The token_get_all() function is available', 'Install and enable the Tokenizer extension (highly recommended)', false);
83
check(function_exists('mb_strlen'), 'The mb_strlen() function is available', 'Install and enable the mbstring extension', false);
84
check(function_exists('iconv'), 'The iconv() function is available', 'Install and enable the iconv extension', false);
85
check(function_exists('utf8_decode'), 'The utf8_decode() is available', 'Install and enable the XML extension', false);
86
check(function_exists('posix_isatty'), 'The posix_isatty() is available', 'Install and enable the php_posix extension (used to colorized the CLI output)', false);
89
(function_exists('apc_store') && ini_get('apc.enabled'))
91
function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
93
function_exists('xcache_set')
95
check($accelerator, 'A PHP accelerator is installed', 'Install a PHP accelerator like APC (highly recommended)', false);
97
check(!ini_get('short_open_tag'), 'php.ini has short_open_tag set to off', 'Set it to off in php.ini', false);
98
check(!ini_get('magic_quotes_gpc'), 'php.ini has magic_quotes_gpc set to off', 'Set it to off in php.ini', false);
99
check(!ini_get('register_globals'), 'php.ini has register_globals set to off', 'Set it to off in php.ini', false);
100
check(!ini_get('session.auto_start'), 'php.ini has session.auto_start set to off', 'Set it to off in php.ini', false);
102
check(version_compare(phpversion(), '5.2.9', '!='), 'PHP version is not 5.2.9', 'PHP 5.2.9 broke array_unique() and sfToolkit::arrayDeepMerge(). Use 5.2.10 instead [Ticket #6211]', false);
106
echo '</pre></body></html>';