Adds some crawlTimeoutLogs for media wiki archive iterator, a=chris

Chris Pollett [2013-07-17 16:Jul:th]
Adds some crawlTimeoutLogs for media wiki archive iterator, a=chris
Filename
lib/archive_bundle_iterators/mediawiki_bundle_iterator.php
lib/archive_bundle_iterators/text_archive_bundle_iterator.php
lib/utility.php
diff --git a/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php b/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php
index 910b92ed2..3ae52695e 100644
--- a/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php
+++ b/lib/archive_bundle_iterators/mediawiki_bundle_iterator.php
@@ -447,11 +447,13 @@ class MediaWikiArchiveBundleIterator extends TextArchiveBundleIterator
                 $ref_parts = explode("|", $reference);
                 $references .= "<div id=\"ref_$i\">$i.".
                     "<a href=\"#cite_$i\">^</a>.";
+                crawlTimeoutLog("..Making wiki references outer..");
                 if(count($ref_parts) > 0) {
                     $ref_data = array();
                     $type = trim(strtolower($ref_parts[0]));
                     array_shift($ref_parts);
                     foreach($ref_parts as $part) {
+                        crawlTimeoutLog("..Making wiki references inner..");
                         $part_parts = explode("=", $part);
                         if(isset($part_parts[1])){
                             $field = strtolower(trim($part_parts[0]));
@@ -607,6 +609,7 @@ function makeTableCallback($matches)
     $type = "td";
     $old_type = "td";
     foreach($row_data as $item) {
+        crawlTimeoutLog("..Making Wiki Tables..");
         if($first) {
             $item = trim(str_replace("\n", " ", $item));
             $out .= "<table $item>\n<tr>";
@@ -685,4 +688,4 @@ function fixLinksCallback($matches)
     return $out;
 }

-?>
\ No newline at end of file
+?>
diff --git a/lib/archive_bundle_iterators/text_archive_bundle_iterator.php b/lib/archive_bundle_iterators/text_archive_bundle_iterator.php
index c6f328bee..fb99867f2 100644
--- a/lib/archive_bundle_iterators/text_archive_bundle_iterator.php
+++ b/lib/archive_bundle_iterators/text_archive_bundle_iterator.php
@@ -803,6 +803,7 @@ class TextArchiveBundleIterator extends ArchiveBundleIterator
                blocks.
             */
             while(!is_string($block = $this->getFileBlock())) {
+                crawlTimeoutLog("..still getting next tags data..");
                 if($this->checkEof())
                     return false;
             }
diff --git a/lib/utility.php b/lib/utility.php
index 397c80aef..7e7a7bcef 100755
--- a/lib/utility.php
+++ b/lib/utility.php
@@ -1450,12 +1450,12 @@ function orderCallback($word_doc_a, $word_doc_b, $order_field = NULL)
  *  Callback function used to sort documents by a field in reverse order
  *
  *  Should be initialized before using in usort with a call
- *  like: orderCallback($tmp, $tmp, "field_want");
+ *  like: rorderCallback($tmp, $tmp, "field_want");
  *
  *  @param string $word_doc_a doc id of first document to compare
  *  @param string $word_doc_b doc id of second document to compare
  *  @param string $field which field of these associative arrays to sort by
- *  @return int -1 if first doc bigger 1 otherwise
+ *  @return int 1 if first doc bigger -1 otherwise
  */
 function rorderCallback($word_doc_a, $word_doc_b, $order_field = NULL)
 {
ViewGit