]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed a some debugging statements
authormoodler <moodler>
Mon, 18 Sep 2006 13:24:45 +0000 (13:24 +0000)
committermoodler <moodler>
Mon, 18 Sep 2006 13:24:45 +0000 (13:24 +0000)
17 files changed:
backup/backuplib.php
backup/restorelib.php
blocks/rss_client/block_rss_client.php
blocks/rss_client/block_rss_client_action.php
blog/rsslib.php
course/format/topics/format.php
enrol/database/enrol_database_sync.php
enrol/ldap/enrol_ldap_sync.php
filter/algebra/pix.php
filter/tex/pix.php
iplookup/ipatlas/ip-atlas_prefs.php
iplookup/ipatlas/plot.php
question/type/rqp/lib.php
theme/formal_white/footer.html
theme/metal/footer.html
theme/oceanblue/footer.html
theme/standard/footer.html

index dbf70b412b4d0dd9f9f04c069cd102211778a396..7e100e0bdfd2771bd2d0b089a7e4ba8da82265f4 100644 (file)
                     $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;
     }
index 7f4654f52efc04b8585303e53f4b1d1d0e0d619a..ca3e345bf9fe3544e7717c4f8c7594a8ff8c684b 100644 (file)
     
         $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
             }
index 565a14a3c7939ae095c98873479601c4a61e2054..96bfb035f25c4b06788f76bc69bec1a38961255b 100644 (file)
             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
+?>
index 59de052959617b1248172c108a97a7b0fee47972..19d30380e655bded03477b10f4da08c329d53b7a 100644 (file)
@@ -114,7 +114,7 @@ if ($act == 'updfeed') {
     $message = '';
     ob_start();
     $rss = fetch_rss($url);
-    if ($CFG->debug) {
+    if (debugging()) {
         $message .= ob_get_contents();
     }
     ob_end_clean();
@@ -181,7 +181,7 @@ if ($act == 'updfeed') {
     $message = '';
     ob_start();
     $rss = fetch_rss($url);
-    if ($CFG->debug) {
+    if (debugging()) {
         $message .= ob_get_contents();
     }
     ob_end_clean();
@@ -288,4 +288,4 @@ if ($act == 'updfeed') {
     rss_print_form($act, $url, $rssid, $preferredtitle, $shared, $id, $context);
 }
 print_footer();
-?>
\ No newline at end of file
+?>
index 7fbb95a94eef52b3f3d3f154e3b10e3c9a570cd8..0d2688895aafd77510eddf80846820396177da9f 100755 (executable)
@@ -53,9 +53,7 @@
         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 '';
         }
 
index c2b63c1ad73acc099f667b83ea325c87079be819..7ad4215f9d9e1f22d894c959207ed462afcd3e02 100644 (file)
@@ -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'));
             }
         }
index 3a6f24a359151c342afc359b0fce5f011a55eced..a3dc7b2af239dc1aed9780b03ac3844fa45700b5 100644 (file)
@@ -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);
index a8a5621e39a962f2bb2fd9818d85d2e99b7a0b5e..4b68941585981b3b9a78c013ffee36ceed4af06e 100755 (executable)
@@ -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();    
index 8fd51bff894e5c151fc749445e0d1312664e3225..53a00746bcbe8d4f99539e4830a4606a563339a6 100644 (file)
@@ -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";
index 1977c8eb8876339096f9eacd92f3754efd67b51a..084c4812049b11d19038ef818939eeb3aedceb07 100644 (file)
@@ -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";
index 8c752ae0aa725175705d315f1047512fbd9a56d7..dde0f0005afa3319f5b6085993a0a45cf36e3d32 100644 (file)
@@ -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);
 }
index 721d88aa498191dd5e49d7ab39b18d83573d2eb2..878001d9d985916337abc090a387b02bcfceb7d4 100644 (file)
@@ -11,12 +11,6 @@ if (isset($user)) {
     $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);
index c03153171bd23b2d816ae9e7d52073edd055de39..0083a3f837567a794a60fe24c130f6cd428a82dc 100644 (file)
@@ -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>';
index a850dcf31a8dc6aa0d8e5cb0c1e8dc052b77c516..dda49f3efbeb1edb199ba0d3089d2a04be78ddf7 100644 (file)
@@ -25,7 +25,7 @@
           echo $performanceinfo;
 } ?>
 </div>
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
 ?>
           <br />
           <hr size="1" noshade="noshade" />
index cd3bd9c3c5df6ab721a07a2a24f07bf9f8b30c3d..7e816eba83f08d01ac112c5f7f7b89b6227888c5 100644 (file)
@@ -13,7 +13,7 @@
     echo '</p>';
 ?>
 
-<?php if ($CFG->debug > 7) { 
+<?php if (debugging()) { 
           echo $performanceinfo;
 ?>
           <hr size="1" noshade="noshade" />
index 887c2c50a245258953938c0cadcd4e6d150d78d1..0388dc4e52e41233dfe7ebcffe7b953342935f67 100644 (file)
@@ -25,7 +25,7 @@
           echo $performanceinfo;
 } ?>
 
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
 ?>
           <br />
           <hr size="1" noshade="noshade" />
index ece17ef8c2007c0b4e2f329c21ac65a7ca608725..46c31eb82c244fa04d169d2037a70016cb8d8036 100644 (file)
@@ -23,7 +23,7 @@
           echo $performanceinfo;
 } ?>
 
-<?php if ($CFG->debug > 7) {
+<?php if (debugging()) {
 ?>
           <br />
           <hr size="1" noshade="noshade" />