예제 #1
0
파일: Feed.php 프로젝트: tlandn/akvo-web
 /**
  * get feeds to update
  */
 public function cronUpdate()
 {
     $oDaoJsonData = new JsonDataDao();
     $aFeeds = $oDaoJsonData->fetchAllFeeds();
     $aTimeTranslate = array('1h' => '-1 hour', '4h' => '-4 hours', '8h' => '-8 hours', '12h' => '-12 hours', '1d' => '-1 day', '1w' => '-1 week', '1m' => '-1 month');
     ///push feeds that need updating to queue
     foreach ($aFeeds as $aFeed) {
         if (strtotime($aFeed['date_updated']) <= strtotime($aTimeTranslate[$aFeed['feed_update_interval']])) {
             $this->_updateFeedQueueData($aFeed);
             $oDaoJsonData->updateFeed(array('date_updated' => date('Y-m-d H:i:s')), $aFeed['id']);
         }
     }
     $sEmail = get_option(JD\Config::OPTION_NAME_DEBUG_EMAIL);
     if ($sEmail && $sEmail !== '') {
         mail($sEmail, 'update json data feeds', 'running');
     }
 }
예제 #2
0
파일: Feed.php 프로젝트: tlandn/akvo-web
 public function getList()
 {
     $oDaoParticipantRegistry = new JDDao\JsonData();
     $aBatch = $oDaoParticipantRegistry->fetchAllFeeds();
     return $aBatch;
 }