Get rid of name collision caused by readLine, a=chris

Chris Pollett [2012-09-15 21:Sep:th]
Get rid of name collision caused by readLine, a=chris
Filename
configs/config.php
configs/configure_tool.php
lib/utility.php
tests/it_stemmer_test.php
diff --git a/configs/config.php b/configs/config.php
index 72e248f73..2820c1ce0 100644
--- a/configs/config.php
+++ b/configs/config.php
@@ -63,7 +63,7 @@ if(MAINTENANCE_MODE && $_SERVER["SERVER_ADDR"] != $_SERVER["REMOTE_ADDR"]) {
 if(!defined('WORK_DIRECTORY')) {
 /*+++ The next block of code is machine edited, change at
 your own risk, please use configure web page instead +++*/
-define('WORK_DIRECTORY', '/Applications/XAMPP/xamppfiles/htdocs/crawls');
+define('WORK_DIRECTORY', '');
 /*++++++*/
 }

diff --git a/configs/configure_tool.php b/configs/configure_tool.php
index 5a7bded8f..9acb16390 100644
--- a/configs/configure_tool.php
+++ b/configs/configure_tool.php
@@ -164,7 +164,7 @@ class ConfigureTool
         e("Enter a new value:\n");

         $this->prepareGlobals($data);
-        $_REQUEST["WORK_DIRECTORY"] = readLine();
+        $_REQUEST["WORK_DIRECTORY"] = readInput();
         $_REQUEST["arg"] = "directory";

         $next_menu = $this->confirmChange("configure", "workDirectory");
@@ -409,12 +409,12 @@ class ConfigureTool

             case "serverKey":
                 e("Enter a new server key: ");
-                $_REQUEST["AUTH_KEY"] = readLine();
+                $_REQUEST["AUTH_KEY"] = readInput();
             break;

             case "nameServer":
                 e("Enter a new name server url: ");
-                $_REQUEST["NAME_SERVER"] = readLine();
+                $_REQUEST["NAME_SERVER"] = readInput();
             break;

             case "memcacheServers":
@@ -469,12 +469,12 @@ class ConfigureTool

             case "robotName":
                 e("Enter a new robot name: ");
-                $_REQUEST["USER_AGENT_SHORT"] = readLine();
+                $_REQUEST["USER_AGENT_SHORT"] = readInput();
             break;

             case "robotInstance":
                 e("Enter a new robot instance value: ");
-                $_REQUEST["ROBOT_INSTANCE"] = readLine();
+                $_REQUEST["ROBOT_INSTANCE"] = readInput();
             break;

             case "robotDescription":
@@ -555,7 +555,7 @@ class ConfigureTool
         }

         e("\nPlease choose an option:\n");
-        $user_data = strtolower(trim(readLine()));
+        $user_data = strtolower(trim(readInput()));

         if($user_data >= 1 && $user_data < $i) {
             $_REQUEST["MESSAGE"] = "";
@@ -594,7 +594,7 @@ class ConfigureTool
                 $_SERVER['REQUEST_URI'] = $data['WEB_URI'];
             } else {
                 e("Enter web path for Yioop instance:\n");
-                $_SERVER['REQUEST_URI'] = readLine();
+                $_SERVER['REQUEST_URI'] = readInput();
             }
         }
     }
diff --git a/lib/utility.php b/lib/utility.php
index 8695f7e6e..74ea9daba 100755
--- a/lib/utility.php
+++ b/lib/utility.php
@@ -815,7 +815,7 @@ function e($text)
  * Used to read a line of input from the command-line
  * @return string from the command-line
  */
-function readLine()
+function readInput()
 {
     $stdin = fopen('php://stdin', 'r');
     $line = fgets($stdin);
@@ -824,7 +824,6 @@ function readLine()
     return $line;
 }

-
 /**
  * Used to read a line of input from the command-line
  * (on unix machines without echoing it)
@@ -833,7 +832,7 @@ function readLine()
 function readPassword()
 {
     system('stty -echo');
-    $line = readLine();
+    $line = readInput();
     if(!strstr(PHP_OS, "WIN")) {
         e(str_repeat("*", strlen($line))."\n");
     }
@@ -853,7 +852,7 @@ function readMessage()
     $line = "";
     do {
         $message .= $line;
-        $line = readLine()."\n";
+        $line = readInput()."\n";
     } while(rtrim($line) != ".");

     return rtrim($message);
diff --git a/tests/it_stemmer_test.php b/tests/it_stemmer_test.php
index 65efa69ec..994b0fd43 100644
--- a/tests/it_stemmer_test.php
+++ b/tests/it_stemmer_test.php
@@ -1,4 +1,4 @@
-<?php
+<?php
 /**
  *  SeekQuarry/Yioop --
  *  Open Source Pure PHP Search Engine, Crawler, and Indexer
ViewGit