Automatic update on visit
Hi.
I added a couple of lines to my index.php to automatically update the feeds when I visit the page. Thought I share, as it might come in handy if you don't have the ability to call update on a cron.
"auto_update_interval" is a new INI-entry and denotes the min-time between two updates in seconds.
put this after the logger init:
// -----------------------------------
// Update
$test ="";
if (isset($_COOKIE["updated"]))
$test = $_COOKIE["updated"];
if ($test == "")
{
$loader = new \helpers\ContentLoader();
$loader->update();
setcookie("updated","true",time()+$f3->get('auto_update_interval'));
}
// -----------------------------------
Complete thread:
- Automatic update on visit -
ultimatebelkar,
2013-06-23, 10:14
- Automatic update on visit - lorddrak, 2013-06-25, 10:45