12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- define('INSTALLDIR', dirname(__DIR__, 3));
- define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public');
- $helptext = <<<END_OF_HELP
- resub-feed.php
- Resubscribe to any soon expiring feeds. Default time to expiration is 1 day.
- END_OF_HELP;
- require_once INSTALLDIR.'/scripts/commandline.inc';
- try {
- $sub = FeedSub::renewalCheck();
- } catch (NoResultException $e) {
- echo 'There were no expiring feeds.';
- exit;
- }
- while ($sub->fetch()) {
- echo "Renewing feed subscription\n\tExp.: {$sub->sub_end}\n\tFeed: {$sub->uri}\n\tHub: {$sub->huburi}\n";
- try {
- $sub->renew();
- } catch (Exception $e) {
- echo "FAILED: {$e->getMessage()}\n";
- }
- }
- echo "Done!";
|