? pifr.review.inc__0.patch
? pifr_debug_0.patch
? pifr_debug_5.patch
? pifr_menu.patch
? working_patch.patch
Index: pifr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/pifr.module,v
retrieving revision 1.40
diff -u -p -r1.40 pifr.module
--- pifr.module	4 Dec 2008 04:30:10 -0000	1.40
+++ pifr.module	6 Dec 2008 20:14:36 -0000
@@ -8,6 +8,11 @@
  */
 
 /**
+ * Control detailed debugging output through watchdog.
+ */
+define('PIFR_DEBUG', TRUE);
+
+/**
  * Server types.
  */
 define('PIFR_SERVER_PROJECT', 1);
@@ -695,3 +700,14 @@ function pifr_response_code($response_co
       return 'Unknown';
   }
 }
+
+/**
+ * Output debug message via watchdog when enabled.
+ *
+ * @param string $message Debug message.
+ */
+function pifr_debug($message) {
+  if (PIFR_DEBUG) {
+    watchdog('pifr_debug', $message);
+  }
+}
Index: pifr.review.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/pifr.review.inc,v
retrieving revision 1.16
diff -u -p -r1.16 pifr.review.inc
--- pifr.review.inc	4 Nov 2008 06:33:19 -0000	1.16
+++ pifr.review.inc	6 Dec 2008 20:14:36 -0000
@@ -21,8 +21,12 @@ function pifr_review_start($server_url, 
   variable_set('pifr_file_id', $file_id);
   variable_set('pifr_file', $filepath);
 
+  pifr_debug('File information variables set.');
+
   // Run review in background so testing master server can close connection.
   pifr_review_exec_background('curl ' . url('pifr/review', array('absolute' => TRUE)));
+
+  pifr_debug('Background process started.');
 }
 
 /**
@@ -31,9 +35,12 @@ function pifr_review_start($server_url, 
 function pifr_review_run() {
   if (!variable_get('pifr_reviewing', FALSE)) {
     // Possible invalid attempt to run slave.
+    pifr_debug('Review halted, possible invalid attempt to run slave.');
     return;
   }
 
+  pifr_debug('Starting file review.');
+
   $file_id = variable_get('pifr_file_id', '');
   $filepath = variable_get('pifr_file', '');
 
@@ -44,6 +51,8 @@ function pifr_review_run() {
     return;
   }
 
+  pifr_debug('File fetched.');
+
   // File downloaded, checkout latest CVS.
   if (!pifr_review_checkout()) {
     // Inform master server that HEAD failed to checkout.
@@ -51,6 +60,8 @@ function pifr_review_run() {
     return;
   }
 
+  pifr_debug('CVS checkout complete.');
+
   // Apply patch to latest CVS.
   if (!pifr_review_apply_patch(basename($filepath))) {
     // Inform master server that patch does not apply.
@@ -58,6 +69,8 @@ function pifr_review_run() {
     return;
   }
 
+  pifr_debug('Patch applied.');
+
   // Check syntax of files changed by patch.
   if (!pifr_review_check_syntax(basename($filepath))) {
     // Inform master server that patch create invalid PHP syntax.
@@ -65,6 +78,8 @@ function pifr_review_run() {
     return;
   }
 
+  pifr_debug('PHP syntax checked.');
+
   // Install HEAD.
   if (!pifr_review_install()) {
     // Inform master server that could not install HEAD.
@@ -72,6 +87,8 @@ function pifr_review_run() {
     return;
   }
 
+  pifr_debug('HEAD installation complete.');
+
   // Run tests.
   if (!pifr_review_run_tests()) {
     // Inform master server that could not run tests.
@@ -79,8 +96,12 @@ function pifr_review_run() {
     return;
   }
 
+  pifr_debug('Testing completed.');
+
   // Send testing results as XML. Server will evaluate the PASS based on the summary XML.
   pifr_review_send($file_id, PIFR_FILE_TEST_PASS, '', $GLOBALS['pifr_xml_results']);
+
+  pifr_debug('Results sent.');
 }
 
 /**
@@ -351,9 +372,7 @@ function pifr_review_cleanup() {
  * @param string $results Test results exported as XML and compressed.
  */
 function pifr_review_send($file_id, $status, $return, $results = NULL) {
-  if ($status == PIFR_FILE_ERROR) {
-    watchdog('pifr', $return, array(), WATCHDOG_ERROR);
-  }
+    watchdog('pifr', 'The following message was sent to the PIFR master server: %return', array('%return' => $return), WATCHDOG_ERROR);
 
   $server_url = variable_get('pifr_server', '') . 'xmlrpc.php';
   $self = pifr_server_get_type(PIFR_SERVER_SLAVE);
