This may be no problem to some, but is to me.
For whatever reason, cron, sql access via perl etc.. are not available to me.
A database needs a daily update and a monthly update. To do this, I wrote something I call simcron.php and its included in pages that are viewed at least once daily, cept its called over 600 times a day.. possibly degrading overall performance when traffic is high. I do the monthlies by hand for now 🙁
Heres the code for simcron.php
<?
$daily = "./simcrondir/daily";
$lastrandaily = fileatime("$daily");
$currenttime = time();
$ago = ($currenttime - $lastrandaily);
if ($ago > 86400){$dec = $db->decrement();touch ($daily);}
?>
The file wich includes this carries out the update when $dec is set, luckily only once a day.. so far. Is this likely to noticbly degrade performance? Any way I could make it nicer? The update is already low prioroity.
Any suggestions would be greatly apreciated.