helly           Thu Dec  4 15:56:33 2003 EDT

  Modified files:              
    /spl        spl_directory.c 
    /spl/examples       cachingiterator.inc 
  Log:
  Update __toString() issues
  
Index: spl/spl_directory.c
diff -u spl/spl_directory.c:1.16 spl/spl_directory.c:1.17
--- spl/spl_directory.c:1.16    Tue Dec  2 02:13:53 2003
+++ spl/spl_directory.c Thu Dec  4 15:56:31 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.16 2003/12/02 07:13:53 helly Exp $ */
+/* $Id: spl_directory.c,v 1.17 2003/12/04 20:56:31 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -59,7 +59,6 @@
 SPL_METHOD(RecursiveDirectoryIterator, key);
 SPL_METHOD(RecursiveDirectoryIterator, hasChildren);
 SPL_METHOD(RecursiveDirectoryIterator, getChildren);
-SPL_METHOD(RecursiveDirectoryIterator, __toString);
 
 
 /* declare method parameters */
@@ -94,7 +93,6 @@
        SPL_ME(RecursiveDirectoryIterator, key,           NULL, ZEND_ACC_PUBLIC)
        SPL_ME(RecursiveDirectoryIterator, hasChildren,   NULL, ZEND_ACC_PUBLIC)
        SPL_ME(RecursiveDirectoryIterator, getChildren,   NULL, ZEND_ACC_PUBLIC)
-       SPL_MA(RecursiveDirectoryIterator, __toString, DirectoryIterator, getPathname, 
NULL, ZEND_ACC_PUBLIC)
        {NULL, NULL, NULL}
 };
 
Index: spl/examples/cachingiterator.inc
diff -u spl/examples/cachingiterator.inc:1.2 spl/examples/cachingiterator.inc:1.3
--- spl/examples/cachingiterator.inc:1.2        Sat Nov 22 15:51:15 2003
+++ spl/examples/cachingiterator.inc    Thu Dec  4 15:56:32 2003
@@ -24,7 +24,11 @@
                if ($this->more = $this->it->hasMore()) {
                        $this->current = $this->it->current();
                        $this->key = $this->it->key();
-                       $this->strvalue = (string)$this->current;
+                       if (is_object($this->current)) {
+                               $this->strvalue = $this->current->__toString();
+                       } else {
+                               $this->strvalue = (string)$this->current;
+                       }
                } else {
                        $this->current = NULL;
                        $this->key = NULL;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to