if (get_string_manager()->string_exists($errorcode, $module)) {
$message = get_string($errorcode, $module, $a);
+ $haserrorstring = true;
} else {
$message = $module . '/' . $errorcode;
+ $haserrorstring = false;
}
if (defined('PHPUNIT_TEST') and PHPUNIT_TEST and $debuginfo) {
$message = "$message ($debuginfo)";
}
+ if (!$haserrorstring and defined('PHPUNIT_TEST') and PHPUNIT_TEST) {
+ // Append the contents of $a to $debuginfo so helpful information isn't lost.
+ // This emulates what {@link get_exception_info()} does. Unfortunately that
+ // function is not used by phpunit.
+ $message .= PHP_EOL.'$a contents: '.print_r($a, true);
+ }
+
parent::__construct($message, 0);
}
}
*/
function redirect_if_major_upgrade_required() {
global $CFG;
- $lastmajordbchanges = 2012110201;
- if (empty($CFG->version) or (int)$CFG->version < $lastmajordbchanges or
+ $lastmajordbchanges = 2013021100.01;
+ if (empty($CFG->version) or (float)$CFG->version < $lastmajordbchanges or
during_initial_install() or !empty($CFG->adminsetuppending)) {
try {
@session_get_instance()->terminate_current();