topical media & game development

talk show tell print

server-webapi-code-04-updateCacheOnUpdate.php / php



  <?php
  function cacheIsRecent()
  {
    db = sqlite_open("/tmp/11.timedcache.sqlite"); 
    query = "SELECT tstamp FROM timedCache WHERE id = 1";
    result = sqlite_query(db, query);
    row = sqlite_fetch_array(result);
    if (time() - row['tstamp'] > (60 * 10))
    {
      return false; 
    }else
    {
       return true;
    }
  }
  ?>


(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.