root/trunk/gregarius/cls/errorhandler.php

Revision 1181, 1.8 kB (checked in by mbonetti, 3 years ago)

Copyright (C) 2003 - 2006
(and s'more stuff thrown in)

  • Property svn:eolstyle set to native
Line 
1<?php
2
3###############################################################################
4# Gregarius - A PHP based RSS aggregator.
5# Copyright (C) 2003 - 2006 Marco Bonetti
6#
7###############################################################################
8# This program is free software and open source software; you can redistribute
9# it and/or modify it under the terms of the GNU General Public License as
10# published by the Free Software Foundation; either version 2 of the License,
11# or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15# FITNESS FOR A PARTICULAR PURPOSE.      See the GNU General Public License for
16# more details.
17#
18# You should have received a copy of the GNU General Public License along
19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
21# http://www.gnu.org/licenses/gpl.html
22#
23###############################################################################
24# E-mail:          mbonetti at gmail dot com
25# Web page:        http://gregarius.net/
26#
27###############################################################################
28
29class ErrorHandler {
30
31        var $errors = null;
32       
33        function ErrorHandler() {
34                $this -> errors = array(
35                        RSS_ERROR_ERROR => array(),
36                        RSS_ERROR_WARNING => array(),
37                        RSS_ERROR_NOTICE => array()
38                );
39        }
40       
41        function getErrorCount() {
42                return 
43                        (count($this -> errors[RSS_ERROR_NOTICE]) +
44                        count($this -> errors[RSS_ERROR_WARNING]) + 
45                        count($this -> errors[RSS_ERROR_ERROR]));
46        }
47       
48        function appendError($error, $severity = RSS_ERROR_ERROR) {
49                $this -> errors[$severity][] = $error;
50        }
51               
52        function render() {
53                rss_require(RSS::getTemplateFile("error.php"));
54  }
55       
56
57}
58
59?>
Note: See TracBrowser for help on using the browser.