diff msitegen.inc.php @ 874:ffb5643eff4f

Rename functions.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 26 Nov 2014 15:12:59 +0200
parents 62b3a69e9030
children 52737f6192bb
line wrap: on
line diff
--- a/msitegen.inc.php	Wed Nov 26 15:00:16 2014 +0200
+++ b/msitegen.inc.php	Wed Nov 26 15:12:59 2014 +0200
@@ -36,13 +36,19 @@
 }
 
 
-function stErrorLog($msg)
+function stLogError($msg)
 {
   error_log("FAPWeb: ".$msg);
   return FALSE;
 }
 
 
+function stLogSQLError($dbh, $sql)
+{
+  stLogError("SQL error '".implode("; ", $dbh->errorInfo())."' in statement: \"".$sql."\"");
+}
+
+
 function stError($msg)
 {
   global $errorSet, $errorMsgs;
@@ -150,7 +156,7 @@
     return $default;
   else
   {
-    stErrorLog("No config value for '".$name."'");
+    stLogError("No config value for '".$name."'");
     die("No config value for '".$name."'.\n");
   }
 }
@@ -352,7 +358,7 @@
           $str .= $argv[$n];
         else
         {
-          stErrorLog("Invalid stErrorStrF() format string, arg #".$n.
+          stLogError("Invalid stErrorStrF() format string, arg #".$n.
             " referenced, but only has ".$argc." arguments: '".$fmt."'\n");
           return FALSE;
         }
@@ -519,7 +525,7 @@
     $dbh = new PDO($dbspec);
   }
   catch (PDOException $e) {
-    stErrorLog("Could not connect to SQL database: ".$e->getMessage().".");
+    stLogError("Could not connect to SQL database: ".$e->getMessage().".");
     return FALSE;
   }
   return $dbh;
@@ -541,12 +547,6 @@
 }
 
 
-function stLogSQLError($dbh, $sql)
-{
-  stErrorLog("SQL error '".implode("; ", $dbh->errorInfo())."' in statement: \"".$sql."\"");
-}
-
-
 function stConnectSQLDB()
 {
   global $db;
@@ -557,7 +557,7 @@
       stGetSetting("sqlOptions", array()));
   }
   catch (PDOException $e) {
-    stErrorLog("Could not connect to SQL database: ".$e->getMessage().".");
+    stLogError("Could not connect to SQL database: ".$e->getMessage().".");
     return FALSE;
   }
   $db = stConnectSQLDBSpec(stGetSetting("sqlDB"));
@@ -595,7 +595,7 @@
         $sql .= stDBGetSQLParam($dbh, $fmt[++$pos], $argv[$argn++]);
       else
       {
-        stErrorLog("Invalid SQL statement format string '".$fmt.
+        stLogError("Invalid SQL statement format string '".$fmt.
           "', not enough parameters specified (".$argn." of ".$argc.")");
         return FALSE;
       }
@@ -626,7 +626,7 @@
         $sql .= stDBGetSQLParam($db, $fmt[++$pos], $argv[$argn++]);
       else
       {
-        stErrorLog("Invalid SQL statement format string '".$fmt.
+        stLogError("Invalid SQL statement format string '".$fmt.
           "', not enough parameters specified (".$argn." of ".$argc.")");
         return FALSE;
       }