topical media & game development
server-webapi-code-04-timedCacheRelease.php / php
<?php
db->query("BEGIN;
CREATE TABLE timedCache(id INTEGER PRIMARY KEY, cache BLOB, tstamp TEXT);
COMMIT;");
function cacheIsRecent()
{
query = "SELECT tstamp FROM timedCache WHERE id = 1";
db, row = sqlite_fetch_array(row['tstamp'] > (60 * 10))
{
return false;
}else
{
return true;
}
}
function updateCache(db = new SQLiteDatabase("/tmp/11.timedcache.sqlite");
query = "REPLACE INTO timedCache (id, cache, tstamp) VALUES (1, 'time')";
query; COMMIT;");
}
function getCache()
{
query = "SELECT cache FROM timedCache WHERE id = 1";
db, row = sqlite_fetch_array(row['cache'];
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.