Adds documentation to all the modified files in preparation for 0.80, a=chris

Chris Pollett [2011-12-05 06:Dec:th]
Adds documentation to all the modified files in preparation for 0.80, a=chris
Filename
bin/fetcher.php
bin/queue_server.php
controllers/admin_controller.php
controllers/machine_controller.php
models/machine_model.php
models/profile_model.php
views/elements/managemachines_element.php
views/elements/pageoptions_element.php
views/machinestatus_view.php
diff --git a/bin/fetcher.php b/bin/fetcher.php
index 62494b584..9e9a604d5 100755
--- a/bin/fetcher.php
+++ b/bin/fetcher.php
@@ -322,7 +322,7 @@ class Fetcher implements CrawlConstants
         global $argv;

         // To use CrawlDaemon need to declare ticks first
-        declare(ticks=50);
+        declare(ticks=200);
         CrawlDaemon::init($argv, "fetcher");
         if(isset($argv[2]) ) {
             $this->fetcher_num = intval($argv[2]);
diff --git a/bin/queue_server.php b/bin/queue_server.php
index ee94abe2a..847e4def0 100755
--- a/bin/queue_server.php
+++ b/bin/queue_server.php
@@ -280,7 +280,7 @@ class QueueServer implements CrawlConstants
     {
         global $argv;

-        declare(ticks=500);
+        declare(ticks=200);
         CrawlDaemon::init($argv, "queue_server");
         crawlLog("\n\nInitialize logger..", "queue_server");
         $this->loop();
diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php
index 750ac0bcc..17d74e01e 100755
--- a/controllers/admin_controller.php
+++ b/controllers/admin_controller.php
@@ -317,8 +317,14 @@ class AdminController extends Controller implements CrawlConstants
     }

     /**
-     *
-     * @return array $data
+     * Gets data from the machineModel concerning the on/off states
+     * of the machines managed by this Yioop instance and then passes
+     * this data the the machinestatus view.
+     * @return array $data MACHINES field has information about each
+     *      machine managed by this Yioop instance as well the on off
+     *      status of its queue_servers and fetchers.
+     *      The REFRESH field is used to tell the controller that the
+     *      view shouldn't have its own sidemenu.
      */
     function machineStatus()
     {
@@ -1508,7 +1514,12 @@ class AdminController extends Controller implements CrawlConstants
      * Handles admin request related to the managing the machines which perform
      *  crawls
      *
-     * @return array $data
+     * With this activity an admin can add/delete machines to manage. For each
+     * managed machine, the admin can stop and start fetchers/queue_servers
+     * as well as look at their log files
+     *
+     * @return array $data MACHINES, their MACHINE_NAMES, data for
+     *      FETCHER_NUMBERS drop-down
      */
     function manageMachines()
     {
diff --git a/controllers/machine_controller.php b/controllers/machine_controller.php
index 317a55d0b..5671582c4 100644
--- a/controllers/machine_controller.php
+++ b/controllers/machine_controller.php
@@ -93,7 +93,7 @@ class MachineController extends Controller implements CrawlConstants
     }

     /**
-     * Checks the running/non running status of the
+     * Checks the running/non-running status of the
      * fetchers and queue_servers of the current Yioop instance
      */
     function statuses()
diff --git a/models/machine_model.php b/models/machine_model.php
index 4517da981..b89d81d75 100644
--- a/models/machine_model.php
+++ b/models/machine_model.php
@@ -129,6 +129,9 @@ class MachineModel extends Model
     /**
      * Returns the statuses of machines in the machine table of their
      * fetchers and queue_server as well as the name and url's of these machines
+     *
+     * @return array  a list of machines, together with all their properties
+     *  and the statuses of their fetchers and queue_servers
      */
     function getMachineStatuses()
     {
diff --git a/models/profile_model.php b/models/profile_model.php
index c97cec220..43b6b7e00 100644
--- a/models/profile_model.php
+++ b/models/profile_model.php
@@ -193,7 +193,7 @@ EOT;
     }

     /**
-     * Creates a  directory and sets it to owrld prermission if it doesn't
+     * Creates a  directory and sets it to world prermission if it doesn't
      * aleady exist
      *
      * @param string $directory name of directory to create
diff --git a/views/elements/managemachines_element.php b/views/elements/managemachines_element.php
index 949392f86..a8fb6a772 100644
--- a/views/elements/managemachines_element.php
+++ b/views/elements/managemachines_element.php
@@ -34,7 +34,10 @@
 if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}

 /**
- * Used to draw the admin screen on which admin users can
+ * Used to draw the admin screen on which admin users can add/delete
+ * and manage machines which might act as fetchers or queue_servers.
+ * The managing protion of this element is actually done via an ajax
+ * call of the mMchinestatusView
  *
  * @author Chris Pollett
  * @package seek_quarry
@@ -45,8 +48,10 @@ class ManagemachinesElement extends Element
 {

     /**
+     * Draws the ManageMachines element to the output buffer
      *
-     * @param array $data  contains antiCSRF token, as well as data on
+     * @param array $data  contains antiCSRF token, as well as data for
+     * the select fetcher number element.
      */
     public function render($data)
     {?>
diff --git a/views/elements/pageoptions_element.php b/views/elements/pageoptions_element.php
index 68365fd68..29cc6fb12 100644
--- a/views/elements/pageoptions_element.php
+++ b/views/elements/pageoptions_element.php
@@ -34,6 +34,9 @@
 if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}

 /**
+ * This element is used to render the Page Options admin activity
+ * This activity lets a usercontrol the amount of web pages downloaded,
+ * the recrawl frequency, the file types, etc of the pages crawled
  *
  * @author Chris Pollett
  *
@@ -45,8 +48,10 @@ class PageOptionsElement extends Element
 {

     /**
+     * Draws the page options element to the output buffer
      *
-     * @param array $data keys used to store disallowed_sites
+     * @param array $data used to keep track of page range, recrawl frequency,
+     *  and file types of the page
      */
     public function render($data)
     {
diff --git a/views/machinestatus_view.php b/views/machinestatus_view.php
index 00024d408..3ded40864 100644
--- a/views/machinestatus_view.php
+++ b/views/machinestatus_view.php
@@ -35,7 +35,8 @@ if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}

 /**
  * This view is used to display information about
- * crawls that have been made by this seek_quarry instance
+ * the on/off state of the queue_servers and fetchers managed by
+ * this instance of Yioop.
  *
  * @author Chris Pollett
  * @package seek_quarry
@@ -46,17 +47,16 @@ class MachinestatusView extends View
 {
     /**
      * Names of helper objects that the view uses to help draw itself
+     * toggle is used to draw an On/Off switch
      * @var array
      */
     var $helpers = array('toggle');

     /**
-     * An Ajax call from the Manage Crawl Element in Admin View triggers
-     * this view to be instantiated. The renderView method then draws statistics
-     * about the currently active crawl.The $data is supplied by the crawlStatus
-     * method of the AdminController.
+     * Draws the ManagestatusView to the output buffer
      *
-     * @param array $data   info about the current crawl status
+     * @param array $data  contains on/off status info for each of the machines
+     *      managed by this Yioop instance.
      */
     public function renderView($data)
     {
ViewGit