Mercurial > hg > fapweb
diff msitegen.inc.php @ 861:62b3a69e9030
Add stErrorLog() and use it.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 26 Nov 2014 11:07:22 +0200 |
parents | 83ac4155efe2 |
children | ffb5643eff4f |
line wrap: on
line diff
--- a/msitegen.inc.php Wed Nov 26 10:30:39 2014 +0200 +++ b/msitegen.inc.php Wed Nov 26 11:07:22 2014 +0200 @@ -36,6 +36,13 @@ } +function stErrorLog($msg) +{ + error_log("FAPWeb: ".$msg); + return FALSE; +} + + function stError($msg) { global $errorSet, $errorMsgs; @@ -143,7 +150,7 @@ return $default; else { - error_log("No config value for '".$name."'"); + stErrorLog("No config value for '".$name."'"); die("No config value for '".$name."'.\n"); } } @@ -345,7 +352,7 @@ $str .= $argv[$n]; else { - error_log("Invalid stErrorStrF() format string, arg #".$n. + stErrorLog("Invalid stErrorStrF() format string, arg #".$n. " referenced, but only has ".$argc." arguments: '".$fmt."'\n"); return FALSE; } @@ -512,7 +519,7 @@ $dbh = new PDO($dbspec); } catch (PDOException $e) { - error_log("Could not connect to SQL database: ".$e->getMessage()."."); + stErrorLog("Could not connect to SQL database: ".$e->getMessage()."."); return FALSE; } return $dbh; @@ -536,7 +543,7 @@ function stLogSQLError($dbh, $sql) { - error_log("SQL error '".implode("; ", $dbh->errorInfo())."' in statement: \"".$sql."\""); + stErrorLog("SQL error '".implode("; ", $dbh->errorInfo())."' in statement: \"".$sql."\""); } @@ -550,7 +557,7 @@ stGetSetting("sqlOptions", array())); } catch (PDOException $e) { - error_log("Could not connect to SQL database: ".$e->getMessage()."."); + stErrorLog("Could not connect to SQL database: ".$e->getMessage()."."); return FALSE; } $db = stConnectSQLDBSpec(stGetSetting("sqlDB")); @@ -588,7 +595,7 @@ $sql .= stDBGetSQLParam($dbh, $fmt[++$pos], $argv[$argn++]); else { - error_log("Invalid SQL statement format string '".$fmt. + stErrorLog("Invalid SQL statement format string '".$fmt. "', not enough parameters specified (".$argn." of ".$argc.")"); return FALSE; } @@ -619,7 +626,7 @@ $sql .= stDBGetSQLParam($db, $fmt[++$pos], $argv[$argn++]); else { - error_log("Invalid SQL statement format string '".$fmt. + stErrorLog("Invalid SQL statement format string '".$fmt. "', not enough parameters specified (".$argn." of ".$argc.")"); return FALSE; }