php-src/ext/spl
2003-05-31 15:20:11 +00:00
..
examples Add spl extension 2003-05-01 23:28:28 +00:00
tests - Fix handling of abstract methods. They must be inherited when inheriting 2003-05-26 22:06:49 +00:00
config.m4 Add spl extension 2003-05-01 23:28:28 +00:00
CREDITS Add spl extension 2003-05-01 23:28:28 +00:00
EXPERIMENTAL Add spl extension 2003-05-01 23:28:28 +00:00
php_spl.c - Fix handling of abstract methods. They must be inherited when inheriting 2003-05-26 22:06:49 +00:00
php_spl.h Make foreach on spl'ed objects work with break, too 2003-05-25 19:10:44 +00:00
README Fixes and optimizations 2003-05-24 13:47:49 +00:00
spl_array.c Optimizing by caching class entries, too. 2003-05-24 21:02:33 +00:00
spl_array.h Add spl extension 2003-05-01 23:28:28 +00:00
spl_engine.c Optimize interface checks 2003-05-29 21:08:08 +00:00
spl_engine.h Optimize interface checks 2003-05-29 21:08:08 +00:00
spl_foreach.c Optimize interface checks 2003-05-29 21:08:08 +00:00
spl_foreach.h Make foreach on spl'ed objects work with break, too 2003-05-25 19:10:44 +00:00
spl_functions.c Classes are neither interfaces nor necessarily abstract 2003-05-31 15:20:11 +00:00
spl_functions.h Add spl extension 2003-05-01 23:28:28 +00:00
spl.php Add spl extension 2003-05-01 23:28:28 +00:00
TODO Add spl extension 2003-05-01 23:28:28 +00:00

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.