· Martin's Expiry Checker v3 Blog ·

M.E.Bush > Misc. > Expiry Checker v3 Blog > 15-Aug-2006

A possible solution using fpassthru

I thought about how to change the algorithm to make use of fpassthru followed by pattern matching to check the page expiry date. So here's my third attempt at the pseudo-code for expiredpagehandler.php4:
open and lock the file ExpiryData.xml
  copy ExpiryData.xml to ExpiryDataLastWeek.xml
  clear the ExpiryData.xml file (i.e. discard all entries)
unlock and close ExpiryData.xml
open and lock the file ExpiryDataLastWeek.xml
  append the missing "</expiredpages>"
  initialise expired-pages list
  for each expired page recorded in ExpiryDataLastWeek.xml
    if the page is an LSBU WWW or MYWEB page then
      if the page is still expired (use fpassthru) then
        normalise the url
        append to expired-pages list if not already in list
      endif
    endif
  endfor
unlock and close the file ExpiryDataLastWeek.xml
for each expired page in the expired-pages list
  prepare and send email to the page owner
  if the page expired over a month ago then
    prepare and send email to <bcim@lsbu.ac.uk>
  endif
endfor