$grade_item->module_name = $rec_module->name;
$inc_grade_items[] = $grade_item;
} else {
- if ($CFG->debug > 7) {
- echo "skipping $grade_item->modid"."-"."$rec_module->name<br />";
- }
+ debugging("skipping $grade_item->modid"."-"."$rec_module->name<br />");
}
}
}
//Add it
$inc_grade_exceptions[] = $grade_exception;
} else {
- if ($CFG->debug > 7) {
- echo "skipping $grade_exception->userid"."-user<br />";
- }
+ debugging("skipping $grade_exception->userid"."-user<br />");
}
}
}
}
}
- if ($result != $content && $CFG->debug>7) { //Debug
- echo '<br /><hr />'.s($content).'<br />changed to<br />'.s($result).'<hr /><br />'; //Debug
- } //Debug
+ if ($result != $content) {
+ debugging('<br /><hr />'.s($content).'<br />changed to<br />'.s($result).'<hr /><br />');
+ }
return $result;
}
$result = str_replace($search,$replace,$content);
- if ($result != $content && $CFG->debug>7) { //Debug
+ if ($result != $content && debugging()) { //Debug
if (!defined('RESTORE_SILENTLY')) {
echo '<br /><hr />'.s($content).'<br />changed to<br />'.s($result).'<hr /><br />'; //Debug
}
ob_end_clean();
if ($rss === false) {
- if ($CFG->debug && !empty($rsserror)) {
+ if (debugging() && !empty($rsserror)) {
// There was a failure in loading the rss feed, print link to full error text
return '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_error.php?error='. urlencode($rsserror) .'">Error loading a feed.</a><br />'; //Daryl Hawes note: localize this line
}
}
}
}
-?>
\ No newline at end of file
+?>
$message = '';
ob_start();
$rss = fetch_rss($url);
- if ($CFG->debug) {
+ if (debugging()) {
$message .= ob_get_contents();
}
ob_end_clean();
$message = '';
ob_start();
$rss = fetch_rss($url);
- if ($CFG->debug) {
+ if (debugging()) {
$message .= ob_get_contents();
}
ob_end_clean();
rss_print_form($act, $url, $rssid, $preferredtitle, $shared, $id, $context);
}
print_footer();
-?>
\ No newline at end of file
+?>
global $CFG, $SITE;
if (empty($CFG->enablerssfeeds)) {
- if ($CFG->debug > 7) {
- notify('Sorry, RSS feeds are disabled on this site');
- }
+ debugging('Sorry, RSS feeds are disabled on this site');
return '';
}
'ajaxcourse_blocks','ajaxcourse_sections','ajaxcourse_topic'));
//javascript logging facilities
- if ($CFG->debug > 7) {
+ if (debugging()) {
print_require_js(Array('yui_logger'));
}
}
require_once($CFG->dirroot . "/enrol/" . $CFG->enrol . "/enrol.php");
// ensure errors are well explained
- $CFG->debug=10;
+ $CFG->debug=E_ALL;
// update enrolments -- these handlers should autocreate courses if required
$enrol = new enrolment_plugin();
$enrol->sync_enrolments('student', true);
require_once($CFG->dirroot . "/enrol/ldap/enrol.php");
// ensure errors are well explained
- $CFG->debug=10;
+ $CFG->debug = E_NOTICE;
+
// update enrolments -- these handlers should autocreate courses if required
$enrol = new enrolment_plugin_ldap();
$enrol->enrol_ldap_connect();
break;
default: /// Nothing was found, so tell them how to fix it.
- if ($CFG->debug > 7) {
+ if (debugging()) {
echo "Make sure you have an appropriate MimeTeX binary here:\n\n";
echo " $CFG->dirroot/$CFG->texfilterdir/mimetex\n\n";
echo "and that it has the right permissions set on it as executable program.\n\n";
break;
default: /// Nothing was found, so tell them how to fix it.
- if ($CFG->debug > 7) {
+ if (debugging()) {
echo "Make sure you have an appropriate MimeTeX binary here:\n\n";
echo " $CFG->dirroot/$CFG->texfilterdir/mimetex\n\n";
echo "and that it has the right permissions set on it as executable program.\n\n";
include("plotconf.inc");
include("plot.inc");
-if($CFG->debug > 1) {
- error_reporting(E_ALL);
-} else {
- error_reporting(E_ERROR);
-}
-
if (isset($HTTP_GET_VARS["lastquery"])){
$HTTP_GET_VARS["lastquery"] = clean_param($HTTP_GET_VARS["lastquery"], PARAM_HOST);
}
$username = "";
}
-if ($CFG->debug > 1) {
-error_reporting(E_ALL);
-} else {
-error_reporting(E_ERROR);
-}
-
// cleanup
if (isset($HTTP_GET_VARS["lastquery"])) {
$HTTP_GET_VARS["lastquery"] = clean_param($HTTP_GET_VARS["lastquery"], PARAM_HOST);
function question_rqp_debug_soap($item) {
global $CFG;
- if ($CFG->debug) {
+ if (debugging()) {
echo 'Here is the dump of the soap fault:<pre>';
var_dump($item);
echo '<pre>';
echo $performanceinfo;
} ?>
</div>
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
?>
<br />
<hr size="1" noshade="noshade" />
echo '</p>';
?>
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
echo $performanceinfo;
?>
<hr size="1" noshade="noshade" />
echo $performanceinfo;
} ?>
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
?>
<br />
<hr size="1" noshade="noshade" />
echo $performanceinfo;
} ?>
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
?>
<br />
<hr size="1" noshade="noshade" />