From cae1efd552ed0618b13120e07c346cbe28cbd00a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 2 Mar 2013 00:36:12 +0100 Subject: Corrections quelques bugs + modif fichier config BDD + ajout fichier build.sh pour générer la lib Minz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 9a56e97cf..585405ee7 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -10,11 +10,11 @@ class feedController extends ActionController { } else { if (Request::isPost ()) { $url = Request::param ('url_rss'); - + try { $feed = new Feed ($url); $feed->load (); - + $feedDAO = new FeedDAO (); $values = array ( 'id' => $feed->id (), @@ -26,7 +26,7 @@ class feedController extends ActionController { 'lastUpdate' => time () ); $feedDAO->addFeed ($values); - + $entryDAO = new EntryDAO (); $entries = $feed->entries (); foreach ($entries as $entry) { @@ -44,13 +44,21 @@ class feedController extends ActionController { ); $entryDAO->addEntry ($values); } - + // notif $notif = array ( 'type' => 'good', 'content' => 'Le flux ' . $feed->url () . ' a bien été ajouté' ); Session::_param ('notification', $notif); + } catch (FileNotExistException $e) { + Log::record ($e->getMessage (), Log::ERROR); + // notif + $notif = array ( + 'type' => 'bad', + 'content' => 'Un problème de configuration a empêché l\'ajout du flux. Voir les logs pour plus d\'informations' + ); + Session::_param ('notification', $notif); } catch (Exception $e) { // notif $notif = array ( @@ -59,7 +67,7 @@ class feedController extends ActionController { ); Session::_param ('notification', $notif); } - + Request::forward (array (), true); } } -- cgit v1.2.3