]> granicus.if.org Git - php/commitdiff
* renamed toString method to __string_value
authorStig Bakken <ssb@php.net>
Mon, 28 Aug 2000 23:09:36 +0000 (23:09 +0000)
committerStig Bakken <ssb@php.net>
Mon, 28 Aug 2000 23:09:36 +0000 (23:09 +0000)
pear/DB.php
pear/PEAR.php.in

index b111aaa801b875353eb52df80c5e2dbde3657d10..d4fd20af6abdbe57e2963677e3927d756fb3e89b 100644 (file)
@@ -369,7 +369,7 @@ class DB {
                if (!$parsed['database'])
                        $dsn = preg_replace('|/+$|', '', $dsn);
 
-               $parsed['hostspec'] = $dsn;
+               $parsed['hostspec'] = urldecode($dsn);
 
                if (!$parsed['dbsyntax']) {
                        $parsed['dbsyntax'] = $parsed['phptype'];
index 35753309260d5d438d615238d2cecbf4c6ebe049..3935b91aa4492ae467f4a37170c0ec03efc012c3 100644 (file)
@@ -233,14 +233,14 @@ class PEAR_Error
        }
 
     // }}}
-    // {{{ toString()
+    // {{{ __string_value()
 
        /**
         * Make a string representation of this object.
         *
         * @return string a string with an object "summary"
         */
-       function toString() {
+       function __string_value() {
                $modes = array(PEAR_ERROR_RETURN => "return",
                                           PEAR_ERROR_PRINT => "print",
                                           PEAR_ERROR_TRIGGER => "trigger",
@@ -248,9 +248,11 @@ class PEAR_Error
                $levels = array(E_USER_NOTICE => "notice",
                                                E_USER_WARNING => "warning",
                                                E_USER_ERROR => "error");
-               return sprintf("[%s: message=%s code=%d mode=%s level=%s prefix=%s prepend=%s append=%s]",
-                                          $this->message, $this->code, $modes[$this->mode], $levels[$this->level],
-                                          $this->error_message_prefix, $this->error_prepend, $this->error_append);
+               return sprintf("[%s: message=\"%s\" code=%d mode=%s level=%s prefix=\"%s\" prepend=\"%s\" append=\"%s\"]",
+                                          get_class($this), $this->message, $this->code,
+                                          $modes[$this->mode], $levels[$this->level],
+                                          $this->error_message_prefix, $this->error_prepend,
+                                          $this->error_append);
        }
 
     // }}}