/// If successful, continue upgrading roles and setting everything properly if ($status) { if (!update_capabilities()) { console_write_error('Had trouble upgrading the core capabilities for the Roles System', '', false); } if (set_config("version", $version)) { remove_dir($CFG->dataroot . '/cache', true); // flush cache notify($strdatabasesuccess, "green"); /// print_continue("upgradesettings.php"); } else { console_write_error('Upgrade failed! (Could not update version in config table)', '', false); } /// Main upgrade not success } else { console_write_error('Main Upgrade failed! See lib/db/upgrade.php', '', false); } } else { if ($version < $CFG->version) { notify("WARNING!!! The code you are using is OLDER than the version that made these databases!"); } } } else { set_config("version", $version); } /// Find and check all main modules and load them up or upgrade them if necessary /// first old *.php update and then the new upgrade.php script if ($verbose > CLI_NO) { print_heading(get_string('upgradingactivitymodule', 'install'), '', 1); } upgrade_activity_modules('');
/** * Print compatibility message to standard out, and errors to standard error * * @param boolean $success * @param string $testtext * @param string $errormessage * @param boolean $caution * @param boolean $silent * @return boolean */ function check_compatibility($success, $testtext, $errormessage, $caution = false, $silent = false) { if ($success) { if (!$silent) { console_write(get_string('pass', 'install'), '', false); } } else { if ($caution) { if (!$silent) { console_write(get_string('caution', 'install'), '', false); } } else { console_write(get_string('fail', 'install'), '', false); console_write_error($errormessage, '', false); } } if (!$silent) { console_write("\t\t", '', false); console_write($testtext, '', false); console_write("\n", '', false); } return $success; }