Esempio n. 1
0
echo $f->show(sprintf('SAPI: %s', php_sapi_name()));
echo $f->show(sprintf('PHP Version: %s', PHP_VERSION));
echo $f->show(sprintf('PHP configuration file path: %s', get_cfg_var('cfg_file_path')));
echo $f->nl();
echo $f->heading('Webserver configuration', 2);
echo $f->showAssertion('URL rewrite support', $r->assertWebserverUrlRewritingSupport(), $f->isCli() ? 'URL rewrite support. Please run the checker from your browser' : sprintf('URL rewrite test failed. Please check <a href="%1$s">%1$s</a> in your browser directly.<br> Please also check <strong>%2$s</strong> user can write to <strong>rewritetest/.htaccess</strong> and try again.', $r->getWebserverUrlRewritingURL(), $processUserName), false);
echo $f->nl();
echo $f->heading('PHP configuration', 2);
echo $f->showAssertion(sprintf('PHP version at least <strong>5.3.2</strong> (%s)', PHP_VERSION), $r->assertMinimumPhpVersion('5.3.2'), PHP_VERSION);
echo $f->nl();
echo $f->showAssertion(sprintf('memory_limit option at least <strong>64M</strong> (%s)', ini_get('memory_limit')), $r->assertMinimumPhpMemory('64M'), sprintf('You only have %s memory. SilverStripe requires at least <strong>64M</strong>', ini_get('memory_limit')), false);
if (!$r->assertMinimumPhpMemory('64M')) {
    echo $f->showAssertion('can increase memory_limit option by 64M using ini_set()', $r->assertIncreasePhpMemory('64M'), 'Unable to increase memory by 64M. Please make sure you set at least <strong>64M</strong> for PHP memory_limit option', !$r->assertMinimumPhpMemory('64M'));
}
echo $f->showAssertion('can set additional include paths using set_include_path()', $r->assertSetAdditionalIncludePaths('/test/path'), 'Additional paths cannot be set using set_include_path(). ' . '<a href="http://silverstripe.org/installing-silverstripe/show/12361">More information in silverstripe.org/forums</a>');
echo $f->showAssertion(sprintf('date.timezone option set and valid (%s)', ini_get('date.timezone')), $r->assertPhpDateTimezoneSetAndValid(), sprintf('date.timezone option needs to be set to your server timezone. PHP guessed <strong>%s</strong>, but it\'s not safe to rely on the system timezone', @date_default_timezone_get()));
echo $f->showAssertion('asp_tags option set to <strong>Off</strong>', $r->assertPhpIniOptionOff('asp_tags'), 'asp_tags option should be set to <strong>Off</strong>');
echo $f->showAssertion('safe_mode option set to <strong>Off</strong>', $r->assertPhpIniOptionOff('safe_mode'), 'safe_mode option is deprecated. Please set it to <strong>Off</strong>');
echo $f->showAssertion('allow_call_time_pass_reference option set to <strong>Off</strong>', $r->assertPhpIniOptionOff('allow_call_time_pass_reference'), 'allow_call_time_pass_reference option is deprecated. Please set it to <strong>Off</strong>', false);
echo $f->showAssertion('short_open_tag option option set to <strong>Off</strong>', $r->assertPhpIniOptionOff('short_open_tag'), 'short_open_tag option should be set to <strong>Off</strong>', false);
echo $f->showAssertion('magic_quotes_gpc option set to <strong>Off</strong>', $r->assertPhpIniOptionOff('magic_quotes_gpc'), 'magic_quotes_gpc option is deprecated. This can cause issues with cookies, <a href="http://silverstripe.org/blog-module-forum/show/15011">see here</a> for more information. Please set it to <strong>Off</strong>');
echo $f->showAssertion('register_globals option set to <strong>Off</strong>', $r->assertPhpIniOptionOff('register_globals'), 'register_globals option is deprecated. Please set it to <strong>Off</strong>');
echo $f->nl();
echo $f->showAssertion('curl extension loaded', $r->assertPhpExtensionLoaded('curl'), 'curl extension not loaded');
echo $f->showAssertion('dom extension loaded', $r->assertPhpExtensionLoaded('dom'), 'dom extension not loaded');
echo $f->showAssertion('gd extension loaded', $r->assertPhpExtensionLoaded('gd'), 'gd extension not loaded');
if ($r->assertPhpExtensionLoaded('gd')) {
    echo $f->showAssertion(sprintf('gd extension version at least <strong>2.0</strong> (%s)', $r->getPhpExtensionVersion('gd')), $r->assertMinimumPhpExtensionVersion('gd', '2.0'), 'gd extension is too old. SilverStripe requires at least gd version 2.0');
}
echo $f->showAssertion('hash extension loaded', $r->assertPhpExtensionLoaded('hash'), 'hash extension not loaded');
echo $f->showAssertion('iconv extension loaded', $r->assertPhpExtensionLoaded('iconv'), 'iconv extension not loaded');