Do not break when searching for slashes
[phinde.git] / bin / renew-subscriptions.php
1 #!/usr/bin/env php
2 <?php
3 namespace phinde;
4 /**
5  * Renew subscriptions
6  * Call this once a day with cron.
7  */
8 require_once __DIR__ . '/../src/init.php';
9
10 chdir(__DIR__);
11 $subDb = new Subscriptions();
12 foreach ($subDb->getExpiring() as $sub) {
13     Log::info('Expires soon: ' . $sub['sub_topic']);
14     passthru('./subscribe.php ' . escapeshellarg($sub['sub_topic']));
15 }
16 ?>