Heh, I've just come across an RDBMS written in shell. Clever, that.
All the tables are text files: tab-separated, one record per line; the first row gives the field names. It would be pretty easy to write something that reads in one of those into a PHP array. Hang on:
function read_ASCII_table($tablename)
{
// Obviously I'm not going to bother with error recovery or other niceties
// I'm not advocating this code for use, either. It's probably broken anyway.
$handle = fopen($tablename.'.txt','r');
$fieldnames = fgetcsv($handle, 1024, "\t");
$table = array():
while(!feof($handle))
{
$table[] = array_combine($fieldnames, fgetcsv($handle, 1024, "\t"));
}
return $table;
}
If you don't want to use an existing commercial-grade RDBMS, you're probably going to end up writing one yourself. Easier to adapt whatever the existing code is to use a proper database.