From: Marcus Boerger Date: Mon, 8 Dec 2003 08:31:08 +0000 (+0000) Subject: Use better name for the constant X-Git-Tag: php-5.0.0b3RC1~189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c1301870286f97e5c7a8b8990d0980521bfa6b2;p=php Use better name for the constant --- diff --git a/ext/spl/examples/cachingiterator.inc b/ext/spl/examples/cachingiterator.inc index f83932dbdd..d828b88e7b 100644 --- a/ext/spl/examples/cachingiterator.inc +++ b/ext/spl/examples/cachingiterator.inc @@ -1,6 +1,6 @@ it = $it; - $this->flags = $flags & (CIT_GET_STR_VALUE|CIT_CATCH_GET_CHILD); + $this->flags = $flags & (CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD); } function rewind() @@ -29,7 +29,7 @@ class CachingIterator if ($this->more = $this->it->hasMore()) { $this->current = $this->it->current(); $this->key = $this->it->key(); - if ($this->flags & CIT_GET_STR_VALUE) { + if ($this->flags & CIT_CALL_TOSTRING) { if (is_object($this->current)) { $this->strValue = $this->current->__toString(); } else { @@ -71,7 +71,7 @@ class CachingIterator function __toString() { - if (!$this->flags & CIT_GET_STR_VALUE) { + if (!$this->flags & CIT_CALL_TOSTRING) { throw new exception('CachingIterator does not fetch string value (see CachingIterator::__construct)'); } return $this->strValue; diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc index cc1f101d99..dfeeea54e7 100644 --- a/ext/spl/examples/cachingrecursiveiterator.inc +++ b/ext/spl/examples/cachingrecursiveiterator.inc @@ -6,7 +6,7 @@ class CachingRecursiveIterator extends CachingIterator implements RecursiveItera protected $getChildren; protected $catch_get_child; - function __construct(RecursiveIterator $it, $flags = CIT_GET_STR_VALUE) + function __construct(RecursiveIterator $it, $flags = CIT_CALL_TOSTRING) { parent::__construct($it, $flags); } diff --git a/ext/spl/examples/directorygraphiterator.inc b/ext/spl/examples/directorygraphiterator.inc index 50b27bf48b..a8382e2baa 100644 --- a/ext/spl/examples/directorygraphiterator.inc +++ b/ext/spl/examples/directorygraphiterator.inc @@ -4,7 +4,7 @@ class DirectoryGraphIterator extends DirectoryTreeIterator { function __construct($path) { - RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), CIT_GET_STR_VALUE|CIT_CATCH_GET_CHILD), 1); + RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD), 1); } } diff --git a/ext/spl/examples/directorytreeiterator.inc b/ext/spl/examples/directorytreeiterator.inc index 0c2717ccf2..13253d9a52 100644 --- a/ext/spl/examples/directorytreeiterator.inc +++ b/ext/spl/examples/directorytreeiterator.inc @@ -4,7 +4,7 @@ class DirectoryTreeIterator extends RecursiveIteratorIterator { function __construct($path) { - parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), CIT_GET_STR_VALUE|CIT_CATCH_GET_CHILD), 1); + parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD), 1); } function current()