Commit 73332110b58cfc704a3fb36616ed47d355760eba

Authored by kevin_fourie
1 parent d078671e

Merged in from DEV trunk...

KTS-3268
"Logging"
Updated. Custom error handler includes old logging

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/branches/3.5.3-Branch@8723 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/validation/customerrorhandler.php
... ... @@ -6,65 +6,64 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 */
37 37 //require_once(KT_DIR.'config/dmsDefaults.php');
38   - require_once(KT_LIB_DIR.'/Log.inc');
39 38  
40 39 class KTCustomErrorHandler
41 40 {
42 41 // {{{ initCustomErrorHandler()
43 42 function initCustomErrorHandler ()
44 43 {
45   - return $oCustomErrorHandler =& new KTCustomErrorHandler;
  44 + return $oCustomErrorHandler =& new KTCustomErrorHandler;
46 45 }
47 46 // }}}
48   -
49   - // {{{ logError()
50   - function logError($oError)
51   -
  47 +
  48 + // {{{ logError()
  49 + function logError($oError)
  50 +
52 51 {
53 52 global $default;
54   -
  53 +
55 54 $sErrorType = '';
56 55 if(substr($oError->toString(),1,2) == 'db')
57 56 {
58   - $sErrorType = 'database_error';
  57 + $sErrorType = 'database_error';
59 58 }
60 59 else
61 60 {
62 61 $sErrorType = 'unknown_error';
63 62 }
64   -
65   -
  63 +
  64 +
66 65 $default->log->error($oError->toString());
67   -
  66 +
68 67 }
69 68 }
70 69 ?>
... ...