#!/usr/bin/env php . */ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); $longoptions = array('delete-inactive'); $shortoptions = 'd'; $helptext = <<find(); while ($feedsub->fetch()) { try { echo $feedsub->getUri() . " ({$feedsub->sub_state})"; if ($feedsub->garbageCollect()) { if ($delete_inactive) { $delcount++; $feedsub->delete(); echo " DELETED"; } echo " INACTIVE\n"; } else { echo " ACTIVE\n"; } } catch (NoProfileException $e) { echo " DELETED (no profile)\n"; $feedsub->delete(); continue; } catch (NoUriException $e) { // Probably the getUri() call echo "[unknown] DELETED (no uri)\n"; $feedsub->delete(); continue; } catch (Exception $e) { echo " ERROR: {$e->getMessage()}\n"; } } if ($delete_inactive) echo "\nDeleted $delcount inactive feeds.\n";