Example #1
0
function doSystemChecks()
{
    // Do system checking.
    if (version_compare(phpversion(), "5.2.1", "<")) {
        addError(kPHPVersion, sprintf(_('This version of PHPDevShell only supports PHP version %s and later. You are currently running version %s.'), '5.2.1', phpversion()));
    }
    if (check_apache() == false) {
        addWarning(kApache, _('You are not running Apache as your web server. This version of PHPDevShell does not officially support non-Apache driven webservers.'));
    }
    if (check_mysql() == false) {
        addError(kMYSQL, _('The MySQL extension for PHP is missing. The installation script will be unable to continue'));
    }
    if (check_gettext() == false) {
        addError(kGETTEXT, _('The gettext extension for PHP is missing. The installation script will be unable to continue'));
    }
    global $errors;
    return count($errors) == 0;
}
Example #2
0
function check_curl()
{
    global $phpinfo, $loaded_extensions;
    if (!function_exists('curl_init')) {
        return new CheckResult(false);
    }
    return new CheckResult(isset($loaded_extensions['curl']));
}
$loaded_extensions = array_flip(get_loaded_extensions());
function do_error($errormessage)
{
    // We can't translate this because we're testing these things even before
    // the translation interface is available...
    printf("<p class='error'>%s</p>", $errormessage);
}
if (!check_gettext()->getOK()) {
    do_error("The GNU 'gettext' extension for PHP is not available.");
}
if (!check_pgsql()->getOK()) {
    do_error("PHP 'pgsql' functions are not available");
}
if (!check_pdo()->getOK()) {
    do_error("PHP 'PDO' module is not available");
}
if (!check_pdo_pgsql()->getOK()) {
    do_error("The PDO drivers for PostgreSQL are not available");
}
if (!check_database_connection()->getOK()) {
    do_error("Unable to connect to database");
}
if (!check_iconv()->getOK()) {