Removing of some warnings
This commit is contained in:
parent
46c7cb5b72
commit
e2f9ae3970
|
@ -655,7 +655,7 @@ function attribute_contains($attr,$s) {
|
||||||
if(! function_exists('logger')) {
|
if(! function_exists('logger')) {
|
||||||
/* setup int->string log level map */
|
/* setup int->string log level map */
|
||||||
$LOGGER_LEVELS = array();
|
$LOGGER_LEVELS = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* log levels:
|
* log levels:
|
||||||
* LOGGER_NORMAL (default)
|
* LOGGER_NORMAL (default)
|
||||||
|
@ -663,7 +663,7 @@ $LOGGER_LEVELS = array();
|
||||||
* LOGGER_DEBUG
|
* LOGGER_DEBUG
|
||||||
* LOGGER_DATA
|
* LOGGER_DATA
|
||||||
* LOGGER_ALL
|
* LOGGER_ALL
|
||||||
*
|
*
|
||||||
* @global App $a
|
* @global App $a
|
||||||
* @global dba $db
|
* @global dba $db
|
||||||
* @param string $msg
|
* @param string $msg
|
||||||
|
@ -674,15 +674,16 @@ function logger($msg,$level = 0) {
|
||||||
global $a;
|
global $a;
|
||||||
global $db;
|
global $db;
|
||||||
global $LOGGER_LEVELS;
|
global $LOGGER_LEVELS;
|
||||||
|
|
||||||
if(($a->module == 'install') || (! ($db && $db->connected))) return;
|
if(($a->module == 'install') || (! ($db && $db->connected))) return;
|
||||||
|
|
||||||
if (count($LOGGER_LEVEL)==0){
|
if (count($LOGGER_LEVELS)==0){
|
||||||
foreach (get_defined_constants() as $k=>$v){
|
foreach (get_defined_constants() as $k=>$v){
|
||||||
if (substr($k,0,7)=="LOGGER_") $LOGGER_LEVELS[$v] = substr($k,7,7);
|
if (substr($k,0,7)=="LOGGER_")
|
||||||
}
|
$LOGGER_LEVELS[$v] = substr($k,7,7);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$debugging = get_config('system','debugging');
|
$debugging = get_config('system','debugging');
|
||||||
$loglevel = intval(get_config('system','loglevel'));
|
$loglevel = intval(get_config('system','loglevel'));
|
||||||
$logfile = get_config('system','logfile');
|
$logfile = get_config('system','logfile');
|
||||||
|
|
|
@ -432,7 +432,7 @@ else
|
||||||
$a->page['htmlhead'] = str_replace('{{$stylesheet}}',$stylesheet,$a->page['htmlhead']);
|
$a->page['htmlhead'] = str_replace('{{$stylesheet}}',$stylesheet,$a->page['htmlhead']);
|
||||||
//$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet));
|
//$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();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
$target = new DOMDocument();
|
$target = new DOMDocument();
|
||||||
|
@ -455,7 +455,7 @@ if (($_GET["mode"] == "raw") OR ($_GET["mode"] == "minimal")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ $profile = $a->profile;
|
||||||
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".
|
//$page['content'] = substr($target->saveHTML(), 6, -8)."\n\n".
|
||||||
// '<div id="conversation-end"></div>'."\n\n";
|
// '<div id="conversation-end"></div>'."\n\n";
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class QueryException extends \Exception {
|
||||||
* and print them as exception
|
* and print them as exception
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
public function __construct(\PDOStatement $objPDO, $arrQueryDefinition) {
|
public function __construct(\PDOStatement $objPDO, array $arrQueryDefinition) {
|
||||||
|
|
||||||
$strMessage = self::createErrorMessage($objPDO, $arrQueryDefinition);
|
$strMessage = self::createErrorMessage($objPDO, $arrQueryDefinition);
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class QueryException extends \Exception {
|
||||||
* and query definition
|
* and query definition
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
private function createErrorMessage($objPDO, $arrQueryDefinition) {
|
private function createErrorMessage(\PDOStatement $objPDO, array $arrQueryDefinition) {
|
||||||
|
|
||||||
$strMessage = self::flattenQueryErrorInfo($objPDO);
|
$strMessage = self::flattenQueryErrorInfo($objPDO);
|
||||||
$strMessage .= self::flattenQueryDefiniton($arrQueryDefinition);
|
$strMessage .= self::flattenQueryDefiniton($arrQueryDefinition);
|
||||||
|
@ -57,7 +57,7 @@ class QueryException extends \Exception {
|
||||||
* from the driver specific error message
|
* from the driver specific error message
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
private function flattenQueryErrorInfo($objPDO) {
|
private function flattenQueryErrorInfo(\PDOStatement $objPDO) {
|
||||||
|
|
||||||
$arrErrorInfo = $objPDO->errorInfo();
|
$arrErrorInfo = $objPDO->errorInfo();
|
||||||
|
|
||||||
|
@ -76,16 +76,18 @@ class QueryException extends \Exception {
|
||||||
*
|
*
|
||||||
* @return (string) a text version of the query definition
|
* @return (string) a text version of the query definition
|
||||||
*
|
*
|
||||||
* create an text, which contains all information
|
* create an text, which contains all *scalar* information
|
||||||
* of the query definition
|
* of the query definition. if there are non-scalar information
|
||||||
|
* added, the will be excluded from output
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
private function flattenQueryDefiniton($arrQueryDefinition) {
|
private function flattenQueryDefiniton(array $arrQueryDefinition) {
|
||||||
|
|
||||||
$strMessage = "\nQuery-Definiton:\n";
|
$strMessage = "\nQuery-Definiton:\n";
|
||||||
|
|
||||||
foreach($arrQueryDefinition AS $strKeyword => $strContent)
|
foreach($arrQueryDefinition AS $strKeyword => $strContent)
|
||||||
$strMessage .= "$strKeyword: $strContent\n";
|
if(is_scalar($strContent))
|
||||||
|
$strMessage .= "$strKeyword: $strContent\n";
|
||||||
|
|
||||||
return $strMessage . "\n";
|
return $strMessage . "\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user