mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
new unicode environment check for 1.8 and 1.7 MDL-6332; merged from MOODLE_17_STABLE
This commit is contained in:
parent
f4fc87e1b2
commit
a392be33cf
@ -35,6 +35,46 @@
|
||||
</PHP_EXTENSIONS>
|
||||
</MOODLE>
|
||||
<MOODLE version="1.7">
|
||||
<UNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unicoderecommended" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="4.1.16">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
<BYPASS function="bypass_mysql416_reqs" message="mysql416bypassed" />
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="7.4" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="9.0" />
|
||||
</DATABASE>
|
||||
<PHP version="4.3.0" level="required">
|
||||
<RESTRICT function="restrict_php50_version" message="php50restricted" />
|
||||
</PHP>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
</PHP_EXTENSIONS>
|
||||
</MOODLE>
|
||||
<MOODLE version="1.8">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="4.1.16">
|
||||
<FEEDBACK>
|
||||
|
@ -428,6 +428,8 @@ $string['timezoneisforcedto'] = 'Force all users to use';
|
||||
$string['timezonenotforced'] = 'Users can choose their own timezone';
|
||||
$string['unbookmarkthispage'] = 'unbookmark this page';
|
||||
$string['unicodeupgradenotice'] = 'In Moodle 1.6 we have migrated all languages to Unicode. To complete the upgrade for this site, you need to convert all the data in your database to Unicode using our migration script. <a href=\"utfdbmigrate.php\">Click here to run the migration script now</a>!';
|
||||
$string['unicoderecommended'] = 'UTF-8 database migration is recommended, new installations should be performed into unicode enabled databases';
|
||||
$string['unicoderequired'] = 'Unicode enabled database is required for installation or upgrade. Please make sure that database is properly migrated to unicode before upgrading to this version.';
|
||||
$string['uninstall'] = 'Uninstall selected language pack';
|
||||
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack $a, are you sure?';
|
||||
$string['unsupported'] = 'Unsupported';
|
||||
|
@ -46,6 +46,7 @@
|
||||
define('NO_PHP_EXTENSIONS_SECTION_FOUND', 8);
|
||||
define('NO_PHP_EXTENSIONS_NAME_FOUND', 9);
|
||||
define('NO_DATABASE_VENDOR_VERSION_FOUND', 10);
|
||||
define('NO_UNICODE_SECTION_FOUND', 11);
|
||||
|
||||
/**
|
||||
* This function will perform the whole check, returning
|
||||
@ -395,6 +396,7 @@ function environment_check($version) {
|
||||
|
||||
$results = array(); //To store all the results
|
||||
|
||||
$results[] = environment_check_unicode($version);
|
||||
$results[] = environment_check_database($version);
|
||||
$results[] = environment_check_php($version);
|
||||
|
||||
@ -536,6 +538,59 @@ function environment_check_php($version) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will check if unicode database requirements are satisfied
|
||||
* @param string $version xml version we are going to use to test this server
|
||||
* @return object results encapsulated in one environment_result object
|
||||
*/
|
||||
function environment_check_unicode($version) {
|
||||
global $db;
|
||||
|
||||
$result = new environment_results('unicode');
|
||||
|
||||
/// Get the enviroment version we need
|
||||
if (!$data = get_environment_for_version($version)) {
|
||||
/// Error. No version data found
|
||||
$result->setStatus(false);
|
||||
$result->setErrorCode(NO_VERSION_DATA_FOUND);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/// Extract the unicode part
|
||||
|
||||
if (!isset($data['#']['UNICODE'])) {
|
||||
/// Error. No DATABASE section found
|
||||
$result->setStatus(false);
|
||||
$result->setErrorCode(NO_UNICODE_SECTION_FOUND);
|
||||
return $result;
|
||||
} else {
|
||||
/// Extract level
|
||||
if (isset($data['#']['UNICODE']['0']['@']['level'])) {
|
||||
$level = $data['#']['UNICODE']['0']['@']['level'];
|
||||
if ($level != 'optional') {
|
||||
$level = 'required';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$unicodedb = setup_is_unicodedb()) {
|
||||
$result->setStatus(false);
|
||||
} else {
|
||||
$result->setStatus(true);
|
||||
}
|
||||
|
||||
$result->setLevel($level);
|
||||
|
||||
/// Process messages, modifying the $result if needed.
|
||||
process_environment_messages($data['#']['UNICODE'][0], $result);
|
||||
/// Process bypass, modifying $result if needed.
|
||||
process_environment_bypass($data['#']['UNICODE'][0], $result);
|
||||
/// Process restrict, modifying $result if needed.
|
||||
process_environment_restrict($data['#']['UNICODE'][0], $result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will check if database requirements are satisfied
|
||||
* @param string $version xml version we are going to use to test this server
|
||||
|
Loading…
x
Reference in New Issue
Block a user