Skip to content

Commit

Permalink
Fixed a some debugging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 18, 2006
1 parent e51e3fc commit 0e1cc90
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 40 deletions.
14 changes: 5 additions & 9 deletions backup/backuplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1385,9 +1385,7 @@ function backup_gradebook_item_info($bf,$preferences,$gradecategoryid) {
$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 />");
}
}
}
Expand Down Expand Up @@ -1443,9 +1441,7 @@ function backup_gradebook_exceptions_info($bf,$preferences,$gradeitemid) {
//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 />");
}
}
}
Expand Down Expand Up @@ -1729,9 +1725,9 @@ function backup_encode_absolute_links($content) {
}
}

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;
}
Expand Down
2 changes: 1 addition & 1 deletion backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ function restore_decode_absolute_links($content) {

$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
}
Expand Down
4 changes: 2 additions & 2 deletions blocks/rss_client/block_rss_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function get_rss_by_id($rssid, $display_description, $shownumentries, $showtitle
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
}
Expand Down Expand Up @@ -274,4 +274,4 @@ function format_title($title,$max=64) {
}
}
}
?>
?>
6 changes: 3 additions & 3 deletions blocks/rss_client/block_rss_client_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
$message = '';
ob_start();
$rss = fetch_rss($url);
if ($CFG->debug) {
if (debugging()) {
$message .= ob_get_contents();
}
ob_end_clean();
Expand Down Expand Up @@ -181,7 +181,7 @@
$message = '';
ob_start();
$rss = fetch_rss($url);
if ($CFG->debug) {
if (debugging()) {
$message .= ob_get_contents();
}
ob_end_clean();
Expand Down Expand Up @@ -288,4 +288,4 @@
rss_print_form($act, $url, $rssid, $preferredtitle, $shared, $id, $context);
}
print_footer();
?>
?>
4 changes: 1 addition & 3 deletions blog/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ function blog_generate_rss_feed($type, $id, $tagid=0) {
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 '';
}

Expand Down
2 changes: 1 addition & 1 deletion course/format/topics/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
'ajaxcourse_blocks','ajaxcourse_sections','ajaxcourse_topic'));

//javascript logging facilities
if ($CFG->debug > 7) {
if (debugging()) {
print_require_js(Array('yui_logger'));
}
}
Expand Down
2 changes: 1 addition & 1 deletion enrol/database/enrol_database_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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);
Expand Down
3 changes: 2 additions & 1 deletion enrol/ldap/enrol_ldap_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
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();
Expand Down
2 changes: 1 addition & 1 deletion filter/algebra/pix.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
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";
Expand Down
2 changes: 1 addition & 1 deletion filter/tex/pix.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
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";
Expand Down
6 changes: 0 additions & 6 deletions iplookup/ipatlas/ip-atlas_prefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
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);
}
Expand Down
6 changes: 0 additions & 6 deletions iplookup/ipatlas/plot.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
$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);
Expand Down
2 changes: 1 addition & 1 deletion question/type/rqp/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function question_rqp_print_serverinfo($serverinfo) {

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>';
Expand Down
2 changes: 1 addition & 1 deletion theme/formal_white/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
echo $performanceinfo;
} ?>
</div>
<?php if ($CFG->debug > 7) {
<?php if (debugging()) {
?>
<br />
<hr size="1" noshade="noshade" />
Expand Down
2 changes: 1 addition & 1 deletion theme/metal/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
echo '</p>';
?>

<?php if ($CFG->debug > 7) {
<?php if (debugging()) {
echo $performanceinfo;
?>
<hr size="1" noshade="noshade" />
Expand Down
2 changes: 1 addition & 1 deletion theme/oceanblue/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
echo $performanceinfo;
} ?>

<?php if ($CFG->debug > 7) {
<?php if (debugging()) {
?>
<br />
<hr size="1" noshade="noshade" />
Expand Down
2 changes: 1 addition & 1 deletion theme/standard/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
echo $performanceinfo;
} ?>

<?php if ($CFG->debug > 7) {
<?php if (debugging()) {
?>
<br />
<hr size="1" noshade="noshade" />
Expand Down

0 comments on commit 0e1cc90

Please sign in to comment.