if(! function_exists('logger')) {
/* setup int->string log level map */
$LOGGER_LEVELS = array();
-
+
/**
* log levels:
* LOGGER_NORMAL (default)
* LOGGER_DEBUG
* LOGGER_DATA
* LOGGER_ALL
- *
+ *
* @global App $a
* @global dba $db
* @param string $msg
global $a;
global $db;
global $LOGGER_LEVELS;
-
+
if(($a->module == 'install') || (! ($db && $db->connected))) return;
- if (count($LOGGER_LEVEL)==0){
- foreach (get_defined_constants() as $k=>$v){
- if (substr($k,0,7)=="LOGGER_") $LOGGER_LEVELS[$v] = substr($k,7,7);
- }
- }
-
+ if (count($LOGGER_LEVELS)==0){
+ foreach (get_defined_constants() as $k=>$v){
+ if (substr($k,0,7)=="LOGGER_")
+ $LOGGER_LEVELS[$v] = substr($k,7,7);
+ }
+ }
+
$debugging = get_config('system','debugging');
$loglevel = intval(get_config('system','loglevel'));
$logfile = get_config('system','logfile');
$a->page['htmlhead'] = str_replace('{{$stylesheet}}',$stylesheet,$a->page['htmlhead']);
//$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet));
-if (($_GET["mode"] == "raw") OR ($_GET["mode"] == "minimal")) {
+if (isset($_GET["mode"]) AND (($_GET["mode"] == "raw") OR ($_GET["mode"] == "minimal"))) {
$doc = new DOMDocument();
$target = new DOMDocument();
}
}
-if ($_GET["mode"] == "raw") {
+if (isset($_GET["mode"]) AND ($_GET["mode"] == "raw")) {
header("Content-type: text/html; charset=utf-8");
header("Content-type: text/html; charset=utf-8");
-if ($_GET["mode"] == "minimal") {
+if (isset($_GET["mode"]) AND ($_GET["mode"] == "minimal")) {
//$page['content'] = substr($target->saveHTML(), 6, -8)."\n\n".
// '<div id="conversation-end"></div>'."\n\n";
* and print them as exception\r
*\r
**/\r
- public function __construct(\PDOStatement $objPDO, $arrQueryDefinition) {\r
+ public function __construct(\PDOStatement $objPDO, array $arrQueryDefinition) {\r
\r
$strMessage = self::createErrorMessage($objPDO, $arrQueryDefinition);\r
\r
* and query definition\r
*\r
**/\r
- private function createErrorMessage($objPDO, $arrQueryDefinition) {\r
+ private function createErrorMessage(\PDOStatement $objPDO, array $arrQueryDefinition) {\r
\r
$strMessage = self::flattenQueryErrorInfo($objPDO);\r
$strMessage .= self::flattenQueryDefiniton($arrQueryDefinition);\r
* from the driver specific error message\r
*\r
**/\r
- private function flattenQueryErrorInfo($objPDO) {\r
+ private function flattenQueryErrorInfo(\PDOStatement $objPDO) {\r
\r
$arrErrorInfo = $objPDO->errorInfo();\r
\r
* \r
* @return (string) a text version of the query definition\r
* \r
- * create an text, which contains all information \r
- * of the query definition\r
+ * create an text, which contains all *scalar* information \r
+ * of the query definition. if there are non-scalar information\r
+ * added, the will be excluded from output\r
*\r
**/\r
- private function flattenQueryDefiniton($arrQueryDefinition) {\r
+ private function flattenQueryDefiniton(array $arrQueryDefinition) {\r
\r
$strMessage = "\nQuery-Definiton:\n";\r
\r
foreach($arrQueryDefinition AS $strKeyword => $strContent)\r
- $strMessage .= "$strKeyword: $strContent\n";\r
+ if(is_scalar($strContent))\r
+ $strMessage .= "$strKeyword: $strContent\n";\r
\r
return $strMessage . "\n";\r
\r