Skip to content

Commit

Permalink
Merge branch 'w21_MDL-28676_m19_mysqli' of git://github.com/skodak/mo…
Browse files Browse the repository at this point in the history
…odle into MOODLE_19_STABLE
  • Loading branch information
danpoltawski committed May 25, 2012
2 parents ad69341 + ef69fa6 commit e1d726a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/environmentlib.php
Expand Up @@ -482,6 +482,17 @@ function environment_check_php_extensions($version) {
$result->setErrorCode(NO_PHP_EXTENSIONS_SECTION_FOUND); $result->setErrorCode(NO_PHP_EXTENSIONS_SECTION_FOUND);
return array($result); return array($result);
} }

/// Hack alert: inject extra mysqli dependency, mysql PHP extension is not supported in Moodle 2.x, warn only ppl using MySQL.
global $CFG;
set_dbfamily();
if ($CFG->dbfamily === 'mysql') {
$mver = normalize_version($version);
if (version_compare($mver, '2.0', 'ge')) {
$data['#']['PHP_EXTENSIONS']['0']['#']['PHP_EXTENSION'][] = array('#' => '', '@' => array('name' => 'mysqli', 'level' => 'required'));
}
}

/// Iterate over extensions checking them and creating the needed environment_results /// Iterate over extensions checking them and creating the needed environment_results
foreach($data['#']['PHP_EXTENSIONS']['0']['#']['PHP_EXTENSION'] as $extension) { foreach($data['#']['PHP_EXTENSIONS']['0']['#']['PHP_EXTENSION'] as $extension) {
$result = new environment_results('php_extension'); $result = new environment_results('php_extension');
Expand Down

0 comments on commit e1d726a

Please sign in to comment.