We have the code to check once a day and renew, but currently it's
just in a script directory. This change adds an event listener
hook to check and renew subscriptions daily.
}
return true;
}
+
+ public function onCronDaily()
+ {
+ try {
+ $sub = FeedSub::renewalCheck();
+ } catch (NoResultException $e) {
+ common_log(LOG_INFO, "There were no expiring feeds.");
+ return;
+ }
+
+ while ($sub->fetch()) {
+ common_log(LOG_INFO, "Renewing feed subscription\n\tExp.: {$sub->sub_end}\n\tFeed: {$sub->uri}\n\tHub: {$sub->huburi}");
+ $sub->renew();
+ }
+ }
}