aboutsummaryrefslogtreecommitdiff
path: root/bin/renew-subscriptions.php
blob: 16bc11ba3a18ba36aa64c2f49634405c11c62ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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']));
}
?>