Hello I have been working with Amember v 4 and now am trying to get the am_event hourly event to trigger but it seems to not be available in v4? Perhaps I am doing something wrong this is what I have In the site.php file i have added Am_Di::getInstance()->hook->add(Am_Event::HOURLY, 'checkOld'); function checkOld(Am_Event $event){ $file = ("test.log"); $today = mktime(0, 0, 0, date("m"), date("d"), date("Y")); fileputcontents($file, $today); } When I trigger my function in other ways it works just fine so the problem is with the hook and I cant seem to figure it out. Please inform if this hook is available in v4 since the documents show it should be. Thx for any help I appreciate your time.
Most likely you would need to do the external cron setup to have it work reliably. See http://www.amember.com/docs/Cron
Ok do I need to set a cron job to the cron.php file for the hook to work? seems strange that you need to set a cron job to hourly and then the hook to hourly as well or do I not understand? Thx for your guidance I would really like to use the hook so its easier to implement and I have access to the database resources
The hook is in response to processing, something is needed to make that happen reliably. The CRON job is simply a mechanism that allows for processing stuff that needs to happen automatically.