aboutsummaryrefslogtreecommitdiff
path: root/bin/renew-subscriptions.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-11-25 07:54:49 +0100
committerChristian Weiske <cweiske@cweiske.de>2016-11-25 07:56:16 +0100
commitacf02a1269b9c191a66a7ea476f11d53d4ad0c08 (patch)
tree94332bd05859677747c4ffaad857b79f0c4351e2 /bin/renew-subscriptions.php
parentdd3e0698a71ca2746166f006135aeace83dfeb20 (diff)
downloadphinde-acf02a1269b9c191a66a7ea476f11d53d4ad0c08.tar.gz
phinde-acf02a1269b9c191a66a7ea476f11d53d4ad0c08.zip
script to renew websub subscriptionsv0.2.0
Diffstat (limited to 'bin/renew-subscriptions.php')
-rwxr-xr-xbin/renew-subscriptions.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/renew-subscriptions.php b/bin/renew-subscriptions.php
new file mode 100755
index 0000000..16bc11b
--- /dev/null
+++ b/bin/renew-subscriptions.php
@@ -0,0 +1,16 @@
+#!/usr/bin/env php
+<?php
+namespace phinde;
+/**
+ * Renew subscriptions
+ * Call this once a day with cron.
+ */
+require_once __DIR__ . '/../src/init.php';
+
+chdir(__DIR__);
+$subDb = new Subscriptions();
+foreach ($subDb->getExpiring() as $sub) {
+ Log::info('Expires soon: ' . $sub['sub_topic']);
+ passthru('./subscribe.php ' . escapeshellarg($sub['sub_topic']));
+}
+?>