From eab044a083f01d267cf53545251fcb4123eb7c81 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 6 Aug 2011 20:56:57 +0200 Subject: [PATCH] MDL-28634 fix forgotten references to Moodle 2.0 and old PHP version requirements --- admin/cli/install.php | 8 ++++---- admin/cli/install_database.php | 10 +++++----- admin/index.php | 6 +++--- install.php | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/admin/cli/install.php b/admin/cli/install.php index 1c37f549057..0dd5102e678 100644 --- a/admin/cli/install.php +++ b/admin/cli/install.php @@ -115,12 +115,12 @@ if (function_exists('date_default_timezone_set') and function_exists('date_defau define('MOODLE_INTERNAL', true); // Check that PHP is of a sufficient version -if (version_compare(phpversion(), "5.2.8") < 0) { +if (version_compare(phpversion(), "5.3.2") < 0) { $phpversion = phpversion(); // do NOT localise - lang strings would not work here and we CAN NOT move it after installib - echo "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion).\n"; - echo "Please upgrade your server software or install latest Moodle 1.9.x instead."; - die; + fwrite(STDERR, "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).\n"); + fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n"); + exit(1); } // set up configuration diff --git a/admin/cli/install_database.php b/admin/cli/install_database.php index 9e55c9c7ad0..44412eca4bb 100644 --- a/admin/cli/install_database.php +++ b/admin/cli/install_database.php @@ -55,12 +55,12 @@ Example: "; // Check that PHP is of a sufficient version -if (version_compare(phpversion(), "5.2.8") < 0) { +if (version_compare(phpversion(), "5.3.2") < 0) { $phpversion = phpversion(); // do NOT localise - lang strings would not work here and we CAN NOT move it after installib - fwrite(STDERR, "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion).\n"); - fwrite(STDERR, "Please upgrade your server software or install latest Moodle 1.9.x instead.\n"); - die(1); + fwrite(STDERR, "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).\n"); + fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n"); + exit(1); } // Nothing to do if config.php does not exist @@ -68,7 +68,7 @@ $configfile = dirname(dirname(dirname(__FILE__))).'/config.php'; if (!file_exists($configfile)) { fwrite(STDERR, 'config.php does not exist, can not continue'); // do not localize fwrite(STDERR, "\n"); - die(1); + exit(1); } // Include necessary libs diff --git a/admin/index.php b/admin/index.php index 77c04045995..70b47dd854f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -30,11 +30,11 @@ if (!file_exists('../config.php')) { } // Check that PHP is of a sufficient version as soon as possible -if (version_compare(phpversion(), '5.2.0') < 0) { +if (version_compare(phpversion(), '5.3.2') < 0) { $phpversion = phpversion(); // do NOT localise - lang strings would not work here and we CAN NOT move it to later place - echo "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion). "; - echo "Please upgrade your server software or use latest Moodle 1.9.x instead."; + echo "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).
"; + echo "Please upgrade your server software or install older Moodle version."; die; } diff --git a/install.php b/install.php index 3ff618b0b47..03d8122737f 100644 --- a/install.php +++ b/install.php @@ -62,8 +62,8 @@ if (function_exists('date_default_timezone_set') and function_exists('date_defau if (version_compare(phpversion(), "5.2.0") < 0) { $phpversion = phpversion(); // do NOT localise - lang strings would not work here and we CAN not move it after installib - echo "Sorry, Moodle 2.0 requires PHP 5.2.8 or later (currently using version $phpversion).
"; - echo "Please upgrade your server software or install latest Moodle 1.9.x instead."; + echo "Moodle 2.1 or later requires at least PHP 5.3.2 (currently using version $phpversion).
"; + echo "Please upgrade your server software or install older Moodle version."; die; } @@ -169,7 +169,7 @@ $memlimit = @ini_get('memory_limit'); if (!empty($memlimit) and $memlimit != -1) { if (get_real_size($memlimit) < get_real_size($minrequiredmemory)) { // do NOT localise - lang strings would not work here and we CAN not move it to later place - echo "Sorry, Moodle 2.0 requires at least {$minrequiredmemory}B of PHP memory.
"; + echo "Moodle requires at least {$minrequiredmemory}B of PHP memory.
"; echo "Please contact server administrator to fix PHP.ini memory settings."; die; } @@ -481,7 +481,7 @@ if ($config->stage == INSTALL_DATABASETYPE) { if ($config->stage == INSTALL_ENVIRONMENT or $config->stage == INSTALL_PATHS) { - $version_fail = (version_compare(phpversion(), "5.2.8") < 0); + $version_fail = (version_compare(phpversion(), "5.3.2") < 0); $curl_fail = ($lang !== 'en' and !extension_loaded('curl')); // needed for lang pack download $zip_fail = ($lang !== 'en' and !extension_loaded('zip')); // needed for lang pack download @@ -494,7 +494,7 @@ if ($config->stage == INSTALL_ENVIRONMENT or $config->stage == INSTALL_PATHS) { echo '
'; if ($version_fail) { - $a = (object)array('needed'=>'5.2.8', 'current'=>phpversion()); + $a = (object)array('needed'=>'5.3.2', 'current'=>phpversion()); echo '
'.get_string('phpversion', 'install').'
'.get_string('environmentrequireversion', 'admin', $a).'
'; } if ($curl_fail) {