public function feed_pull($options) { $this->cli->header('pulling all feeds'); $feeds = Kingboard_EdkFeed::find(); foreach ($feeds as $feed) { $url = $feed->url; $this->cli->message('pulling ' . $url); $sxo = simplexml_load_file($url); $processed = 0; $killcount = count($sxo->channel->item); $this->cli->message("processing {$killcount} kills."); foreach ($sxo->channel->item as $item) { $this->cli->message('processing ' . ++$processed . ' out of ' . $killcount); $mailtext = trim((string) $item->description); if (isset($item->apiID)) { $apiId = (string) $item->apiID; } else { $apiId = null; } try { $mail = Kingboard_KillmailParser_Factory::parseTextMail($mailtext); $mail->killID = $apiId; $mail->save(); } catch (Kingboard_KillmailParser_KillmailErrorException $e) { $this->cli->error("Exception caught, mail was not processed"); $this->cli->error($e->getMessage()); $this->cli->error($e->getFile() . '::' . $e->getLine()); } } $this->cli->positive('done'); } }