]> dev.renevier.net Git - syj.git/blob - application/controllers/CronController.php
version 0.1
[syj.git] / application / controllers / CronController.php
1 <?php
2 /*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3     and is published under the AGPL license. */
4
5 class CronController extends Zend_Controller_Action
6 {
7     public function init() {
8         $ip = $this->getRequest()->getClientIp(true);
9         if ($ip !== '127.0.0.1' and $ip !== '::1') {
10             throw new Syj_Exception_Forbidden();
11         }
12     }
13     public function indexAction() {
14         $mapper = new Syj_Model_PendingMapper();
15         foreach ($mapper->fetchAll() as $pending) {
16             $pending->notify();
17         }
18         $this->_helper->SyjApi->setCode(200);
19     }
20 }