Corrections quelques bugs + modif fichier config BDD + ajout fichier build.sh pour générer la lib Minz

This commit is contained in:
Marien Fressinaud
2013-03-02 00:36:12 +01:00
parent 2232b03bb4
commit cae1efd552
32 changed files with 95 additions and 2439 deletions

View File

@@ -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 <em>' . $feed->url () . '</em> 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);
}
}