0byt3m1n1
Path:
/
data
/
applications
/
aps.bak
/
coppermine
/
1.5.12-0
/
standard
/
htdocs
/
include
/
inspekt
/
[
Home
]
File: error.php
<?php /************************* Coppermine Photo Gallery ************************ Copyright (c) 2003-2011 Coppermine Dev Team v1.0 originally written by Gregory Demar This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** Coppermine version: 1.5.12 $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/include/inspekt/error.php $ $Revision: 8154 $ **********************************************/ /** * Source file for Inspekt_Error * * @author Ed Finkler <coj@funkatron.com> * @package Inspekt */ /** * Error handling for Inspekt * * @package Inspekt * */ class Inspekt_Error { /** * Constructor * * @return Inspekt_Error */ function Inspekt_Error() { } /** * Raises an error. In >= PHP5, this will throw an exception. In PHP4, * this will trigger a user error. * * @param string $msg * @param integer $type One of the PHP Error Constants (E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE) * * @link http://www.php.net/manual/en/ref.errorfunc.php#errorfunc.constants * @todo support PHP5 exceptions without causing a syntax error. Probably should use factory pattern and instantiate a different class depending on PHP version * * @static */ function raiseError($msg, $type=E_USER_WARNING) { /*if (version_compare( PHP_VERSION, '5', '<' )) { Inspekt_Error::raiseErrorPHP4($msg, $type); } else { throw new Exception($msg, $type); }*/ Inspekt_Error::raiseErrorPHP4($msg, $type); } /** * Triggers a user error for PHP4-compatibility * * @param string $msg * @param integer $type One of the PHP Error Constants (E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE) * * @static */ function raiseErrorPHP4 ($msg, $type=NULL) { if (isset($type)) { trigger_error($msg); } else { trigger_error($msg, $type); } } }