Ejemplo n.º 1
0
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');
echo $f->showAssertion('mbstring extension loaded', $r->assertPhpExtensionLoaded('mbstring'), 'mbstring extension not loaded');
echo $f->showAssertion('posix extension loaded', preg_match('/WIN/', PHP_OS) ? null : $r->assertPhpExtensionLoaded('posix'), 'posix extension not loaded');
echo $f->showAssertion('session extension loaded', $r->assertPhpExtensionLoaded('session'), 'session extension not loaded');
echo $f->showAssertion('tokenizer extension loaded', $r->assertPhpExtensionLoaded('tokenizer'), 'tokenizer extension not loaded');
echo $f->showAssertion('tidy extension loaded', $r->assertPhpExtensionLoaded('tidy'), 'tidy extension not loaded', false);
echo $f->showAssertion('xml extension loaded', $r->assertPhpExtensionLoaded('xml'), 'xml extension not loaded');
echo $f->nl();
echo $f->showAssertion(sprintf('opcode cacher extension installed (%s)', $r->getPhpOpcodeCacher()), $r->assertPhpOpcodeCacherEnabled(), 'no opcode cacher extension is installed and enabled. It is highly recommended to install and enable either Zend OPcache, XCache, WinCache, APC, or eAccelerator', false);