exception.class.inc.php in Calendar Systems 8.2
File
calendar/lib/exception.class.inc.php
View source
<?php
if (!class_exists('cmfcException')) {
define('CMF_ERROR_RETURN', 1);
define('CMF_ERROR_PRINT', 2);
define('CMF_ERROR_TRIGGER', 4);
define('CMF_ERROR_DIE', 8);
define('CMF_ERROR_CALLBACK', 16);
if (!class_exists('Exception')) {
class Exception {
}
}
class cmfcExceptionStandAlone extends Exception {
public static function raiseError($message = null, $code = null, $mode = null, $options = null, $userinfo = null, $error_class = null, $skipmsg = false) {
if ($code == CMF_ERROR_DIE) {
echo $message;
exit;
}
return new cmfcException($message, $code);
}
public static function isError($obj, $code = null) {
if (strtolower(get_class($obj)) == strtolower('cmfcExceptionStandAlone') || strtolower(get_class($obj)) == strtolower('Exception') || strtolower(get_class($obj)) == 'pear_error') {
return true;
}
else {
return false;
}
}
}
}