diff options
| author | Marcus Boerger <helly@php.net> | 2004-03-08 17:33:31 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-03-08 17:33:31 +0000 |
| commit | b6b7c9eb6521f75955e285036e901a6b11ec86b5 (patch) | |
| tree | 973bf6a45c6d14a1d7623ec92916c8ad226f2d84 /ext/sqlite | |
| parent | c3b06ea21e12981f02f4da2ac0cb5d2499ff4bb5 (diff) | |
| download | php-git-b6b7c9eb6521f75955e285036e901a6b11ec86b5.tar.gz | |
Rename hasMore() to valid() as discussed. (Part I)
Diffstat (limited to 'ext/sqlite')
| -rw-r--r-- | ext/sqlite/sqlite.c | 4 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_010.phpt | 2 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_013.phpt | 4 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_016.phpt | 4 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_020.phpt | 6 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_024.phpt | 4 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_026.phpt | 2 | ||||
| -rwxr-xr-x | ext/sqlite/tests/sqlite_oo_031.phpt | 2 |
8 files changed, 16 insertions, 12 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 89235687cf..2903e4688d 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -217,7 +217,7 @@ function_entry sqlite_funcs_query[] = { /* spl_forward */ PHP_ME_MAPPING(current, sqlite_current, NULL) PHP_ME_MAPPING(next, sqlite_next, NULL) - PHP_ME_MAPPING(hasmore, sqlite_has_more, NULL) + PHP_ME_MAPPING(valid, sqlite_has_more, NULL) /* spl_sequence */ PHP_ME_MAPPING(rewind, sqlite_rewind, NULL) /* additional */ @@ -239,7 +239,7 @@ function_entry sqlite_funcs_ub_query[] = { /* spl_forward */ PHP_ME_MAPPING(current, sqlite_current, NULL) PHP_ME_MAPPING(next, sqlite_next, NULL) - PHP_ME_MAPPING(hasmore, sqlite_has_more, NULL) + PHP_ME_MAPPING(valid, sqlite_has_more, NULL) {NULL, NULL, NULL} }; diff --git a/ext/sqlite/tests/sqlite_oo_010.phpt b/ext/sqlite/tests/sqlite_oo_010.phpt index c27d538d7d..bb1fc638eb 100755 --- a/ext/sqlite/tests/sqlite_oo_010.phpt +++ b/ext/sqlite/tests/sqlite_oo_010.phpt @@ -22,7 +22,7 @@ foreach ($data as $str) { } $r = $db->unbuffered_query("SELECT a from strings", SQLITE_NUM); -while ($row = $r->hasMore()) { +while ($row = $r->valid()) { var_dump($r->current()); $r->next(); } diff --git a/ext/sqlite/tests/sqlite_oo_013.phpt b/ext/sqlite/tests/sqlite_oo_013.phpt index 3aedecc6a8..022e6f8083 100755 --- a/ext/sqlite/tests/sqlite_oo_013.phpt +++ b/ext/sqlite/tests/sqlite_oo_013.phpt @@ -22,7 +22,7 @@ foreach ($data as $str) { echo "====BUFFERED====\n"; $r = $db->query("SELECT a, b from strings"); -while ($r->hasMore()) { +while ($r->valid()) { var_dump($r->current(SQLITE_NUM)); var_dump($r->column(0)); var_dump($r->column(1)); @@ -32,7 +32,7 @@ while ($r->hasMore()) { } echo "====UNBUFFERED====\n"; $r = $db->unbuffered_query("SELECT a, b from strings"); -while ($r->hasMore()) { +while ($r->valid()) { var_dump($r->column(0)); var_dump($r->column('b')); var_dump($r->column(1)); diff --git a/ext/sqlite/tests/sqlite_oo_016.phpt b/ext/sqlite/tests/sqlite_oo_016.phpt index a9b3e2760e..ac3dac31ca 100755 --- a/ext/sqlite/tests/sqlite_oo_016.phpt +++ b/ext/sqlite/tests/sqlite_oo_016.phpt @@ -22,12 +22,12 @@ foreach ($data as $str) { echo "====BUFFERED====\n"; $r = $db->query("SELECT a, b from strings"); -while ($r->hasMore()) { +while ($r->valid()) { var_dump($r->fetch_single()); } echo "====UNBUFFERED====\n"; $r = $db->unbuffered_query("SELECT a, b from strings"); -while ($r->hasMore()) { +while ($r->valid()) { var_dump($r->fetch_single()); } echo "DONE!\n"; diff --git a/ext/sqlite/tests/sqlite_oo_020.phpt b/ext/sqlite/tests/sqlite_oo_020.phpt index 49adaea8b1..021e176917 100755 --- a/ext/sqlite/tests/sqlite_oo_020.phpt +++ b/ext/sqlite/tests/sqlite_oo_020.phpt @@ -21,6 +21,10 @@ try { } catch(sqlite_exception $err) { echo "Message: ".$err->getMessage()."\n"; echo "File: ".$err->getFile()."\n"; + echo "File: ".$err->getCode()."\n"; + echo "Line: ".$err->getLine()."\n"; + print_r($err->getTrace()); + echo "BackTrace: ".$err->getTraceAsString()."\n"; } $db = sqlite_factory($dbname); @@ -37,7 +41,7 @@ foreach ($data as $str) { } $r = $db->unbuffered_query("SELECT a, b from strings"); -while ($r->hasMore()) { +while ($r->valid()) { var_dump($r->current(SQLITE_NUM)); $r->next(); } diff --git a/ext/sqlite/tests/sqlite_oo_024.phpt b/ext/sqlite/tests/sqlite_oo_024.phpt index f1f89d9acc..457d8a502c 100755 --- a/ext/sqlite/tests/sqlite_oo_024.phpt +++ b/ext/sqlite/tests/sqlite_oo_024.phpt @@ -29,13 +29,13 @@ foreach ($data as $str) { echo "====class24====\n"; $res = $db->query("SELECT a FROM strings", SQLITE_ASSOC); -while ($res->hasMore()) { +while ($res->valid()) { var_dump($res->fetch_object('class24')); } echo "====stdclass====\n"; $res = $db->query("SELECT a FROM strings", SQLITE_ASSOC); -while ($res->hasMore()) { +while ($res->valid()) { var_dump($res->fetch_object()); } diff --git a/ext/sqlite/tests/sqlite_oo_026.phpt b/ext/sqlite/tests/sqlite_oo_026.phpt index f9e2503b76..ae0df40d3d 100755 --- a/ext/sqlite/tests/sqlite_oo_026.phpt +++ b/ext/sqlite/tests/sqlite_oo_026.phpt @@ -30,7 +30,7 @@ foreach($r as $idx => $row) { } echo "====FOR====\n"; $r = $db->unbuffered_query("SELECT a from strings", SQLITE_NUM); -for(;$r->hasMore(); $r->next()) { +for(;$r->valid(); $r->next()) { $v = $r->column(0); var_dump($v); $c = $r->column(0); diff --git a/ext/sqlite/tests/sqlite_oo_031.phpt b/ext/sqlite/tests/sqlite_oo_031.phpt index 84e6861654..80a2138cbf 100755 --- a/ext/sqlite/tests/sqlite_oo_031.phpt +++ b/ext/sqlite/tests/sqlite_oo_031.phpt @@ -70,7 +70,7 @@ class SqliteNestedset implements RecursiveIterator $this->fetch(); } - function hasMore() + function valid() { return is_object($this->entry); } |
