diff --git a/pear/Makefile.in b/pear/Makefile.in index 92818c0d78b..e427a020cb8 100644 --- a/pear/Makefile.in +++ b/pear/Makefile.in @@ -18,7 +18,8 @@ PEAR_FILES = \ DB/pgsql.php \ DB/storage.php \ HTTP.php \ - File/Find.php + File/Find.php \ + PEAR_ERROR.php install-data-local: @if $(mkinstalldirs) $(peardir); then \ diff --git a/pear/PEAR_ERROR.php b/pear/PEAR_ERROR.php new file mode 100644 index 00000000000..1c45bd23a0c --- /dev/null +++ b/pear/PEAR_ERROR.php @@ -0,0 +1,62 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id$ +// +// Commonly needed functions searching directory trees +// + +// +// This class is based on ideas from Ulf Wendel +// + +class PEAR_ERROR +{ + var $CLASSNAME = ''; + var $ERROR_MESSAGE_PREFIX = ''; + var $ERROR_PREPEND = ''; + var $ERROR_APPEND = ''; + + var $DIE_ON_ERROR = ''; + var $AUTO_PRINT_ERROR = ''; + + var $LEVEL = 0; + var $TRIGGER_ERROR = false; + + var $message = ''; + var $file = ''; + var $line = 0; + + function PEAR_ERROR ($message, $file = __FILE__, $line = __LINE__) + { + $this->message = $message; + $this->file = $file; + $this->line = $line; + } + + function getMessage () + { + return ($this->ERROR_PREPEND . $this->ERROR_MESSAGE_PREFIX . + $this->message . $this->ERROR_APPEND); + } + + function getType () + { + return ($this->CLASSNAME); + } +} \ No newline at end of file