]> granicus.if.org Git - php/commitdiff
New naming sequence for PEAR_Error
authorSterling Hughes <sterling@php.net>
Fri, 21 Jul 2000 18:34:37 +0000 (18:34 +0000)
committerSterling Hughes <sterling@php.net>
Fri, 21 Jul 2000 18:34:37 +0000 (18:34 +0000)
  - PEAR_ERROR -> PEAR_Error
  - $CLASSNAME -> $classname

New naming sequence for Exceptions
  - ExceptionFileFind -> FileFindException.

pear/Makefile.in
pear/PEAR_Error.php [moved from pear/PEAR_ERROR.php with 68% similarity]

index e427a020cb854f22d6cf21c073ae39c3e576559a..4fbdf6cf53935e8cd582ff86458aeb7e85f12c82 100644 (file)
@@ -19,7 +19,7 @@ PEAR_FILES = \
        DB/storage.php \
        HTTP.php \
        File/Find.php \
-       PEAR_ERROR.php
+       PEAR_Error.php
 
 install-data-local:
        @if $(mkinstalldirs) $(peardir); then \
similarity index 68%
rename from pear/PEAR_ERROR.php
rename to pear/PEAR_Error.php
index 1c45bd23a0c7fec8439f19b7953d8af0e480806c..7fa221805988130b6988fdf71af40f9f5ffe2107 100644 (file)
 // This class is based on ideas from Ulf Wendel
 //
 
-class PEAR_ERROR
+class PEAR_Error
 {
-       var $CLASSNAME            = '';
-       var $ERROR_MESSAGE_PREFIX = '';
-       var $ERROR_PREPEND        = '';
-       var $ERROR_APPEND         = '';
+       var $classname            = '';
+       var $error_message_prefix = '';
+       var $error_prepend        = '';
+       var $error_append         = '';
        
-       var $DIE_ON_ERROR         = '';
-       var $AUTO_PRINT_ERROR     = '';
+       var $die_on_error         = false;
+       var $auto_print_error     = false;
        
-       var $LEVEL         = 0;
-       var $TRIGGER_ERROR = false;
+       var $level         = 0;
+       var $trigger_error = false;
        
        var $message = '';
        var $file    = '';
        var $line    = 0;
        
-       function PEAR_ERROR ($message, $file = __FILE__, $line = __LINE__)
+       /*
+        * constructor, set the basics...
+        */
+       function PEAR_Error ($message, $file = __FILE__, $line = __LINE__)
        {
                $this->message = $message;
                $this->file    = $file;
                $this->line    = $line;
        }
        
+       /*
+        *  string getMessage (void)
+        *    Get the error message from an exception object.
+        */
        function getMessage ()
        {
-               return ($this->ERROR_PREPEND . $this->ERROR_MESSAGE_PREFIX .
-                       $this->message       . $this->ERROR_APPEND);
+               return ($this->error_prepend . $this->error_message_prefix .
+                       $this->message       . $this->error_append);
        }
        
+       /*
+        * string getType (void)
+        *  Get the name of the exception.
+        */
        function getType ()
        {
-               return ($this->CLASSNAME);
+               return ($this->classname);
        }
 }
\ No newline at end of file