diff options
author | SVN Migration <svn@php.net> | 2003-12-19 20:39:05 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2003-12-19 20:39:05 +0000 |
commit | fc1a9b7558738019cb4276659a851eca10cdea7e (patch) | |
tree | 330bf7b1b09d7462be9df62ebd5869572386b8b2 /ext/spl/examples/dba_reader.inc | |
parent | 331dc79254566ee777f6af7be9232f1f647c9474 (diff) | |
download | php-git-php-5.0.0b3RC2.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_0_0b3RC2'.php-5.0.0b3RC2
Diffstat (limited to 'ext/spl/examples/dba_reader.inc')
-rwxr-xr-x | ext/spl/examples/dba_reader.inc | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/ext/spl/examples/dba_reader.inc b/ext/spl/examples/dba_reader.inc deleted file mode 100755 index d21db45613..0000000000 --- a/ext/spl/examples/dba_reader.inc +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -/** - * @brief This implements a Dba Iterator. - * @author Marcus Boerger - * @version 1.0 - */ -class DbaReader implements Iterator -{ - - private $db = NULL; - private $key = false; - private $val = false; - - /** - * Open database $file with $handler in read only mode. - * - * @param file Database file to open. - * @param handler Handler to use for database access. - */ - function __construct($file, $handler) { - $this->db = dba_open($file, 'r', $handler); - } - - /** - * Close database. - */ - function __destruct() { - if ($this->db) { - dba_close($this->db); - } - } - - /** - * Rewind to first element. - */ - function rewind() { - if ($this->db) { - $this->key = dba_firstkey($this->db); - } - } - - /** - * @return Current data. - */ - function current() { - return $this->val; - } - - /** - * Move to next element. - * - * @return void - */ - function next() { - if ($this->db) { - $this->key = dba_nextkey($this->db); - if ($this->key !== false) { - $this->val = dba_fetch($this->key, $this->db); - } - } - } - - /** - * @return Whether more elements are available. - */ - function hasMore() { - if ($this->db && $this->key !== false) { - return true; - } else { - return false; - } - } - - /** - * @return Current key. - */ - function key() { - return $this->key; - } -} - -?>
\ No newline at end of file |