Moves a crawlLog message that had db username and password, a=chris

Chris Pollett [2014-06-17 05:Jun:th]
Moves a crawlLog message that had db username and password, a=chris
Filename
bin/arc_tool.php
controllers/archive_controller.php
models/datasources/pdo_manager.php
diff --git a/bin/arc_tool.php b/bin/arc_tool.php
index cc020e98b..d5ac9979a 100755
--- a/bin/arc_tool.php
+++ b/bin/arc_tool.php
@@ -317,9 +317,9 @@ class ArcTool implements CrawlConstants
      * Prints information about the number of words and frequencies of words
      * within the $generation'th index shard in the bundle
      *
-     *  @param string $archive_path the path of a directory that holds
+     * @param string $archive_path the path of a directory that holds
      *      an IndexArchiveBundle
-     *  @param int $generation which index shard to use
+     * @param int $generation which index shard to use
      */
     function outputShardInfo($archive_path, $generation)
     {
@@ -372,11 +372,11 @@ class ArcTool implements CrawlConstants
      * Prints information about $num many postings beginning at the
      * provided $generation and $offset
      *
-     *  @param string $archive_path the path of a directory that holds
+     * @param string $archive_path the path of a directory that holds
      *      an IndexArchiveBundle
-     *  @param int $generation which index shard to use
-     *  @param int $offset offset into posting lists for that shard
-     *  @param int $num how many postings to print info for
+     * @param int $generation which index shard to use
+     * @param int $offset offset into posting lists for that shard
+     * @param int $num how many postings to print info for
      */
     function outputPostingInfo($archive_path, $generation, $offset, $num = 1)
     {
@@ -751,7 +751,7 @@ class ArcTool implements CrawlConstants
      * word into an inverted index from the summaries' web_archives.
      * Then a reindex is done.
      *
-     * @param string $archivepath file path to a IndexArchiveBundle
+     * @param string $archive_path file path to a IndexArchiveBundle
      */
     function rebuildIndexArchive($archive_path)
     {
@@ -941,8 +941,11 @@ class ArcTool implements CrawlConstants
     }
     /**
      * Outputs the "hey, this isn't a known bundle message" and then exit()'s.
+     *
      * @param string $archive_name name or path to what was supposed to be
      *      an archive
+     * @param string $allowed_archives a string list of archives types
+     *      that $archive_name could belong to
      */
     function badFormatMessageAndExit($archive_name,
         $allowed_archives = "web or index")
diff --git a/controllers/archive_controller.php b/controllers/archive_controller.php
index 14ffc9f56..968cc5bee 100755
--- a/controllers/archive_controller.php
+++ b/controllers/archive_controller.php
@@ -83,12 +83,17 @@ class ArchiveController extends Controller implements CrawlConstants
         if(isset($_REQUEST['instance_num'])) {
             $prefix = $this->clean($_REQUEST['instance_num'], "int")."-";
         }
-        $web_archive = new WebArchiveBundle(
-            CRAWL_DIR.'/cache/'.$prefix.self::archive_base_name.
-                $crawl_time);
-        $page = $web_archive->getPage($offset,
-            $partition);
-        echo base64_encode(serialize($page));
+        if(file_exists(CRAWL_DIR.'/cache/'.$prefix.self::archive_base_name.
+                $crawl_time)) {
+            $web_archive = new WebArchiveBundle(
+                CRAWL_DIR.'/cache/'.$prefix.self::archive_base_name.
+                    $crawl_time);
+            $page = $web_archive->getPage($offset,
+                $partition);
+            echo base64_encode(serialize($page));
+        } else {
+            echo base64_encode(serialize(false));
+        }
     }
 }
 ?>
diff --git a/models/datasources/pdo_manager.php b/models/datasources/pdo_manager.php
index 856ef5e1e..b2ab966db 100644
--- a/models/datasources/pdo_manager.php
+++ b/models/datasources/pdo_manager.php
@@ -71,8 +71,6 @@ class PdoManager extends DatasourceManager
     function connect($db_host = DB_HOST, $db_user = DB_USER,
         $db_password = DB_PASSWORD, $db_name = DB_NAME)
     {
-        //assuming db_name is part of $db_host
-        crawlLog($db_host." ".$db_user." ".$db_password);
         try {
             $this->pdo = new PDO($db_host, $db_user, $db_password);
         } catch (PDOException $e) {
ViewGit