diff options
author | Marcus Boerger <helly@php.net> | 2003-05-02 03:09:58 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-05-02 03:09:58 +0000 |
commit | ff82ad268fce08e7859ca5bd1d4ef68593c23f0f (patch) | |
tree | 234316a592ce6eadffccf2778f0e6acbca02ec48 | |
parent | 07c679064af8a6c982640eecc21bfe6d018c8310 (diff) | |
download | php-git-ff82ad268fce08e7859ca5bd1d4ef68593c23f0f.tar.gz |
Add some info
-rwxr-xr-x | ext/spl/README | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ext/spl/README b/ext/spl/README new file mode 100755 index 0000000000..e4d9aaf7a2 --- /dev/null +++ b/ext/spl/README @@ -0,0 +1,39 @@ +<pre> +This is an extension that aims to implement some efficient data access +interfaces and classes. + +SPL allows to hook into foreach. Doing so you can do something like +this: + + $obj = new whatever(); + foreach($obj as $key => $value) { ... } + +This is meant to be used for database access. For example you could +grab my patch to sqlite (<a href="http://marcus-boerger.de/php/ext/sqlite/">http://marcus-boerger.de/php/ext/sqlite/</a>) and +look at the oo tests: + + $db = new sqlite($filename); + foreach($db->query("SELECT....") as $row) { ... } + +SQLite offers four access strategies: +1) sqlite_query + sqlite_fetch_array +2) sqlite_unbuffered_query + sqlite_fetch_array +3) sqlite_query + iterators (sqlite_current) +4) sqlite_unbuffered_query + iterators (sqlite_current) + +1) and 3) do "over eager evaluating" since they fetch all rows directly. + +2) does "eager evaluating". It always fetches the next row but doesn't +keep the current row, so that it must be stored elsewhere if it must be +accessed more then once. For instance this happens when you need to access +columns separately. + +4) does "eager evaluating". But in contrast to 2) it keeps the current row +hence its name. + +There is no efficient way for "lazy or just in time evaluating" so 4) should +be the best case. And 4) also enables the foreach trick. + +To implement 3) and 4) with other db extensions ask me and wait for LT to pass. + +</pre>
\ No newline at end of file |