diff --git a/qfq/exceptions/AbstractException.php b/qfq/exceptions/AbstractException.php index e50054b324b1b9df6a990f5dc0d029aa622b6171..ebaaa9e297c2dfdb6ec316d21d10b6707800c0a1 100644 --- a/qfq/exceptions/AbstractException.php +++ b/qfq/exceptions/AbstractException.php @@ -46,6 +46,9 @@ class AbstractException extends \Exception { // Layout $html = '<tr bgcolor="#dddddd"><td colspan="2">Exception</td></tr>'; foreach ($this->messageArray as $key => $value) { + if(is_array($value)) { + $value = var_export($value, true); + } $html .= "<tr>" . "<td>$key</td>" . "<td>$value</td>" . "</tr>"; } diff --git a/qfq/exceptions/DbException.php b/qfq/exceptions/DbException.php index 47562938f99d6db4967302ea644402aac34e9148..88c8384968580af5f187a0eb2d93728a22349a8d 100644 --- a/qfq/exceptions/DbException.php +++ b/qfq/exceptions/DbException.php @@ -30,7 +30,7 @@ class DbException extends AbstractException { $this->messageArray['Form Element'] = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM); $this->messageArray['Form Element Column'] = Store::getVar(SYSTEM_FORM_ELEMENT_COLUMN, STORE_SYSTEM); $this->messageArray['SQL before evaluation'] = Store::getVar(SYSTEM_SQL_RAW, STORE_SYSTEM); - $this->messageArray['SQL after evaluation'] = Store::getVar(SYSTEM_SQL_FINAL, STORE_SYSTEM); + $this->messageArray['SQL final'] = Store::getVar(SYSTEM_SQL_FINAL, STORE_SYSTEM); $this->messageArray['SQL Params'] = Store::getVar(SYSTEM_SQL_PARAM_ARRAY, STORE_SYSTEM); return parent::formatException(); diff --git a/qfq/helper/HelperFormElement.php b/qfq/helper/HelperFormElement.php index aaa156f51a4f57b09c2030ec408e4f69bc9d1204..14ee1afe07f521ec7c49c3a450f4b4728a253ff8 100644 --- a/qfq/helper/HelperFormElement.php +++ b/qfq/helper/HelperFormElement.php @@ -50,4 +50,8 @@ class HelperFormElement { } } + public static function buildFormElementId($field, $id) { + return($field . ':' . $id); + } + } \ No newline at end of file diff --git a/qfq/helper/Support.php b/qfq/helper/Support.php index f1fa8b8bde773fee47c04d0c2dce49491dab4a4b..0d3b0d56fa84720b2cce7698a1f414abd0193c23 100644 --- a/qfq/helper/Support.php +++ b/qfq/helper/Support.php @@ -60,4 +60,23 @@ class Support { return implode('&', $items); } + + /** + * @throws CodeException + */ + public static function log($text) { + + if (!is_writable(QFQ_LOG)) { + throw new CodeException ("The file (" . dirname($_SERVER['SCRIPT_FILENAME']) . '/) ' . QFQ_LOG . " is not writable ()", ERROR_LOG_NOT_WRITABLE); + } + + if (!$handle = fopen(QFQ_LOG, 'a')) { + throw new CodeException ("Cannot open file to apped: " . QFQ_LOG, ERROR_LOG_NOT_WRITABLE); + } + + if (fwrite($handle, $text . chr(10)) === FALSE) { + throw new CodeException ("Cannot write to file: " . QFQ_LOG, ERROR_LOG_NOT_WRITABLE); + } + fclose($handle); + } } \ No newline at end of file