Ejemplo n.º 1
0
}
$r = new RequirementsChecker();
$f = new RequirementsFormatter();
if (isset($_SERVER['HTTP_HOST'])) {
    echo '<html>' . PHP_EOL;
    echo '<head>' . PHP_EOL;
    echo '<title>SilverStripe Requirements</title>' . PHP_EOL;
    echo '<style type="text/css">' . PHP_EOL;
    echo '@import url("styles.css");' . PHP_EOL;
    echo '</style>' . PHP_EOL;
    echo '</head>' . PHP_EOL;
    echo '<body>' . PHP_EOL;
}
echo $f->heading('SilverStripe Requirements Checker', 1);
echo $f->heading('System information', 2);
echo $f->show(sprintf('System: %s', $r->getSystemInformation()));
echo $f->show(sprintf('Webserver Software: %s', isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'Unknown'));
// see if we can show who the process owner is (the web server user, mostly)
if (function_exists('posix_getpwuid')) {
    $processUser = posix_getpwuid(posix_geteuid());
    $processUserName = $processUser['name'];
} else {
    // on windows, get_current_user() returns the process user, not the owner of the script!
    $processUserName = get_current_user();
}
echo $f->show(sprintf('Current process user: %s', $processUserName));
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);