first import
[projectpier.git] / environment / classes / Error.class.php
blobbff101b1adf88a831e4d338331a6fc23bbe6b6c2
1 <?php
3 /**
4 * Error class
5 *
6 * Errors are similar to exceptions in PHP5 but without some cool tricks
7 * that build in error handling provides.
9 * @package havoc
10 * @subpackage Base classes
11 * @version 1.0
12 * @http://www.projectpier.org/
14 class Error extends Exception {
16 /**
17 * Return error params (name -> value pairs). General params are file and line
18 * and any specific error have their own params...
20 * @access public
21 * @param void
22 * @return array
24 function getParams() {
26 // Prepare base params...
27 $base = array(
28 'file' => $this->getFile(),
29 'line' => $this->getLine()
30 ); // array
32 // Get additional params...
33 $additional = $this->getAdditionalParams();
35 // And return (join if we have additional params)
36 return is_array($additional) ? array_merge($base, $additional) : $base;
38 } // getParams
40 /**
41 * Return additional error params
43 * @access public
44 * @param void
45 * @return array
47 function getAdditionalParams() {
48 return null;
49 } // getAdditionalParams
51 } // Error