4
0
Эх сурвалжийг харах

Grosse refactorisation pour permettre le chargement automatique des classes

C'est parti de changements pour
https://github.com/marienfressinaud/FreshRSS/issues/255 et finalement
j'ai continué la refactorisation...

Ajout de préfixes FreshRSS_ et Minz_ sur le modèle de SimplePie_.
Toutes les classes sont maintenant en chargement automatique (devrait
améliorer les performances en évitant de charger plein de classes
inutilisées, et faciliter la maintenance).
Suppression de set_include_path().
Si souhaité, certaines classes de Minz pourraient être déplacées dans un
sous-répertoire, par exemple les exceptions.

Tests et relecture nécessaires.
Alexandre Alapetite 12 жил өмнө
parent
commit
878e96202e
87 өөрчлөгдсөн 2217 нэмэгдсэн , 2353 устгасан
  1. 0 84
      app/App_FrontController.php
  2. 6 0
      app/Exceptions/BadUrlException.php
  3. 7 0
      app/Exceptions/EntriesGetterException.php
  4. 1 2
      app/Exceptions/FeedException.php
  5. 6 0
      app/Exceptions/OpmlException.php
  6. 58 0
      app/FreshRSS.php
  7. 252 0
      app/Models/CategoryDAO.php
  8. 3 157
      app/Models/Configuration.php
  9. 156 0
      app/Models/ConfigurationDAO.php
  10. 425 0
      app/Models/EntryDAO.php
  11. 341 0
      app/Models/FeedDAO.php
  12. 26 0
      app/Models/Log.php
  13. 20 0
      app/Models/LogDAO.php
  14. 3 3
      app/Models/Themes.php
  15. 117 117
      app/controllers/configureController.php
  16. 22 22
      app/controllers/entryController.php
  17. 4 4
      app/controllers/errorController.php
  18. 71 71
      app/controllers/feedController.php
  19. 39 39
      app/controllers/indexController.php
  20. 2 2
      app/controllers/javascriptController.php
  21. 7 7
      app/layout/aside_configure.phtml
  22. 14 14
      app/layout/aside_feed.phtml
  23. 15 15
      app/layout/aside_flux.phtml
  24. 19 19
      app/layout/header.phtml
  25. 9 9
      app/layout/layout.phtml
  26. 3 3
      app/layout/nav_entries.phtml
  27. 34 34
      app/layout/nav_menu.phtml
  28. 4 256
      app/models/Category.php
  29. 1 1
      app/models/Days.php
  30. 6 432
      app/models/Entry.php
  31. 0 19
      app/models/Exception/FeedException.php
  32. 10 352
      app/models/Feed.php
  33. 0 46
      app/models/Log_Model.php
  34. 11 11
      app/views/configure/categorize.phtml
  35. 53 53
      app/views/configure/display.phtml
  36. 27 27
      app/views/configure/feed.phtml
  37. 9 9
      app/views/configure/importExport.phtml
  38. 15 15
      app/views/configure/sharing.phtml
  39. 15 15
      app/views/configure/shortcut.phtml
  40. 8 8
      app/views/entry/bookmark.phtml
  41. 8 8
      app/views/entry/read.phtml
  42. 2 2
      app/views/error/index.phtml
  43. 10 10
      app/views/helpers/javascript_vars.phtml
  44. 8 8
      app/views/helpers/logs_pagination.phtml
  45. 9 9
      app/views/helpers/pagination.phtml
  46. 1 1
      app/views/helpers/view/global_view.phtml
  47. 26 27
      app/views/helpers/view/normal_view.phtml
  48. 2 2
      app/views/helpers/view/reader_view.phtml
  49. 3 3
      app/views/helpers/view/rss_view.phtml
  50. 12 12
      app/views/index/about.phtml
  51. 5 5
      app/views/index/index.phtml
  52. 4 4
      app/views/index/logs.phtml
  53. 2 2
      app/views/javascript/actualize.phtml
  54. 9 0
      lib/Minz/ActionException.php
  55. 9 0
      lib/Minz/BadConfigurationException.php
  56. 3 3
      lib/Minz/Cache.php
  57. 9 0
      lib/Minz/ControllerNotActionControllerException.php
  58. 9 0
      lib/Minz/ControllerNotExistException.php
  59. 8 0
      lib/Minz/CurrentPagePaginationException.php
  60. 16 0
      lib/Minz/Exception.php
  61. 8 0
      lib/Minz/FileNotExistException.php
  62. 6 6
      lib/Minz/Log.php
  63. 3 3
      lib/Minz/ModelArray.php
  64. 6 6
      lib/Minz/ModelPdo.php
  65. 5 5
      lib/Minz/ModelTxt.php
  66. 9 0
      lib/Minz/PDOConnectionException.php
  67. 8 0
      lib/Minz/PermissionDeniedException.php
  68. 16 0
      lib/Minz/RouteNotFoundException.php
  69. 0 86
      lib/SimplePie_autoloader.php
  70. 35 10
      lib/lib_rss.php
  71. 2 2
      lib/minz/ActionController.php
  72. 30 30
      lib/minz/Configuration.php
  73. 20 34
      lib/minz/Dispatcher.php
  74. 20 20
      lib/minz/Error.php
  75. 25 55
      lib/minz/FrontController.php
  76. 1 1
      lib/minz/Helper.php
  77. 1 1
      lib/minz/Model.php
  78. 1 1
      lib/minz/Paginator.php
  79. 7 9
      lib/minz/Request.php
  80. 1 1
      lib/minz/Response.php
  81. 17 17
      lib/minz/Router.php
  82. 3 3
      lib/minz/Session.php
  83. 3 3
      lib/minz/Translate.php
  84. 9 9
      lib/minz/Url.php
  85. 5 5
      lib/minz/View.php
  86. 0 94
      lib/minz/exceptions/MinzException.php
  87. 2 10
      public/index.php

+ 0 - 84
app/App_FrontController.php

@@ -1,84 +0,0 @@
-<?php
-/** 
- * MINZ - Copyright 2011 Marien Fressinaud
- * Sous licence AGPL3 <http://www.gnu.org/licenses/>
-*/
-require ('FrontController.php');
-
-class App_FrontController extends FrontController {
-	public function init () {
-		$this->loadLibs ();
-		$this->loadModels ();
-
-		Session::init ();
-		Translate::init ();
-
-		$this->loadParamsView ();
-		$this->loadStylesAndScripts ();
-		$this->loadNotifications ();
-	}
-
-	private function loadLibs () {
-		require (LIB_PATH . '/lib_rss.php');
-		require (LIB_PATH . '/SimplePie_autoloader.php');
-	}
-
-	private function loadModels () {
-		include (APP_PATH . '/models/Exception/FeedException.php');
-		include (APP_PATH . '/models/Exception/EntriesGetterException.php');
-		include (APP_PATH . '/models/RSSConfiguration.php');
-		include (APP_PATH . '/models/RSSThemes.php');
-		include (APP_PATH . '/models/Days.php');
-		include (APP_PATH . '/models/Category.php');
-		include (APP_PATH . '/models/Feed.php');
-		include (APP_PATH . '/models/Entry.php');
-		include (APP_PATH . '/models/Log_Model.php');
-	}
-
-	private function loadParamsView () {
-		try {
-			$this->conf = Session::param ('conf', new RSSConfiguration ());
-		} catch(MinzException $e) {
-			// Permission denied or conf file does not exist
-			// it's critical!
-			print $e->getMessage();
-			exit();
-		}
-
-		View::_param ('conf', $this->conf);
-		Session::_param ('language', $this->conf->language ());
-
-		$output = Request::param ('output');
-		if(!$output) {
-			$output = $this->conf->viewMode();
-			Request::_param ('output', $output);
-		}
-	}
-
-	private function loadStylesAndScripts () {
-		$theme = RSSThemes::get_infos($this->conf->theme());
-		if ($theme) {
-			foreach($theme["files"] as $file) {
-				View::appendStyle (Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file)));
-			}
-		}
-
-		if (login_is_conf ($this->conf)) {
-			View::appendScript ('https://login.persona.org/include.js');
-		}
-		$includeLazyLoad = $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader');
-		View::appendScript (Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')), false, !$includeLazyLoad, !$includeLazyLoad);
-		if ($includeLazyLoad) {
-			View::appendScript (Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js')));
-		}
-		View::appendScript (Url::display ('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js')));
-	}
-
-	private function loadNotifications () {
-		$notif = Session::param ('notification');
-		if ($notif) {
-			View::_param ('notification', $notif);
-			Session::_param ('notification');
-		}
-	}
-}

+ 6 - 0
app/Exceptions/BadUrlException.php

@@ -0,0 +1,6 @@
+<?php
+class FreshRSS_BadUrl_Exception extends FreshRSS_Feed_Exception {
+	public function __construct ($url) {
+		parent::__construct ('`' . $url . '` is not a valid URL');
+	}
+}

+ 7 - 0
app/Exceptions/EntriesGetterException.php

@@ -0,0 +1,7 @@
+<?php
+
+class FreshRSS_EntriesGetter_Exception extends Exception {
+	public function __construct ($message) {
+		parent::__construct ($message);
+	}
+}

+ 1 - 2
app/models/Exception/EntriesGetterException.php → app/Exceptions/FeedException.php

@@ -1,6 +1,5 @@
 <?php
-
-class EntriesGetterException extends Exception {
+class FreshRSS_Feed_Exception extends Exception {
 	public function __construct ($message) {
 		parent::__construct ($message);
 	}

+ 6 - 0
app/Exceptions/OpmlException.php

@@ -0,0 +1,6 @@
+<?php
+class FreshRSS_Opml_Exception extends FreshRSS_Feed_Exception {
+	public function __construct ($name_file) {
+		parent::__construct ('OPML file is invalid');
+	}
+}

+ 58 - 0
app/FreshRSS.php

@@ -0,0 +1,58 @@
+<?php
+class FreshRSS extends Minz_FrontController {
+	public function init () {
+		Minz_Session::init ();
+		Minz_Translate::init ();
+
+		$this->loadParamsView ();
+		$this->loadStylesAndScripts ();
+		$this->loadNotifications ();
+	}
+
+	private function loadParamsView () {
+		try {
+			$this->conf = Minz_Session::param ('conf', new FreshRSS_Configuration ());
+		} catch (Minz_Exception $e) {
+			// Permission denied or conf file does not exist
+			// it's critical!
+			print $e->getMessage();
+			exit();
+		}
+
+		Minz_View::_param ('conf', $this->conf);
+		Minz_Session::_param ('language', $this->conf->language ());
+
+		$output = Minz_Request::param ('output');
+		if(!$output) {
+			$output = $this->conf->viewMode();
+			Minz_Request::_param ('output', $output);
+		}
+	}
+
+	private function loadStylesAndScripts () {
+		$theme = FreshRSS_Themes::get_infos($this->conf->theme());
+		if ($theme) {
+			foreach($theme["files"] as $file) {
+				Minz_View::appendStyle (Minz_Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file)));
+			}
+		}
+
+		if (login_is_conf ($this->conf)) {
+			Minz_View::appendScript ('https://login.persona.org/include.js');
+		}
+		$includeLazyLoad = $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader');
+		Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')), false, !$includeLazyLoad, !$includeLazyLoad);
+		if ($includeLazyLoad) {
+			Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js')));
+		}
+		Minz_View::appendScript (Minz_Url::display ('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js')));
+	}
+
+	private function loadNotifications () {
+		$notif = Minz_Session::param ('notification');
+		if ($notif) {
+			Minz_View::_param ('notification', $notif);
+			Minz_Session::_param ('notification');
+		}
+	}
+}

+ 252 - 0
app/Models/CategoryDAO.php

@@ -0,0 +1,252 @@
+<?php
+class FreshRSS_CategoryDAO extends Minz_ModelPdo {
+	public function addCategory ($valuesTmp) {
+		$sql = 'INSERT INTO `' . $this->prefix . 'category` (name, color) VALUES(?, ?)';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			substr($valuesTmp['name'], 0, 255),
+			substr($valuesTmp['color'], 0, 7),
+		);
+
+		if ($stm && $stm->execute ($values)) {
+			return $this->bd->lastInsertId();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function updateCategory ($id, $valuesTmp) {
+		$sql = 'UPDATE `' . $this->prefix . 'category` SET name=?, color=? WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			$valuesTmp['name'],
+			$valuesTmp['color'],
+			$id
+		);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function deleteCategory ($id) {
+		$sql = 'DELETE FROM `' . $this->prefix . 'category` WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($id);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function searchById ($id) {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($id);
+
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$cat = HelperCategory::daoToCategory ($res);
+
+		if (isset ($cat[0])) {
+			return $cat[0];
+		} else {
+			return false;
+		}
+	}
+	public function searchByName ($name) {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE name=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($name);
+
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$cat = HelperCategory::daoToCategory ($res);
+
+		if (isset ($cat[0])) {
+			return $cat[0];
+		} else {
+			return false;
+		}
+	}
+
+	public function listCategories ($prePopulateFeeds = true, $details = false) {
+		if ($prePopulateFeeds) {
+			$sql = 'SELECT c.id AS c_id, c.name AS c_name, '
+			     . ($details ? 'c.color AS c_color, ' : '')
+			     . ($details ? 'f.* ' : 'f.id, f.name, f.website, f.priority, f.error, f.cache_nbEntries, f.cache_nbUnreads ')
+			     . 'FROM `' . $this->prefix . 'category` c '
+			     . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category = c.id '
+			     . 'GROUP BY f.id '
+			     . 'ORDER BY c.name, f.name';
+			$stm = $this->bd->prepare ($sql);
+			$stm->execute ();
+			return HelperCategory::daoToCategoryPrepopulated ($stm->fetchAll (PDO::FETCH_ASSOC));
+		} else {
+			$sql = 'SELECT * FROM `' . $this->prefix . 'category` ORDER BY name';
+			$stm = $this->bd->prepare ($sql);
+			$stm->execute ();
+			return HelperCategory::daoToCategory ($stm->fetchAll (PDO::FETCH_ASSOC));
+		}
+	}
+
+	public function getDefault () {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=1';
+		$stm = $this->bd->prepare ($sql);
+
+		$stm->execute ();
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$cat = HelperCategory::daoToCategory ($res);
+
+		if (isset ($cat[0])) {
+			return $cat[0];
+		} else {
+			return false;
+		}
+	}
+	public function checkDefault () {
+		$def_cat = $this->searchById (1);
+
+		if ($def_cat === false) {
+			$cat = new FreshRSS_Category (Minz_Translate::t ('default_category'));
+			$cat->_id (1);
+
+			$values = array (
+				'id' => $cat->id (),
+				'name' => $cat->name (),
+				'color' => $cat->color ()
+			);
+
+			$this->addCategory ($values);
+		}
+	}
+
+	public function count () {
+		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'category`';
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+		return $res[0]['count'];
+	}
+
+	public function countFeed ($id) {
+		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'feed` WHERE category=?';
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+		return $res[0]['count'];
+	}
+
+	public function countNotRead ($id) {
+		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE category=? AND e.is_read=0';
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+		return $res[0]['count'];
+	}
+}
+
+class HelperCategory {
+	public static function findFeed($categories, $feed_id) {
+		foreach ($categories as $category) {
+			foreach ($category->feeds () as $feed) {
+				if ($feed->id () === $feed_id) {
+					return $feed;
+				}
+			}
+		}
+		return null;
+	}
+
+	public static function CountUnreads($categories, $minPriority = 0) {
+		$n = 0;
+		foreach ($categories as $category) {
+			foreach ($category->feeds () as $feed) {
+				if ($feed->priority () >= $minPriority) {
+					$n += $feed->nbNotRead();
+				}
+			}
+		}
+		return $n;
+	}
+
+	public static function daoToCategoryPrepopulated ($listDAO) {
+		$list = array ();
+
+		if (!is_array ($listDAO)) {
+			$listDAO = array ($listDAO);
+		}
+
+		$previousLine = null;
+		$feedsDao = array();
+		foreach ($listDAO as $line) {
+			if ($previousLine['c_id'] != null && $line['c_id'] !== $previousLine['c_id']) {
+				// End of the current category, we add it to the $list
+				$cat = new FreshRSS_Category (
+					$previousLine['c_name'],
+					isset($previousLine['c_color']) ? $previousLine['c_color'] : '',
+					HelperFeed::daoToFeed ($feedsDao, $previousLine['c_id'])
+				);
+				$cat->_id ($previousLine['c_id']);
+				$list[$previousLine['c_id']] = $cat;
+
+				$feedsDao = array();	//Prepare for next category
+			}
+
+			$previousLine = $line;
+			$feedsDao[] = $line;
+		}
+
+		// add the last category
+		if ($previousLine != null) {
+			$cat = new FreshRSS_Category (
+				$previousLine['c_name'],
+				isset($previousLine['c_color']) ? $previousLine['c_color'] : '',
+				HelperFeed::daoToFeed ($feedsDao, $previousLine['c_id'])
+			);
+			$cat->_id ($previousLine['c_id']);
+			$list[$previousLine['c_id']] = $cat;
+		}
+
+		return $list;
+	}
+
+	public static function daoToCategory ($listDAO) {
+		$list = array ();
+
+		if (!is_array ($listDAO)) {
+			$listDAO = array ($listDAO);
+		}
+
+		foreach ($listDAO as $key => $dao) {
+			$cat = new FreshRSS_Category (
+				$dao['name'],
+				$dao['color']
+			);
+			$cat->_id ($dao['id']);
+			$list[$key] = $cat;
+		}
+
+		return $list;
+	}
+}

+ 3 - 157
app/models/RSSConfiguration.php → app/Models/Configuration.php

@@ -1,6 +1,5 @@
 <?php
-
-class RSSConfiguration extends Model {
+class FreshRSS_Configuration extends Minz_Model {
 	private $available_languages = array (
 		'en' => 'English',
 		'fr' => 'Français',
@@ -34,7 +33,7 @@ class RSSConfiguration extends Model {
 	private $bottomline_link;
 
 	public function __construct () {
-		$confDAO = new RSSConfigurationDAO ();
+		$confDAO = new FreshRSS_ConfigurationDAO ();
 		$this->_language ($confDAO->language);
 		$this->_postsPerPage ($confDAO->posts_per_page);
 		$this->_viewMode ($confDAO->view_mode);
@@ -49,7 +48,7 @@ class RSSConfiguration extends Model {
 		$this->_markWhen ($confDAO->mark_when);
 		$this->_sharing ($confDAO->sharing);
 		$this->_theme ($confDAO->theme);
-		RSSThemes::setThemeId ($confDAO->theme);
+		FreshRSS_Themes::setThemeId ($confDAO->theme);
 		$this->_anonAccess ($confDAO->anon_access);
 		$this->_token ($confDAO->token);
 		$this->_autoLoadMore ($confDAO->auto_load_more);
@@ -325,156 +324,3 @@ class RSSConfiguration extends Model {
 		$this->bottomline_link = $value === 'yes';
 	}
 }
-
-class RSSConfigurationDAO extends Model_array {
-	public $language = 'en';
-	public $posts_per_page = 20;
-	public $view_mode = 'normal';
-	public $default_view = 'not_read';
-	public $display_posts = 'no';
-	public $onread_jump_next = 'yes';
-	public $lazyload = 'yes';
-	public $sort_order = 'DESC';
-	public $old_entries = 3;
-	public $shortcuts = array (
-		'mark_read' => 'r',
-		'mark_favorite' => 'f',
-		'go_website' => 'space',
-		'next_entry' => 'j',
-		'prev_entry' => 'k',
-		'collapse_entry' => 'c',
-		'load_more' => 'm'
-	);
-	public $mail_login = '';
-	public $mark_when = array (
-		'article' => 'yes',
-		'site' => 'yes',
-		'scroll' => 'no',
-		'reception' => 'no'
-	);
-	public $sharing = array (
-		'shaarli' => '',
-		'poche' => '',
-		'diaspora' => '',
-		'twitter' => true,
-		'g+' => true,
-		'facebook' => true,
-		'email' => true,
-		'print' => true
-	);
-	public $theme = 'default';
-	public $anon_access = 'no';
-	public $token = '';
-	public $auto_load_more = 'no';
-	public $topline_read = 'yes';
-	public $topline_favorite = 'yes';
-	public $topline_date = 'yes';
-	public $topline_link = 'yes';
-	public $bottomline_read = 'yes';
-	public $bottomline_favorite = 'yes';
-	public $bottomline_sharing = 'yes';
-	public $bottomline_tags = 'yes';
-	public $bottomline_date = 'yes';
-	public $bottomline_link = 'yes';
-
-	public function __construct () {
-		parent::__construct (DATA_PATH . '/' . Configuration::currentUser () . '_user.php');
-
-		// TODO : simplifier ce code, une boucle for() devrait suffir !
-		if (isset ($this->array['language'])) {
-			$this->language = $this->array['language'];
-		}
-		if (isset ($this->array['posts_per_page'])) {
-			$this->posts_per_page = $this->array['posts_per_page'];
-		}
-		if (isset ($this->array['view_mode'])) {
-			$this->view_mode = $this->array['view_mode'];
-		}
-		if (isset ($this->array['default_view'])) {
-			$this->default_view = $this->array['default_view'];
-		}
-		if (isset ($this->array['display_posts'])) {
-			$this->display_posts = $this->array['display_posts'];
-		}
-		if (isset ($this->array['onread_jump_next'])) {
-			$this->onread_jump_next = $this->array['onread_jump_next'];
-		}
-		if (isset ($this->array['lazyload'])) {
-			$this->lazyload = $this->array['lazyload'];
-		}
-		if (isset ($this->array['sort_order'])) {
-			$this->sort_order = $this->array['sort_order'];
-		}
-		if (isset ($this->array['old_entries'])) {
-			$this->old_entries = $this->array['old_entries'];
-		}
-		if (isset ($this->array['shortcuts'])) {
-			$this->shortcuts = array_merge (
-				$this->shortcuts, $this->array['shortcuts']
-			);
-		}
-		if (isset ($this->array['mail_login'])) {
-			$this->mail_login = $this->array['mail_login'];
-		}
-		if (isset ($this->array['mark_when'])) {
-			$this->mark_when = $this->array['mark_when'];
-		}
-		if (isset ($this->array['sharing'])) {
-			$this->sharing = array_merge (
-				$this->sharing, $this->array['sharing']
-			);
-		}
-		if (isset ($this->array['theme'])) {
-			$this->theme = $this->array['theme'];
-		}
-		if (isset ($this->array['anon_access'])) {
-			$this->anon_access = $this->array['anon_access'];
-		}
-		if (isset ($this->array['token'])) {
-			$this->token = $this->array['token'];
-		}
-		if (isset ($this->array['auto_load_more'])) {
-			$this->auto_load_more = $this->array['auto_load_more'];
-		}
-
-		if (isset ($this->array['topline_read'])) {
-			$this->topline_read = $this->array['topline_read'];
-		}
-		if (isset ($this->array['topline_favorite'])) {
-			$this->topline_favorite = $this->array['topline_favorite'];
-		}
-		if (isset ($this->array['topline_date'])) {
-			$this->topline_date = $this->array['topline_date'];
-		}
-		if (isset ($this->array['topline_link'])) {
-			$this->topline_link = $this->array['topline_link'];
-		}
-		if (isset ($this->array['bottomline_read'])) {
-			$this->bottomline_read = $this->array['bottomline_read'];
-		}
-		if (isset ($this->array['bottomline_favorite'])) {
-			$this->bottomline_favorite = $this->array['bottomline_favorite'];
-		}
-		if (isset ($this->array['bottomline_sharing'])) {
-			$this->bottomline_sharing = $this->array['bottomline_sharing'];
-		}
-		if (isset ($this->array['bottomline_tags'])) {
-			$this->bottomline_tags = $this->array['bottomline_tags'];
-		}
-		if (isset ($this->array['bottomline_date'])) {
-			$this->bottomline_date = $this->array['bottomline_date'];
-		}
-		if (isset ($this->array['bottomline_link'])) {
-			$this->bottomline_link = $this->array['bottomline_link'];
-		}
-	}
-
-	public function update ($values) {
-		foreach ($values as $key => $value) {
-			$this->array[$key] = $value;
-		}
-
-		$this->writeFile($this->array);
-		invalidateHttpCache();
-	}
-}

+ 156 - 0
app/Models/ConfigurationDAO.php

@@ -0,0 +1,156 @@
+<?php
+class FreshRSS_ConfigurationDAO extends Minz_ModelArray {
+	public $language = 'en';
+	public $posts_per_page = 20;
+	public $view_mode = 'normal';
+	public $default_view = 'not_read';
+	public $display_posts = 'no';
+	public $onread_jump_next = 'yes';
+	public $lazyload = 'yes';
+	public $sort_order = 'DESC';
+	public $old_entries = 3;
+	public $shortcuts = array (
+		'mark_read' => 'r',
+		'mark_favorite' => 'f',
+		'go_website' => 'space',
+		'next_entry' => 'j',
+		'prev_entry' => 'k',
+		'collapse_entry' => 'c',
+		'load_more' => 'm'
+	);
+	public $mail_login = '';
+	public $mark_when = array (
+		'article' => 'yes',
+		'site' => 'yes',
+		'scroll' => 'no',
+		'reception' => 'no'
+	);
+	public $sharing = array (
+		'shaarli' => '',
+		'poche' => '',
+		'diaspora' => '',
+		'twitter' => true,
+		'g+' => true,
+		'facebook' => true,
+		'email' => true,
+		'print' => true
+	);
+	public $theme = 'default';
+	public $anon_access = 'no';
+	public $token = '';
+	public $auto_load_more = 'no';
+	public $topline_read = 'yes';
+	public $topline_favorite = 'yes';
+	public $topline_date = 'yes';
+	public $topline_link = 'yes';
+	public $bottomline_read = 'yes';
+	public $bottomline_favorite = 'yes';
+	public $bottomline_sharing = 'yes';
+	public $bottomline_tags = 'yes';
+	public $bottomline_date = 'yes';
+	public $bottomline_link = 'yes';
+
+	public function __construct ($nameFile = '') {
+		if (empty($nameFile)) {
+			$nameFile = DATA_PATH . '/' . Minz_Configuration::currentUser () . '_user.php';
+		}
+		parent::__construct ($nameFile);
+
+		// TODO : simplifier ce code, une boucle for() devrait suffire !
+		if (isset ($this->array['language'])) {
+			$this->language = $this->array['language'];
+		}
+		if (isset ($this->array['posts_per_page'])) {
+			$this->posts_per_page = $this->array['posts_per_page'];
+		}
+		if (isset ($this->array['view_mode'])) {
+			$this->view_mode = $this->array['view_mode'];
+		}
+		if (isset ($this->array['default_view'])) {
+			$this->default_view = $this->array['default_view'];
+		}
+		if (isset ($this->array['display_posts'])) {
+			$this->display_posts = $this->array['display_posts'];
+		}
+		if (isset ($this->array['onread_jump_next'])) {
+			$this->onread_jump_next = $this->array['onread_jump_next'];
+		}
+		if (isset ($this->array['lazyload'])) {
+			$this->lazyload = $this->array['lazyload'];
+		}
+		if (isset ($this->array['sort_order'])) {
+			$this->sort_order = $this->array['sort_order'];
+		}
+		if (isset ($this->array['old_entries'])) {
+			$this->old_entries = $this->array['old_entries'];
+		}
+		if (isset ($this->array['shortcuts'])) {
+			$this->shortcuts = array_merge (
+				$this->shortcuts, $this->array['shortcuts']
+			);
+		}
+		if (isset ($this->array['mail_login'])) {
+			$this->mail_login = $this->array['mail_login'];
+		}
+		if (isset ($this->array['mark_when'])) {
+			$this->mark_when = $this->array['mark_when'];
+		}
+		if (isset ($this->array['sharing'])) {
+			$this->sharing = array_merge (
+				$this->sharing, $this->array['sharing']
+			);
+		}
+		if (isset ($this->array['theme'])) {
+			$this->theme = $this->array['theme'];
+		}
+		if (isset ($this->array['anon_access'])) {
+			$this->anon_access = $this->array['anon_access'];
+		}
+		if (isset ($this->array['token'])) {
+			$this->token = $this->array['token'];
+		}
+		if (isset ($this->array['auto_load_more'])) {
+			$this->auto_load_more = $this->array['auto_load_more'];
+		}
+
+		if (isset ($this->array['topline_read'])) {
+			$this->topline_read = $this->array['topline_read'];
+		}
+		if (isset ($this->array['topline_favorite'])) {
+			$this->topline_favorite = $this->array['topline_favorite'];
+		}
+		if (isset ($this->array['topline_date'])) {
+			$this->topline_date = $this->array['topline_date'];
+		}
+		if (isset ($this->array['topline_link'])) {
+			$this->topline_link = $this->array['topline_link'];
+		}
+		if (isset ($this->array['bottomline_read'])) {
+			$this->bottomline_read = $this->array['bottomline_read'];
+		}
+		if (isset ($this->array['bottomline_favorite'])) {
+			$this->bottomline_favorite = $this->array['bottomline_favorite'];
+		}
+		if (isset ($this->array['bottomline_sharing'])) {
+			$this->bottomline_sharing = $this->array['bottomline_sharing'];
+		}
+		if (isset ($this->array['bottomline_tags'])) {
+			$this->bottomline_tags = $this->array['bottomline_tags'];
+		}
+		if (isset ($this->array['bottomline_date'])) {
+			$this->bottomline_date = $this->array['bottomline_date'];
+		}
+		if (isset ($this->array['bottomline_link'])) {
+			$this->bottomline_link = $this->array['bottomline_link'];
+		}
+	}
+
+	public function update ($values) {
+		foreach ($values as $key => $value) {
+			$this->array[$key] = $value;
+		}
+
+		$this->writeFile($this->array);
+		invalidateHttpCache();
+	}
+}

+ 425 - 0
app/Models/EntryDAO.php

@@ -0,0 +1,425 @@
+<?php
+class FreshRSS_EntryDAO extends Minz_ModelPdo {
+	public function addEntry ($valuesTmp) {
+		$sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, content_bin, link, date, is_read, is_favorite, id_feed, tags) '
+		     . 'VALUES(?, ?, ?, ?, COMPRESS(?), ?, ?, ?, ?, ?, ?)';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			$valuesTmp['id'],
+			substr($valuesTmp['guid'], 0, 760),
+			substr($valuesTmp['title'], 0, 255),
+			substr($valuesTmp['author'], 0, 255),
+			$valuesTmp['content'],
+			substr($valuesTmp['link'], 0, 1023),
+			$valuesTmp['date'],
+			$valuesTmp['is_read'],
+			$valuesTmp['is_favorite'],
+			$valuesTmp['id_feed'],
+			substr($valuesTmp['tags'], 0, 1023),
+		);
+
+		if ($stm && $stm->execute ($values)) {
+			return $this->bd->lastInsertId();
+		} else {
+			$info = $stm->errorInfo();
+			if ((int)($info[0] / 1000) !== 23) {	//Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries
+				Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
+				. ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::ERROR);
+			} /*else {
+				Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
+				. ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::DEBUG);
+			}*/
+			return false;
+		}
+	}
+
+	public function markFavorite ($id, $is_favorite = true) {
+		$sql = 'UPDATE `' . $this->prefix . 'entry` e '
+		     . 'SET e.is_favorite = ? '
+		     . 'WHERE e.id=?';
+		$values = array ($is_favorite ? 1 : 0, $id);
+		$stm = $this->bd->prepare ($sql);
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+	public function markRead ($id, $is_read = true) {
+		$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+		     . 'SET e.is_read = ?,'
+		     . 'f.cache_nbUnreads=f.cache_nbUnreads' . ($is_read ? '-' : '+') . '1 '
+		     . 'WHERE e.id=?';
+		$values = array ($is_read ? 1 : 0, $id);
+		$stm = $this->bd->prepare ($sql);
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+	public function markReadEntries ($idMax = 0, $favorites = false) {
+		if ($idMax === 0) {
+			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+			     . 'SET e.is_read = 1, f.cache_nbUnreads=0 '
+			     . 'WHERE e.is_read = 0 AND ';
+			if ($favorites) {
+				$sql .= 'e.is_favorite = 1';
+			} else {
+				$sql .= 'f.priority > 0';
+			}
+			$stm = $this->bd->prepare ($sql);
+			if ($stm && $stm->execute ()) {
+				return $stm->rowCount();
+			} else {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				return false;
+			}
+		} else {
+			$this->bd->beginTransaction ();
+
+			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+			     . 'SET e.is_read = 1 '
+			     . 'WHERE e.is_read = 0 AND e.id <= ? AND ';
+			if ($favorites) {
+				$sql .= 'e.is_favorite = 1';
+			} else {
+				$sql .= 'f.priority > 0';
+			}
+			$values = array ($idMax);
+			$stm = $this->bd->prepare ($sql);
+			if (!($stm && $stm->execute ($values))) {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				$this->bd->rollBack ();
+				return false;
+			}
+			$affected = $stm->rowCount();
+
+			if ($affected > 0) {
+				$sql = 'UPDATE `' . $this->prefix . 'feed` f '
+			     . 'LEFT OUTER JOIN ('
+			     .	'SELECT e.id_feed, '
+			     .	'COUNT(*) AS nbUnreads '
+			     .	'FROM `' . $this->prefix . 'entry` e '
+			     .	'WHERE e.is_read = 0 '
+			     .	'GROUP BY e.id_feed'
+			     . ') x ON x.id_feed=f.id '
+			     . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0)';
+				$stm = $this->bd->prepare ($sql);
+				if (!($stm && $stm->execute ())) {
+					$info = $stm->errorInfo();
+					Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+					$this->bd->rollBack ();
+					return false;
+				}
+			}
+
+			$this->bd->commit ();
+			return $affected;
+		}
+	}
+	public function markReadCat ($id, $idMax = 0) {
+		if ($idMax === 0) {
+			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+			     . 'SET e.is_read = 1, f.cache_nbUnreads=0 '
+			     . 'WHERE f.category = ? AND e.is_read = 0';
+			$values = array ($id);
+			$stm = $this->bd->prepare ($sql);
+			if ($stm && $stm->execute ($values)) {
+				return $stm->rowCount();
+			} else {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				return false;
+			}
+		} else {
+			$this->bd->beginTransaction ();
+
+			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+			     . 'SET e.is_read = 1 '
+			     . 'WHERE f.category = ? AND e.is_read = 0 AND e.id <= ?';
+			$values = array ($id, $idMax);
+			$stm = $this->bd->prepare ($sql);
+			if (!($stm && $stm->execute ($values))) {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				$this->bd->rollBack ();
+				return false;
+			}
+			$affected = $stm->rowCount();
+
+			if ($affected > 0) {
+				$sql = 'UPDATE `' . $this->prefix . 'feed` f '
+			     . 'LEFT OUTER JOIN ('
+			     .	'SELECT e.id_feed, '
+			     .	'COUNT(*) AS nbUnreads '
+			     .	'FROM `' . $this->prefix . 'entry` e '
+			     .	'WHERE e.is_read = 0 '
+			     .	'GROUP BY e.id_feed'
+			     . ') x ON x.id_feed=f.id '
+			     . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0) '
+			     . 'WHERE f.category = ?';
+				$values = array ($id);
+				$stm = $this->bd->prepare ($sql);
+				if (!($stm && $stm->execute ($values))) {
+					$info = $stm->errorInfo();
+					Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+					$this->bd->rollBack ();
+					return false;
+				}
+			}
+
+			$this->bd->commit ();
+			return $affected;
+		}
+	}
+	public function markReadFeed ($id, $idMax = 0) {
+		if ($idMax === 0) {
+			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+			     . 'SET e.is_read = 1, f.cache_nbUnreads=0 '
+			     . 'WHERE f.id=? AND e.is_read = 0';
+			$values = array ($id);
+			$stm = $this->bd->prepare ($sql);
+			if ($stm && $stm->execute ($values)) {
+				return $stm->rowCount();
+			} else {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				return false;
+			}
+		} else {
+			$this->bd->beginTransaction ();
+
+			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+			     . 'SET e.is_read = 1 '
+			     . 'WHERE f.id=? AND e.is_read = 0 AND e.id <= ?';
+			$values = array ($id, $idMax);
+			$stm = $this->bd->prepare ($sql);
+			if (!($stm && $stm->execute ($values))) {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				$this->bd->rollBack ();
+				return false;
+			}
+			$affected = $stm->rowCount();
+
+			if ($affected > 0) {
+				$sql = 'UPDATE `' . $this->prefix . 'feed` f '
+				     . 'SET f.cache_nbUnreads=f.cache_nbUnreads-' . $affected
+				     . ' WHERE f.id=?';
+				$values = array ($id);
+				$stm = $this->bd->prepare ($sql);
+				if (!($stm && $stm->execute ($values))) {
+					$info = $stm->errorInfo();
+					Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+					$this->bd->rollBack ();
+					return false;
+				}
+			}
+
+			$this->bd->commit ();
+			return $affected;
+		}
+	}
+
+	public function searchByGuid ($feed_id, $id) {
+		// un guid est unique pour un flux donné
+		$sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags '
+		     . 'FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND guid=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			$feed_id,
+			$id
+		);
+
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$entries = HelperEntry::daoToEntry ($res);
+		return isset ($entries[0]) ? $entries[0] : false;
+	}
+
+	public function searchById ($id) {
+		$sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags '
+		     . 'FROM `' . $this->prefix . 'entry` WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($id);
+
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$entries = HelperEntry::daoToEntry ($res);
+		return isset ($entries[0]) ? $entries[0] : false;
+	}
+
+	public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = -1, $filter = '') {
+		$where = '';
+		$values = array();
+		switch ($type) {
+			case 'a':
+				$where .= 'priority > 0 ';
+				break;
+			case 's':
+				$where .= 'is_favorite = 1 ';
+				break;
+			case 'c':
+				$where .= 'category = ? ';
+				$values[] = intval($id);
+				break;
+			case 'f':
+				$where .= 'id_feed = ? ';
+				$values[] = intval($id);
+				break;
+			default:
+				throw new FreshRSS_EntriesGetter_Exception ('Bad type in Entry->listByType: [' . $type . ']!');
+		}
+		switch ($state) {
+			case 'all':
+				break;
+			case 'not_read':
+				$where .= 'AND is_read = 0 ';
+				break;
+			case 'read':
+				$where .= 'AND is_read = 1 ';
+				break;
+			default:
+				throw new FreshRSS_EntriesGetter_Exception ('Bad state in Entry->listByType: [' . $state . ']!');
+		}
+		switch ($order) {
+			case 'DESC':
+			case 'ASC':
+				break;
+			default:
+				throw new FreshRSS_EntriesGetter_Exception ('Bad order in Entry->listByType: [' . $order . ']!');
+		}
+		if ($firstId > 0) {
+			$where .= 'AND e.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' ';
+		}
+		$terms = array_unique(explode(' ', trim($filter)));
+		sort($terms);	//Put #tags first
+		$having = '';
+		foreach ($terms as $word) {
+			if (!empty($word)) {
+				if ($word[0] === '#' && isset($word[1])) {
+					$having .= 'AND tags LIKE ? ';
+					$values[] = '%' . $word .'%';
+				} elseif (!empty($word)) {
+					$having .= 'AND (e.title LIKE ? OR content LIKE ?) ';
+					$values[] = '%' . $word .'%';
+					$values[] = '%' . $word .'%';
+				}
+			}
+		}
+
+		$sql = 'SELECT e.id, e.guid, e.title, e.author, UNCOMPRESS(e.content_bin) AS content, e.link, e.date, e.is_read, e.is_favorite, e.id_feed, e.tags '
+		     . 'FROM `' . $this->prefix . 'entry` e '
+		     . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE ' . $where
+		     . (empty($having) ? '' : 'HAVING' . substr($having, 3))
+		     . 'ORDER BY e.id ' . $order;
+
+		if ($limit > 0) {
+			$sql .= ' LIMIT ' . $limit;	//TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/
+		}
+
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ($values);
+
+		return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
+	}
+
+	public function listLastGuidsByFeed($id, $n) {
+		$sql = 'SELECT guid FROM `' . $this->prefix . 'entry` WHERE id_feed=? ORDER BY id DESC LIMIT ' . intval($n);
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		$stm->execute ($values);
+		return $stm->fetchAll (PDO::FETCH_COLUMN, 0);
+	}
+
+	public function countUnreadRead () {
+		$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0'
+		     . ' UNION SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0 AND is_read = 0';
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
+		$all = empty($res[0]) ? 0 : $res[0];
+		$unread = empty($res[1]) ? 0 : $res[1];
+		return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread);
+	}
+	public function count ($minPriority = null) {
+		$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id';
+		if ($minPriority !== null) {
+			$sql = ' WHERE priority > ' . intval($minPriority);
+		}
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
+		return $res[0];
+	}
+	public function countNotRead ($minPriority = null) {
+		$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE is_read = 0';
+		if ($minPriority !== null) {
+			$sql = ' AND priority > ' . intval($minPriority);
+		}
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
+		return $res[0];
+	}
+
+	public function countUnreadReadFavorites () {
+		$sql = 'SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1'
+		     . ' UNION SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 AND is_read = 0';
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
+		$all = empty($res[0]) ? 0 : $res[0];
+		$unread = empty($res[1]) ? 0 : $res[1];
+		return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread);
+	}
+
+	public function optimizeTable() {
+		$sql = 'OPTIMIZE TABLE `' . $this->prefix . 'entry`';
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+	}
+}
+
+class HelperEntry {
+	public static function daoToEntry ($listDAO) {
+		$list = array ();
+
+		if (!is_array ($listDAO)) {
+			$listDAO = array ($listDAO);
+		}
+
+		foreach ($listDAO as $key => $dao) {
+			$entry = new FreshRSS_Entry (
+				$dao['id_feed'],
+				$dao['guid'],
+				$dao['title'],
+				$dao['author'],
+				$dao['content'],
+				$dao['link'],
+				$dao['date'],
+				$dao['is_read'],
+				$dao['is_favorite'],
+				$dao['tags']
+			);
+			if (isset ($dao['id'])) {
+				$entry->_id ($dao['id']);
+			}
+			$list[] = $entry;
+		}
+
+		unset ($listDAO);
+
+		return $list;
+	}
+}

+ 341 - 0
app/Models/FeedDAO.php

@@ -0,0 +1,341 @@
+<?php
+class FreshRSS_FeedDAO extends Minz_ModelPdo {
+	public function addFeed ($valuesTmp) {
+		$sql = 'INSERT INTO `' . $this->prefix . 'feed` (url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, 0)';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			substr($valuesTmp['url'], 0, 511),
+			$valuesTmp['category'],
+			substr($valuesTmp['name'], 0, 255),
+			substr($valuesTmp['website'], 0, 255),
+			substr($valuesTmp['description'], 0, 1023),
+			$valuesTmp['lastUpdate'],
+			base64_encode ($valuesTmp['httpAuth']),
+		);
+
+		if ($stm && $stm->execute ($values)) {
+			return $this->bd->lastInsertId();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function updateFeed ($id, $valuesTmp) {
+		$set = '';
+		foreach ($valuesTmp as $key => $v) {
+			$set .= $key . '=?, ';
+
+			if ($key == 'httpAuth') {
+				$valuesTmp[$key] = base64_encode ($v);
+			}
+		}
+		$set = substr ($set, 0, -2);
+
+		$sql = 'UPDATE `' . $this->prefix . 'feed` SET ' . $set . ' WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		foreach ($valuesTmp as $v) {
+			$values[] = $v;
+		}
+		$values[] = $id;
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function updateLastUpdate ($id, $inError = 0) {
+		$sql = 'UPDATE `' . $this->prefix . 'feed` f '	//2 sub-requests with FOREIGN KEY(e.id_feed), INDEX(e.is_read) faster than 1 request with GROUP BY or CASE
+		     . 'SET f.cache_nbEntries=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=f.id),'
+		     . 'f.cache_nbUnreads=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=f.id AND e2.is_read=0),'
+		     . 'lastUpdate=?, error=? '
+		     . 'WHERE f.id=?';
+
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			time (),
+			$inError,
+			$id,
+		);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function changeCategory ($idOldCat, $idNewCat) {
+		$catDAO = new FreshRSS_CategoryDAO ();
+		$newCat = $catDAO->searchById ($idNewCat);
+		if (!$newCat) {
+			$newCat = $catDAO->getDefault ();
+		}
+
+		$sql = 'UPDATE `' . $this->prefix . 'feed` SET category=? WHERE category=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array (
+			$newCat->id (),
+			$idOldCat
+		);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function deleteFeed ($id) {
+		/*//For MYISAM (MySQL 5.5-) without FOREIGN KEY
+		$sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?';
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		if (!($stm && $stm->execute ($values))) {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}*/
+
+		$sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($id);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+	public function deleteFeedByCategory ($id) {
+		/*//For MYISAM (MySQL 5.5-) without FOREIGN KEY
+		$sql = 'DELETE FROM `' . $this->prefix . 'entry` e '
+		     . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
+		     . 'WHERE f.category=?';
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		if (!($stm && $stm->execute ($values))) {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}*/
+
+		$sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE category=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($id);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function searchById ($id) {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE id=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($id);
+
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$feed = HelperFeed::daoToFeed ($res);
+
+		if (isset ($feed[$id])) {
+			return $feed[$id];
+		} else {
+			return false;
+		}
+	}
+	public function searchByUrl ($url) {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE url=?';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($url);
+
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+		$feed = current (HelperFeed::daoToFeed ($res));
+
+		if (isset ($feed)) {
+			return $feed;
+		} else {
+			return false;
+		}
+	}
+
+	public function listFeeds () {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` ORDER BY name';
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+
+		return HelperFeed::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
+	}
+
+	public function listFeedsOrderUpdate () {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` ORDER BY lastUpdate';
+		$stm = $this->bd->prepare ($sql);
+		$stm->execute ();
+
+		return HelperFeed::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
+	}
+
+	public function listByCategory ($cat) {
+		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE category=? ORDER BY name';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($cat);
+
+		$stm->execute ($values);
+
+		return HelperFeed::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
+	}
+
+	public function countEntries ($id) {
+		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=?';
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+		return $res[0]['count'];
+	}
+	public function countNotRead ($id) {
+		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND is_read=0';
+		$stm = $this->bd->prepare ($sql);
+		$values = array ($id);
+		$stm->execute ($values);
+		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
+
+		return $res[0]['count'];
+	}
+	public function updateCachedValues () {	//For one single feed, call updateLastUpdate($id)
+		$sql = 'UPDATE `' . $this->prefix . 'feed` f '
+		     . 'INNER JOIN ('
+		     .	'SELECT e.id_feed, '
+		     .	'COUNT(CASE WHEN e.is_read = 0 THEN 1 END) AS nbUnreads, '
+		     .	'COUNT(e.id) AS nbEntries '
+		     .	'FROM `' . $this->prefix . 'entry` e '
+		     .	'GROUP BY e.id_feed'
+		     . ') x ON x.id_feed=f.id '
+		     . 'SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads';
+		$stm = $this->bd->prepare ($sql);
+
+		$values = array ($feed_id);
+
+		if ($stm && $stm->execute ($values)) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+
+	public function truncate ($id) {
+		$sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e WHERE e.id_feed=?';
+		$stm = $this->bd->prepare($sql);
+		$values = array($id);
+		$this->bd->beginTransaction ();
+		if (!($stm && $stm->execute ($values))) {
+				$info = $stm->errorInfo();
+				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+				$this->bd->rollBack ();
+				return false;
+			}
+		$affected = $stm->rowCount();
+
+		$sql = 'UPDATE `' . $this->prefix . 'feed` f '
+			 . 'SET f.cache_nbEntries=0, f.cache_nbUnreads=0 WHERE f.id=?';
+		$values = array ($id);
+		$stm = $this->bd->prepare ($sql);
+		if (!($stm && $stm->execute ($values))) {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			$this->bd->rollBack ();
+			return false;
+		}
+
+		$this->bd->commit ();
+		return $affected;
+	}
+
+	public function cleanOldEntries ($id, $date_min, $keep = 15) {	//Remember to call updateLastUpdate($id) just after
+		$sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e '
+		     . 'WHERE e.id_feed = :id_feed AND e.id <= :id_max AND e.is_favorite = 0 AND e.id NOT IN '
+		     . '(SELECT id FROM (SELECT e2.id FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed = :id_feed ORDER BY id DESC LIMIT :keep) keep)';	//Double select because of: MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
+		$stm = $this->bd->prepare ($sql);
+
+		$id_max = intval($date_min) . '000000';
+
+		$stm->bindParam(':id_feed', $id, PDO::PARAM_INT);
+		$stm->bindParam(':id_max', $id_max, PDO::PARAM_INT);
+		$stm->bindParam(':keep', $keep, PDO::PARAM_INT);
+
+		if ($stm && $stm->execute ()) {
+			return $stm->rowCount();
+		} else {
+			$info = $stm->errorInfo();
+			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+			return false;
+		}
+	}
+}
+
+class HelperFeed {
+	public static function daoToFeed ($listDAO, $catID = null) {
+		$list = array ();
+
+		if (!is_array ($listDAO)) {
+			$listDAO = array ($listDAO);
+		}
+
+		foreach ($listDAO as $key => $dao) {
+			if (!isset ($dao['name'])) {
+				continue;
+			}
+			if (isset ($dao['id'])) {
+				$key = $dao['id'];
+			}
+
+			$myFeed = new FreshRSS_Feed (isset($dao['url']) ? $dao['url'] : '', false);
+			$myFeed->_category ($catID === null ? $dao['category'] : $catID);
+			$myFeed->_name ($dao['name']);
+			$myFeed->_website ($dao['website'], false);
+			$myFeed->_description (isset($dao['description']) ? $dao['description'] : '');
+			$myFeed->_lastUpdate (isset($dao['lastUpdate']) ? $dao['lastUpdate'] : 0);
+			$myFeed->_priority ($dao['priority']);
+			$myFeed->_pathEntries (isset($dao['pathEntries']) ? $dao['pathEntries'] : '');
+			$myFeed->_httpAuth (isset($dao['httpAuth']) ? base64_decode ($dao['httpAuth']) : '');
+			$myFeed->_error ($dao['error']);
+			$myFeed->_keepHistory (isset($dao['keep_history']) ? $dao['keep_history'] : '');
+			$myFeed->_nbNotRead ($dao['cache_nbUnreads']);
+			$myFeed->_nbEntries ($dao['cache_nbEntries']);
+			if (isset ($dao['id'])) {
+				$myFeed->_id ($dao['id']);
+			}
+			$list[$key] = $myFeed;
+		}
+
+		return $list;
+	}
+}

+ 26 - 0
app/Models/Log.php

@@ -0,0 +1,26 @@
+<?php
+
+class FreshRSS_Log extends Minz_Model {
+	private $date;
+	private $level;
+	private $information;
+
+	public function date () {
+		return $this->date;
+	}
+	public function level () {
+		return $this->level;
+	}
+	public function info () {
+		return $this->information;
+	}
+	public function _date ($date) {
+		$this->date = $date;
+	}
+	public function _level ($level) {
+		$this->level = $level;
+	}
+	public function _info ($information) {
+		$this->information = $information;
+	}
+}

+ 20 - 0
app/Models/LogDAO.php

@@ -0,0 +1,20 @@
+<?php
+class FreshRSS_LogDAO extends Minz_ModelTxt {
+	public function __construct () {
+		parent::__construct (LOG_PATH . '/application.log', 'r+');
+	}
+
+	public function lister () {
+		$logs = array ();
+		while (($line = $this->readLine ()) !== false) {
+			if (preg_match ('/^\[([^\[]+)\] \[([^\[]+)\] --- (.*)$/', $line, $matches)) {
+				$myLog = new FreshRSS_Log ();
+				$myLog->_date ($matches[1]);
+				$myLog->_level ($matches[2]);
+				$myLog->_info ($matches[3]);
+				$logs[] = $myLog;
+			}
+		}
+		return $logs;
+	}
+}

+ 3 - 3
app/models/RSSThemes.php → app/Models/Themes.php

@@ -1,6 +1,6 @@
 <?php
 
-class RSSThemes extends Model {
+class FreshRSS_Themes extends Minz_Model {
 	private static $themesUrl = '/themes/';
 	private static $defaultIconsUrl = '/themes/icons/';
 
@@ -82,7 +82,7 @@ class RSSThemes extends Model {
 		$url = isset(self::$themeIcons[$url]) ? (self::$themeIconsUrl . $url) :
 			(self::$defaultIconsUrl . $url);
 
-		return $urlOnly ? Url::display($url) :
-			'<img class="icon" src="' . Url::display($url) . '" alt="' . $alts[$name] . '" />';
+		return $urlOnly ? Minz_Url::display($url) :
+			'<img class="icon" src="' . Minz_Url::display($url) . '" alt="' . $alts[$name] . '" />';
 	}
 }

+ 117 - 117
app/controllers/configureController.php

@@ -1,33 +1,33 @@
 <?php
 
-class configureController extends ActionController {
+class FreshRSS_configure_Controller extends Minz_ActionController {
 	public function firstAction () {
 		if (login_is_conf ($this->view->conf) && !is_logged ()) {
-			Error::error (
+			Minz_Error::error (
 				403,
-				array ('error' => array (Translate::t ('access_denied')))
+				array ('error' => array (Minz_Translate::t ('access_denied')))
 			);
 		}
 
-		$catDAO = new CategoryDAO ();
+		$catDAO = new FreshRSS_CategoryDAO ();
 		$catDAO->checkDefault ();
 	}
 
 	public function categorizeAction () {
-		$feedDAO = new FeedDAO ();
-		$catDAO = new CategoryDAO ();
+		$feedDAO = new FreshRSS_FeedDAO ();
+		$catDAO = new FreshRSS_CategoryDAO ();
 		$catDAO->checkDefault ();
 		$defaultCategory = $catDAO->getDefault ();
 		$defaultId = $defaultCategory->id ();
 
-		if (Request::isPost ()) {
-			$cats = Request::param ('categories', array ());
-			$ids = Request::param ('ids', array ());
-			$newCat = trim (Request::param ('new_category', ''));
+		if (Minz_Request::isPost ()) {
+			$cats = Minz_Request::param ('categories', array ());
+			$ids = Minz_Request::param ('ids', array ());
+			$newCat = trim (Minz_Request::param ('new_category', ''));
 
 			foreach ($cats as $key => $name) {
 				if (strlen ($name) > 0) {
-					$cat = new Category ($name);
+					$cat = new FreshRSS_Category ($name);
 					$values = array (
 						'name' => $cat->name (),
 						'color' => $cat->color ()
@@ -40,7 +40,7 @@ class configureController extends ActionController {
 			}
 
 			if ($newCat != '') {
-				$cat = new Category ($newCat);
+				$cat = new FreshRSS_Category ($newCat);
 				$values = array (
 					'id' => $cat->id (),
 					'name' => $cat->name (),
@@ -55,11 +55,11 @@ class configureController extends ActionController {
 			// notif
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('categories_updated')
+				'content' => Minz_Translate::t ('categories_updated')
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 
-			Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true);
+			Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true);
 		}
 
 		$this->view->categories = $catDAO->listCategories (false);
@@ -67,17 +67,17 @@ class configureController extends ActionController {
 		$this->view->feeds = $feedDAO->listFeeds ();
 		$this->view->flux = false;
 
-		View::prependTitle (Translate::t ('categories_management') . ' - ');
+		Minz_View::prependTitle (Minz_Translate::t ('categories_management') . ' - ');
 	}
 
 	public function feedAction () {
-		$catDAO = new CategoryDAO ();
+		$catDAO = new FreshRSS_CategoryDAO ();
 		$this->view->categories = $catDAO->listCategories (false);
 
-		$feedDAO = new FeedDAO ();
+		$feedDAO = new FreshRSS_FeedDAO ();
 		$this->view->feeds = $feedDAO->listFeeds ();
 
-		$id = Request::param ('id');
+		$id = Minz_Request::param ('id');
 		if ($id == false && !empty ($this->view->feeds)) {
 			$id = current ($this->view->feeds)->id ();
 		}
@@ -87,22 +87,22 @@ class configureController extends ActionController {
 			$this->view->flux = $this->view->feeds[$id];
 
 			if (!$this->view->flux) {
-				Error::error (
+				Minz_Error::error (
 					404,
-					array ('error' => array (Translate::t ('page_not_found')))
+					array ('error' => array (Minz_Translate::t ('page_not_found')))
 				);
 			} else {
-				if (Request::isPost () && $this->view->flux) {
-					$name = Request::param ('name', '');
-					$description = Request::param('description', '');
-					$website = Request::param('website', '');
-					$url = Request::param('url', '');
-					$hist = Request::param ('keep_history', 'no');
-					$cat = Request::param ('category', 0);
-					$path = Request::param ('path_entries', '');
-					$priority = Request::param ('priority', 0);
-					$user = Request::param ('http_user', '');
-					$pass = Request::param ('http_pass', '');
+				if (Minz_Request::isPost () && $this->view->flux) {
+					$name = Minz_Request::param ('name', '');
+					$description = Minz_Request::param('description', '');
+					$website = Minz_Request::param('website', '');
+					$url = Minz_Request::param('url', '');
+					$hist = Minz_Request::param ('keep_history', 'no');
+					$cat = Minz_Request::param ('category', 0);
+					$path = Minz_Request::param ('path_entries', '');
+					$priority = Minz_Request::param ('priority', 0);
+					$user = Minz_Request::param ('http_user', '');
+					$pass = Minz_Request::param ('http_pass', '');
 
 					$keep_history = false;
 					if ($hist == 'yes') {
@@ -131,58 +131,58 @@ class configureController extends ActionController {
 
 						$notif = array (
 							'type' => 'good',
-							'content' => Translate::t ('feed_updated')
+							'content' => Minz_Translate::t ('feed_updated')
 						);
 					} else {
 						$notif = array (
 							'type' => 'bad',
-							'content' => Translate::t ('error_occurred_update')
+							'content' => Minz_Translate::t ('error_occurred_update')
 						);
 					}
 
-					Session::_param ('notification', $notif);
-					Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array ('id' => $id)), true);
+					Minz_Session::_param ('notification', $notif);
+					Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array ('id' => $id)), true);
 				}
 
-				View::prependTitle (Translate::t ('rss_feed_management') . ' - ' . $this->view->flux->name () . ' - ');
+				Minz_View::prependTitle (Minz_Translate::t ('rss_feed_management') . ' - ' . $this->view->flux->name () . ' - ');
 			}
 		} else {
-			View::prependTitle (Translate::t ('rss_feed_management') . ' - ');
+			Minz_View::prependTitle (Minz_Translate::t ('rss_feed_management') . ' - ');
 		}
 	}
 
 	public function displayAction () {
-		if (Request::isPost ()) {
+		if (Minz_Request::isPost ()) {
 			$current_token = $this->view->conf->token ();
 
-			$language = Request::param ('language', 'en');
-			$nb = Request::param ('posts_per_page', 10);
-			$mode = Request::param ('view_mode', 'normal');
-			$view = Request::param ('default_view', 'a');
-			$auto_load_more = Request::param ('auto_load_more', 'no');
-			$display = Request::param ('display_posts', 'no');
-			$onread_jump_next = Request::param ('onread_jump_next', 'no');
-			$lazyload = Request::param ('lazyload', 'no');
-			$sort = Request::param ('sort_order', 'DESC');
-			$old = Request::param ('old_entries', 3);
-			$mail = Request::param ('mail_login', false);
-			$anon = Request::param ('anon_access', 'no');
-			$token = Request::param ('token', $current_token);
-			$openArticle = Request::param ('mark_open_article', 'no');
-			$openSite = Request::param ('mark_open_site', 'no');
-			$scroll = Request::param ('mark_scroll', 'no');
-			$reception = Request::param ('mark_upon_reception', 'no');
-			$theme = Request::param ('theme', 'default');
-			$topline_read = Request::param ('topline_read', 'no');
-			$topline_favorite = Request::param ('topline_favorite', 'no');
-			$topline_date = Request::param ('topline_date', 'no');
-			$topline_link = Request::param ('topline_link', 'no');
-			$bottomline_read = Request::param ('bottomline_read', 'no');
-			$bottomline_favorite = Request::param ('bottomline_favorite', 'no');
-			$bottomline_sharing = Request::param ('bottomline_sharing', 'no');
-			$bottomline_tags = Request::param ('bottomline_tags', 'no');
-			$bottomline_date = Request::param ('bottomline_date', 'no');
-			$bottomline_link = Request::param ('bottomline_link', 'no');
+			$language = Minz_Request::param ('language', 'en');
+			$nb = Minz_Request::param ('posts_per_page', 10);
+			$mode = Minz_Request::param ('view_mode', 'normal');
+			$view = Minz_Request::param ('default_view', 'a');
+			$auto_load_more = Minz_Request::param ('auto_load_more', 'no');
+			$display = Minz_Request::param ('display_posts', 'no');
+			$onread_jump_next = Minz_Request::param ('onread_jump_next', 'no');
+			$lazyload = Minz_Request::param ('lazyload', 'no');
+			$sort = Minz_Request::param ('sort_order', 'DESC');
+			$old = Minz_Request::param ('old_entries', 3);
+			$mail = Minz_Request::param ('mail_login', false);
+			$anon = Minz_Request::param ('anon_access', 'no');
+			$token = Minz_Request::param ('token', $current_token);
+			$openArticle = Minz_Request::param ('mark_open_article', 'no');
+			$openSite = Minz_Request::param ('mark_open_site', 'no');
+			$scroll = Minz_Request::param ('mark_scroll', 'no');
+			$reception = Minz_Request::param ('mark_upon_reception', 'no');
+			$theme = Minz_Request::param ('theme', 'default');
+			$topline_read = Minz_Request::param ('topline_read', 'no');
+			$topline_favorite = Minz_Request::param ('topline_favorite', 'no');
+			$topline_date = Minz_Request::param ('topline_date', 'no');
+			$topline_link = Minz_Request::param ('topline_link', 'no');
+			$bottomline_read = Minz_Request::param ('bottomline_read', 'no');
+			$bottomline_favorite = Minz_Request::param ('bottomline_favorite', 'no');
+			$bottomline_sharing = Minz_Request::param ('bottomline_sharing', 'no');
+			$bottomline_tags = Minz_Request::param ('bottomline_tags', 'no');
+			$bottomline_date = Minz_Request::param ('bottomline_date', 'no');
+			$bottomline_link = Minz_Request::param ('bottomline_link', 'no');
 
 			$this->view->conf->_language ($language);
 			$this->view->conf->_postsPerPage (intval ($nb));
@@ -243,81 +243,81 @@ class configureController extends ActionController {
 				'bottomline_link' => $this->view->conf->bottomlineLink () ? 'yes' : 'no',
 			);
 
-			$confDAO = new RSSConfigurationDAO ();
+			$confDAO = new FreshRSS_ConfigurationDAO ();
 			$confDAO->update ($values);
-			Session::_param ('conf', $this->view->conf);
-			Session::_param ('mail', $this->view->conf->mailLogin ());
+			Minz_Session::_param ('conf', $this->view->conf);
+			Minz_Session::_param ('mail', $this->view->conf->mailLogin ());
 
-			Session::_param ('language', $this->view->conf->language ());
+			Minz_Session::_param ('language', $this->view->conf->language ());
 			Translate::reset ();
 
 			// notif
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('configuration_updated')
+				'content' => Minz_Translate::t ('configuration_updated')
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 
-			Request::forward (array ('c' => 'configure', 'a' => 'display'), true);
+			Minz_Request::forward (array ('c' => 'configure', 'a' => 'display'), true);
 		}
 
-		$this->view->themes = RSSThemes::get();
+		$this->view->themes = FreshRSS_Themes::get();
 
-		View::prependTitle (Translate::t ('general_and_reading_management') . ' - ');
+		Minz_View::prependTitle (Minz_Translate::t ('general_and_reading_management') . ' - ');
 
-		$entryDAO = new EntryDAO ();
+		$entryDAO = new FreshRSS_EntryDAO ();
 		$this->view->nb_total = $entryDAO->count ();
 		$this->view->size_total = $entryDAO->size ();
 	}
 
 	public function sharingAction () {
-		if (Request::isPost ()) {
+		if (Minz_Request::isPost ()) {
 			$this->view->conf->_sharing (array (
-				'shaarli' => Request::param ('shaarli', ''),
-				'poche' => Request::param ('poche', ''),
-				'diaspora' => Request::param ('diaspora', ''),
-				'twitter' => Request::param ('twitter', 'no') === 'yes',
-				'g+' => Request::param ('g+', 'no') === 'yes',
-				'facebook' => Request::param ('facebook', 'no') === 'yes',
-				'email' => Request::param ('email', 'no') === 'yes',
-				'print' => Request::param ('print', 'no') === 'yes'
+				'shaarli' => Minz_Request::param ('shaarli', ''),
+				'poche' => Minz_Request::param ('poche', ''),
+				'diaspora' => Minz_Request::param ('diaspora', ''),
+				'twitter' => Minz_Request::param ('twitter', 'no') === 'yes',
+				'g+' => Minz_Request::param ('g+', 'no') === 'yes',
+				'facebook' => Minz_Request::param ('facebook', 'no') === 'yes',
+				'email' => Minz_Request::param ('email', 'no') === 'yes',
+				'print' => Minz_Request::param ('print', 'no') === 'yes'
 			));
 
-			$confDAO = new RSSConfigurationDAO ();
+			$confDAO = new FreshRSS_ConfigurationDAO ();
 			$confDAO->update ($this->view->conf->sharing ());
-			Session::_param ('conf', $this->view->conf);
+			Minz_Session::_param ('conf', $this->view->conf);
 
 			// notif
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('configuration_updated')
+				'content' => Minz_Translate::t ('configuration_updated')
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 
-			Request::forward (array ('c' => 'configure', 'a' => 'sharing'), true);
+			Minz_Request::forward (array ('c' => 'configure', 'a' => 'sharing'), true);
 		}
 
-		View::prependTitle (Translate::t ('sharing_management') . ' - ');
+		Minz_View::prependTitle (Minz_Translate::t ('sharing_management') . ' - ');
 
-		$entryDAO = new EntryDAO ();
+		$entryDAO = new FreshRSS_EntryDAO ();
 		$this->view->nb_total = $entryDAO->count ();
 	}
 
 	public function importExportAction () {
-		$catDAO = new CategoryDAO ();
+		$catDAO = new FreshRSS_CategoryDAO ();
 		$this->view->categories = $catDAO->listCategories ();
 
-		$this->view->req = Request::param ('q');
+		$this->view->req = Minz_Request::param ('q');
 
 		if ($this->view->req == 'export') {
-			View::_title ('freshrss_feeds.opml');
+			Minz_View::_title ('freshrss_feeds.opml');
 
 			$this->view->_useLayout (false);
 			header('Content-Type: application/xml; charset=utf-8');
 			header('Content-disposition: attachment; filename=freshrss_feeds.opml');
 
-			$feedDAO = new FeedDAO ();
-			$catDAO = new CategoryDAO ();
+			$feedDAO = new FreshRSS_FeedDAO ();
+			$catDAO = new FreshRSS_CategoryDAO ();
 
 			$list = array ();
 			foreach ($catDAO->listCategories () as $key => $cat) {
@@ -326,7 +326,7 @@ class configureController extends ActionController {
 			}
 
 			$this->view->categories = $list;
-		} elseif ($this->view->req == 'import' && Request::isPost ()) {
+		} elseif ($this->view->req == 'import' && Minz_Request::isPost ()) {
 			if ($_FILES['file']['error'] == 0) {
 				// on parse le fichier OPML pour récupérer les catégories et les flux associés
 				try {
@@ -336,20 +336,20 @@ class configureController extends ActionController {
 
 					// On redirige vers le controller feed qui va se charger d'insérer les flux en BDD
 					// les flux sont mis au préalable dans des variables de Request
-					Request::_param ('q', 'null');
-					Request::_param ('categories', $categories);
-					Request::_param ('feeds', $feeds);
-					Request::forward (array ('c' => 'feed', 'a' => 'massiveImport'));
-				} catch (OpmlException $e) {
+					Minz_Request::_param ('q', 'null');
+					Minz_Request::_param ('categories', $categories);
+					Minz_Request::_param ('feeds', $feeds);
+					Minz_Request::forward (array ('c' => 'feed', 'a' => 'massiveImport'));
+				} catch (FreshRSS_Opml_Exception $e) {
 					Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
 
 					$notif = array (
 						'type' => 'bad',
-						'content' => Translate::t ('bad_opml_file')
+						'content' => Minz_Translate::t ('bad_opml_file')
 					);
-					Session::_param ('notification', $notif);
+					Minz_Session::_param ('notification', $notif);
 
-					Request::forward (array (
+					Minz_Request::forward (array (
 						'c' => 'configure',
 						'a' => 'importExport'
 					), true);
@@ -357,13 +357,13 @@ class configureController extends ActionController {
 			}
 		}
 
-		$feedDAO = new FeedDAO ();
+		$feedDAO = new FreshRSS_FeedDAO ();
 		$this->view->feeds = $feedDAO->listFeeds ();
 
 		// au niveau de la vue, permet de ne pas voir un flux sélectionné dans la liste
 		$this->view->flux = false;
 
-		View::prependTitle (Translate::t ('import_export_opml') . ' - ');
+		Minz_View::prependTitle (Translate::t ('import_export_opml') . ' - ');
 	}
 
 	public function shortcutAction () {
@@ -379,8 +379,8 @@ class configureController extends ActionController {
 		                     'prev_entry', 'next_page', 'prev_page', 'collapse_entry',
 		                     'load_more');
 
-		if (Request::isPost ()) {
-			$shortcuts = Request::param ('shortcuts');
+		if (Minz_Request::isPost ()) {
+			$shortcuts = Minz_Request::param ('shortcuts');
 			$shortcuts_ok = array ();
 
 			foreach ($shortcuts as $key => $value) {
@@ -396,20 +396,20 @@ class configureController extends ActionController {
 				'shortcuts' => $this->view->conf->shortcuts ()
 			);
 
-			$confDAO = new RSSConfigurationDAO ();
+			$confDAO = new FreshRSS_ConfigurationDAO ();
 			$confDAO->update ($values);
-			Session::_param ('conf', $this->view->conf);
+			Minz_Session::_param ('conf', $this->view->conf);
 
 			// notif
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('shortcuts_updated')
+				'content' => Minz_Translate::t ('shortcuts_updated')
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 
-			Request::forward (array ('c' => 'configure', 'a' => 'shortcut'), true);
+			Minz_Request::forward (array ('c' => 'configure', 'a' => 'shortcut'), true);
 		}
 
-		View::prependTitle (Translate::t ('shortcuts_management') . ' - ');
+		Minz_View::prependTitle (Minz_Translate::t ('shortcuts_management') . ' - ');
 	}
 }

+ 22 - 22
app/controllers/entryController.php

@@ -1,46 +1,46 @@
 <?php
 
-class entryController extends ActionController {
+class FreshRSS_entry_Controller extends Minz_ActionController {
 	public function firstAction () {
 		if (login_is_conf ($this->view->conf) && !is_logged ()) {
-			Error::error (
+			Minz_Error::error (
 				403,
-				array ('error' => array (Translate::t ('access_denied')))
+				array ('error' => array (Minz_Translate::t ('access_denied')))
 			);
 		}
 
 		$this->params = array ();
 		$this->redirect = false;
-		$ajax = Request::param ('ajax');
+		$ajax = Minz_Request::param ('ajax');
 		if ($ajax) {
 			$this->view->_useLayout (false);
 		}
 	}
 	public function lastAction () {
-		$ajax = Request::param ('ajax');
+		$ajax = Minz_Request::param ('ajax');
 		if (!$ajax && $this->redirect) {
-			Request::forward (array (
+			Minz_Request::forward (array (
 				'c' => 'index',
 				'a' => 'index',
 				'params' => $this->params
 			), true);
 		} else {
-			Request::_param ('ajax');
+			Minz_Request::_param ('ajax');
 		}
 	}
 
 	public function readAction () {
 		$this->redirect = true;
 
-		$id = Request::param ('id');
-		$is_read = Request::param ('is_read');
-		$get = Request::param ('get');
-		$nextGet = Request::param ('nextGet', $get); 
-		$idMax = Request::param ('idMax', 0);
+		$id = Minz_Request::param ('id');
+		$is_read = Minz_Request::param ('is_read');
+		$get = Minz_Request::param ('get');
+		$nextGet = Minz_Request::param ('nextGet', $get); 
+		$idMax = Minz_Request::param ('idMax', 0);
 
 		$is_read = !!$is_read;
 
-		$entryDAO = new EntryDAO ();
+		$entryDAO = new FreshRSS_EntryDAO ();
 		if ($id == false) {
 			if (!$get) {
 				$entryDAO->markReadEntries ($idMax);
@@ -68,9 +68,9 @@ class entryController extends ActionController {
 
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('feeds_marked_read')
+				'content' => Minz_Translate::t ('feeds_marked_read')
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 		} else {
 			$entryDAO->markRead ($id, $is_read);
 		}
@@ -79,10 +79,10 @@ class entryController extends ActionController {
 	public function bookmarkAction () {
 		$this->redirect = true;
 
-		$id = Request::param ('id');
+		$id = Minz_Request::param ('id');
 		if ($id) {
-			$entryDAO = new EntryDAO ();
-			$entryDAO->markFavorite ($id, Request::param ('is_favorite'));
+			$entryDAO = new FreshRSS_EntryDAO ();
+			$entryDAO->markFavorite ($id, Minz_Request::param ('is_favorite'));
 		}
 	}
 
@@ -93,18 +93,18 @@ class entryController extends ActionController {
 		// La table des entrées a tendance à grossir énormément
 		// Cette action permet d'optimiser cette table permettant de grapiller un peu de place
 		// Cette fonctionnalité n'est à appeler qu'occasionnellement
-		$entryDAO = new EntryDAO();
+		$entryDAO = new FreshRSS_EntryDAO();
 		$entryDAO->optimizeTable();
 
 		invalidateHttpCache();
 
 		$notif = array (
 			'type' => 'good',
-			'content' => Translate::t ('optimization_complete')
+			'content' => Minz_Translate::t ('optimization_complete')
 		);
-		Session::_param ('notification', $notif);
+		Minz_Session::_param ('notification', $notif);
 
-		Request::forward(array(
+		Minz_Request::forward(array(
 			'c' => 'configure',
 			'a' => 'display'
 		), true);

+ 4 - 4
app/controllers/errorController.php

@@ -1,8 +1,8 @@
 <?php
 
-class ErrorController extends ActionController {
+class FreshRSS_error_Controller extends Minz_ActionController {
 	public function indexAction () {
-		switch (Request::param ('code')) {
+		switch (Minz_Request::param ('code')) {
 		case 403:
 			$this->view->code = 'Error 403 - Forbidden';
 			break;
@@ -19,8 +19,8 @@ class ErrorController extends ActionController {
 			$this->view->code = 'Error 404 - Not found';
 		}
 		
-		$this->view->logs = Request::param ('logs');
+		$this->view->logs = Minz_Request::param ('logs');
 		
-		View::prependTitle ($this->view->code . ' - ');
+		Minz_View::prependTitle ($this->view->code . ' - ');
 	}
 }

+ 71 - 71
app/controllers/feedController.php

@@ -1,22 +1,22 @@
 <?php
 
-class feedController extends ActionController {
+class FreshRSS_feed_Controller extends Minz_ActionController {
 	public function firstAction () {
 		$token = $this->view->conf->token();
-		$token_param = Request::param ('token', '');
+		$token_param = Minz_Request::param ('token', '');
 		$token_is_ok = ($token != '' && $token == $token_param);
-		$action = Request::actionName ();
+		$action = Minz_Request::actionName ();
 
 		if (login_is_conf ($this->view->conf) &&
 				!is_logged () &&
 				!($token_is_ok && $action == 'actualize')) {
-			Error::error (
+			Minz_Error::error (
 				403,
-				array ('error' => array (Translate::t ('access_denied')))
+				array ('error' => array (Minz_Translate::t ('access_denied')))
 			);
 		}
 
-		$this->catDAO = new CategoryDAO ();
+		$this->catDAO = new FreshRSS_CategoryDAO ();
 		$this->catDAO->checkDefault ();
 	}
 
@@ -32,21 +32,21 @@ class feedController extends ActionController {
 	public function addAction () {
 		@set_time_limit(300);
 
-		if (Request::isPost ()) {
-			$url = Request::param ('url_rss');
-			$cat = Request::param ('category', false);
+		if (Minz_Request::isPost ()) {
+			$url = Minz_Request::param ('url_rss');
+			$cat = Minz_Request::param ('category', false);
 			if ($cat === false) {
 				$def_cat = $this->catDAO->getDefault ();
 				$cat = $def_cat->id ();
 			}
 
-			$user = Request::param ('username');
-			$pass = Request::param ('password');
+			$user = Minz_Request::param ('username');
+			$pass = Minz_Request::param ('password');
 			$params = array ();
 
 			$transactionStarted = false;
 			try {
-				$feed = new Feed ($url);
+				$feed = new FreshRSS_Feed ($url);
 				$feed->_category ($cat);
 
 				$httpAuth = '';
@@ -57,7 +57,7 @@ class feedController extends ActionController {
 
 				$feed->load ();
 
-				$feedDAO = new FeedDAO ();
+				$feedDAO = new FreshRSS_FeedDAO ();
 				$values = array (
 					'url' => $feed->url (),
 					'category' => $feed->category (),
@@ -72,25 +72,25 @@ class feedController extends ActionController {
 					// on est déjà abonné à ce flux
 					$notif = array (
 						'type' => 'bad',
-						'content' => Translate::t ('already_subscribed', $feed->name ())
+						'content' => Minz_Translate::t ('already_subscribed', $feed->name ())
 					);
-					Session::_param ('notification', $notif);
+					Minz_Session::_param ('notification', $notif);
 				} else {
 					$id = $feedDAO->addFeed ($values);
 					if (!$id) {
 						// problème au niveau de la base de données
 						$notif = array (
 							'type' => 'bad',
-							'content' => Translate::t ('feed_not_added', $feed->name ())
+							'content' => Minz_Translate::t ('feed_not_added', $feed->name ())
 						);
-						Session::_param ('notification', $notif);
+						Minz_Session::_param ('notification', $notif);
 					} else {
 						$feed->_id ($id);
 						$feed->faviconPrepare();
 
 						$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
 
-						$entryDAO = new EntryDAO ();
+						$entryDAO = new FreshRSS_EntryDAO ();
 						$entries = $feed->entries ();
 						usort($entries, 'self::entryDateComparer');
 
@@ -118,68 +118,68 @@ class feedController extends ActionController {
 						// ok, ajout terminé
 						$notif = array (
 							'type' => 'good',
-							'content' => Translate::t ('feed_added', $feed->name ())
+							'content' => Minz_Translate::t ('feed_added', $feed->name ())
 						);
-						Session::_param ('notification', $notif);
+						Minz_Session::_param ('notification', $notif);
 
 						// permet de rediriger vers la page de conf du flux
 						$params['id'] = $feed->id ();
 					}
 				}
-			} catch (BadUrlException $e) {
+			} catch (FreshRSS_BadUrl_Exception $e) {
 				Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
 				$notif = array (
 					'type' => 'bad',
-					'content' => Translate::t ('invalid_url', $url)
+					'content' => Minz_Translate::t ('invalid_url', $url)
 				);
-				Session::_param ('notification', $notif);
-			} catch (FeedException $e) {
+				Minz_Session::_param ('notification', $notif);
+			} catch (FreshRSS_Feed_Exception $e) {
 				Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
 				$notif = array (
 					'type' => 'bad',
-					'content' => Translate::t ('internal_problem_feed')
+					'content' => Minz_Translate::t ('internal_problem_feed')
 				);
-				Session::_param ('notification', $notif);
-			} catch (FileNotExistException $e) {
+				Minz_Session::_param ('notification', $notif);
+			} catch (Minz_FileNotExistException $e) {
 				// Répertoire de cache n'existe pas
 				Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
 				$notif = array (
 					'type' => 'bad',
-					'content' => Translate::t ('internal_problem_feed')
+					'content' => Minz_Translate::t ('internal_problem_feed')
 				);
-				Session::_param ('notification', $notif);
+				Minz_Session::_param ('notification', $notif);
 			}
 			if ($transactionStarted) {
 				$feedDAO->rollBack ();
 			}
 
-			Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => $params), true);
+			Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => $params), true);
 		}
 	}
 
 	public function truncateAction () {
-		if (Request::isPost ()) {
-			$id = Request::param ('id');
-			$feedDAO = new FeedDAO ();
+		if (Minz_Request::isPost ()) {
+			$id = Minz_Request::param ('id');
+			$feedDAO = new FreshRSS_FeedDAO ();
 			$n = $feedDAO->truncate($id);
 			$notif = array(
 				'type' => $n === false ? 'bad' : 'good',
-				'content' => Translate::t ('n_entries_deleted', $n)
+				'content' => Minz_Translate::t ('n_entries_deleted', $n)
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 			invalidateHttpCache();
-			Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array('id' => $id)), true);
+			Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array('id' => $id)), true);
 		}
 	}
 
 	public function actualizeAction () {
 		@set_time_limit(300);
 
-		$feedDAO = new FeedDAO ();
-		$entryDAO = new EntryDAO ();
+		$feedDAO = new FreshRSS_FeedDAO ();
+		$entryDAO = new FreshRSS_EntryDAO ();
 
-		$id = Request::param ('id');
-		$force = Request::param ('force', false);
+		$id = Minz_Request::param ('id');
+		$force = Minz_Request::param ('force', false);
 
 		// on créé la liste des flux à mettre à actualiser
 		// si on veut mettre un flux à jour spécifiquement, on le met
@@ -236,7 +236,7 @@ class feedController extends ActionController {
 				$feedDAO->updateLastUpdate ($feed->id ());
 				$feedDAO->commit ();
 				$flux_update++;
-			} catch (FeedException $e) {
+			} catch (FreshRSS_Feed_Exception $e) {
 				Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
 				$feedDAO->updateLastUpdate ($feed->id (), 1);
 			}
@@ -254,19 +254,19 @@ class feedController extends ActionController {
 			// on a mis un seul flux à jour
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('feed_actualized', $feed->name ())
+				'content' => Minz_Translate::t ('feed_actualized', $feed->name ())
 			);
 		} elseif ($flux_update > 1) {
 			// plusieurs flux on été mis à jour
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('n_feeds_actualized', $flux_update)
+				'content' => Minz_Translate::t ('n_feeds_actualized', $flux_update)
 			);
 		} else {
 			// aucun flux n'a été mis à jour, oups
 			$notif = array (
 				'type' => 'bad',
-				'content' => Translate::t ('no_feed_actualized')
+				'content' => Minz_Translate::t ('no_feed_actualized')
 			);
 		}
 
@@ -277,9 +277,9 @@ class feedController extends ActionController {
 			$url['params'] = array ('get' => 'f_' . $feed->id ());
 		}
 
-		if (Request::param ('ajax', 0) === 0) {
-			Session::_param ('notification', $notif);
-			Request::forward ($url, true);
+		if (Minz_Request::param ('ajax', 0) === 0) {
+			Minz_Session::_param ('notification', $notif);
+			Minz_Request::forward ($url, true);
 		} else {
 			// Une requête Ajax met un seul flux à jour.
 			// Comme en principe plusieurs requêtes ont lieu,
@@ -288,9 +288,9 @@ class feedController extends ActionController {
 			// ressenti utilisateur
 			$notif = array (
 				'type' => 'good',
-				'content' => Translate::t ('feeds_actualized')
+				'content' => Minz_Translate::t ('feeds_actualized')
 			);
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 			// et on désactive le layout car ne sert à rien
 			$this->view->_useLayout (false);
 		}
@@ -299,11 +299,11 @@ class feedController extends ActionController {
 	public function massiveImportAction () {
 		@set_time_limit(300);
 
-		$entryDAO = new EntryDAO ();
-		$feedDAO = new FeedDAO ();
+		$entryDAO = new FreshRSS_EntryDAO ();
+		$feedDAO = new FreshRSS_FeedDAO ();
 
-		$categories = Request::param ('categories', array (), true);
-		$feeds = Request::param ('feeds', array (), true);
+		$categories = Minz_Request::param ('categories', array (), true);
+		$feeds = Minz_Request::param ('feeds', array (), true);
 
 		// on ajoute les catégories en masse dans une fonction à part
 		$this->addCategories ($categories);
@@ -341,78 +341,78 @@ class feedController extends ActionController {
 						$error = true;
 					}
 				}
-			} catch (FeedException $e) {
+			} catch (FreshRSS_Feed_Exception $e) {
 				$error = true;
 				Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
 			}
 		}
 
 		if ($error) {
-			$res = Translate::t ('feeds_imported_with_errors');
+			$res = Minz_Translate::t ('feeds_imported_with_errors');
 		} else {
-			$res = Translate::t ('feeds_imported');
+			$res = Minz_Translate::t ('feeds_imported');
 		}
 
 		$notif = array (
 			'type' => 'good',
 			'content' => $res
 		);
-		Session::_param ('notification', $notif);
-		Session::_param ('actualize_feeds', true);
+		Minz_Session::_param ('notification', $notif);
+		Minz_Session::_param ('actualize_feeds', true);
 
 		// et on redirige vers la page d'accueil
-		Request::forward (array (
+		Minz_Request::forward (array (
 			'c' => 'index',
 			'a' => 'index'
 		), true);
 	}
 
 	public function deleteAction () {
-		if (Request::isPost ()) {
-			$type = Request::param ('type', 'feed');
-			$id = Request::param ('id');
+		if (Minz_Request::isPost ()) {
+			$type = Minz_Request::param ('type', 'feed');
+			$id = Minz_Request::param ('id');
 
-			$feedDAO = new FeedDAO ();
+			$feedDAO = new FreshRSS_FeedDAO ();
 			if ($type == 'category') {
 				if ($feedDAO->deleteFeedByCategory ($id)) {
 					$notif = array (
 						'type' => 'good',
-						'content' => Translate::t ('category_emptied')
+						'content' => Minz_Translate::t ('category_emptied')
 					);
 					//TODO: Delete old favicons
 				} else {
 					$notif = array (
 						'type' => 'bad',
-						'content' => Translate::t ('error_occured')
+						'content' => Minz_Translate::t ('error_occured')
 					);
 				}
 			} else {
 				if ($feedDAO->deleteFeed ($id)) {
 					$notif = array (
 						'type' => 'good',
-						'content' => Translate::t ('feed_deleted')
+						'content' => Minz_Translate::t ('feed_deleted')
 					);
 					Feed::faviconDelete($id);
 				} else {
 					$notif = array (
 						'type' => 'bad',
-						'content' => Translate::t ('error_occured')
+						'content' => Minz_Translate::t ('error_occured')
 					);
 				}
 			}
 
-			Session::_param ('notification', $notif);
+			Minz_Session::_param ('notification', $notif);
 
 			if ($type == 'category') {
-				Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true);
+				Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true);
 			} else {
-				Request::forward (array ('c' => 'configure', 'a' => 'feed'), true);
+				Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed'), true);
 			}
 		}
 	}
 
 	private function addCategories ($categories) {
-		$catDAO = new CategoryDAO ();
+		$catDAO = new FreshRSS_CategoryDAO ();
 
 		foreach ($categories as $cat) {
 			if (!$catDAO->searchByName ($cat->name ())) {

+ 39 - 39
app/controllers/indexController.php

@@ -1,6 +1,6 @@
 <?php
 
-class indexController extends ActionController {
+class FreshRSS_index_Controller extends Minz_ActionController {
 	private $get = false;
 	private $nb_not_read_cat = 0;
 	private $entryDAO;
@@ -9,16 +9,16 @@ class indexController extends ActionController {
 
 	function __construct($router) {
 		parent::__construct($router);
-		$this->entryDAO = new EntryDAO ();
-		$this->feedDAO = new FeedDAO ();
-		$this->catDAO = new CategoryDAO ();
+		$this->entryDAO = new FreshRSS_EntryDAO ();
+		$this->feedDAO = new FreshRSS_FeedDAO ();
+		$this->catDAO = new FreshRSS_CategoryDAO ();
 	}
 
 	public function indexAction () {
-		$output = Request::param ('output');
+		$output = Minz_Request::param ('output');
 
 		$token = $this->view->conf->token();
-		$token_param = Request::param ('token', '');
+		$token_param = Minz_Request::param ('token', '');
 		$token_is_ok = ($token != '' && $token === $token_param);
 
 		// check if user is log in
@@ -30,7 +30,7 @@ class indexController extends ActionController {
 		}
 
 		// construction of RSS url of this feed
-		$params = Request::params ();
+		$params = Minz_Request::params ();
 		$params['output'] = 'rss';
 		if (isset ($params['search'])) {
 			$params['search'] = urlencode ($params['search']);
@@ -51,10 +51,10 @@ class indexController extends ActionController {
 			$this->view->_useLayout (false);
 			header('Content-Type: application/rss+xml; charset=utf-8');
 		} else {
-			View::appendScript (Url::display ('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js')));
+			Minz_View::appendScript (Minz_Url::display ('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js')));
 
 			if ($output === 'global') {
-				View::appendScript (Url::display ('/scripts/global_view.js?' . @filemtime(PUBLIC_PATH . '/scripts/global_view.js')));
+				Minz_View::appendScript (Minz_Url::display ('/scripts/global_view.js?' . @filemtime(PUBLIC_PATH . '/scripts/global_view.js')));
 			}
 		}
 
@@ -65,14 +65,14 @@ class indexController extends ActionController {
 		$this->view->get_c = '';
 		$this->view->get_f = '';
 
-		$get = Request::param ('get', 'a');
+		$get = Minz_Request::param ('get', 'a');
 		$getType = $get[0];
 		$getId = substr ($get, 2);
 		if (!$this->checkAndProcessType ($getType, $getId)) {
 			Minz_Log::record ('Not found [' . $getType . '][' . $getId . ']', Minz_Log::DEBUG);
-			Error::error (
+			Minz_Error::error (
 				404,
-				array ('error' => array (Translate::t ('page_not_found')))
+				array ('error' => array (Minz_Translate::t ('page_not_found')))
 			);
 			return;
 		}
@@ -80,25 +80,25 @@ class indexController extends ActionController {
 		$this->view->nb_not_read = HelperCategory::CountUnreads($this->view->cat_aside, 1);
 
 		// mise à jour des titres
-		$this->view->rss_title = $this->view->currentName . ' | ' . View::title();
+		$this->view->rss_title = $this->view->currentName . ' | ' . Minz_View::title();
 		if ($this->view->nb_not_read > 0) {
-			View::appendTitle (' (' . $this->view->nb_not_read . ')');
+			Minz_View::appendTitle (' (' . $this->view->nb_not_read . ')');
 		}
-		View::prependTitle (
+		Minz_View::prependTitle (
 			$this->view->currentName .
 			($this->nb_not_read_cat > 0 ? ' (' . $this->nb_not_read_cat . ')' : '') .
 			' - '
 		);
 
 		// On récupère les différents éléments de filtrage
-		$this->view->state = $state = Request::param ('state', $this->view->conf->defaultView ());
-		$filter = Request::param ('search', '');
+		$this->view->state = $state = Minz_Request::param ('state', $this->view->conf->defaultView ());
+		$filter = Minz_Request::param ('search', '');
 		if (!empty($filter)) {
 			$state = 'all';	//Search always in read and unread articles
 		}
-		$this->view->order = $order = Request::param ('order', $this->view->conf->sortOrder ());
-		$nb = Request::param ('nb', $this->view->conf->postsPerPage ());
-		$first = Request::param ('next', '');
+		$this->view->order = $order = Minz_Request::param ('order', $this->view->conf->sortOrder ());
+		$nb = Minz_Request::param ('nb', $this->view->conf->postsPerPage ());
+		$first = Minz_Request::param ('next', '');
 
 		if ($state === 'not_read') {	//Any unread article in this category at all?
 			switch ($getType) {
@@ -143,11 +143,11 @@ class indexController extends ActionController {
 			}
 
 			$this->view->entries = $entries;
-		} catch (EntriesGetterException $e) {
+		} catch (FreshRSS_EntriesGetter_Exception $e) {
 			Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
-			Error::error (
+			Minz_Error::error (
 				404,
-				array ('error' => array (Translate::t ('page_not_found')))
+				array ('error' => array (Minz_Translate::t ('page_not_found')))
 			);
 		}
 	}
@@ -160,11 +160,11 @@ class indexController extends ActionController {
 	private function checkAndProcessType ($getType, $getId) {
 		switch ($getType) {
 			case 'a':
-				$this->view->currentName = Translate::t ('your_rss_feeds');
+				$this->view->currentName = Minz_Translate::t ('your_rss_feeds');
 				$this->view->get_c = $getType;
 				return true;
 			case 's':
-				$this->view->currentName = Translate::t ('your_favorites');
+				$this->view->currentName = Minz_Translate::t ('your_favorites');
 				$this->view->get_c = $getType;
 				return true;
 			case 'c':
@@ -200,35 +200,35 @@ class indexController extends ActionController {
 	}
 
 	public function aboutAction () {
-		View::prependTitle (Translate::t ('about') . ' - ');
+		Minz_View::prependTitle (Minz_Translate::t ('about') . ' - ');
 	}
 
 	public function logsAction () {
 		if (login_is_conf ($this->view->conf) && !is_logged ()) {
-			Error::error (
+			Minz_Error::error (
 				403,
-				array ('error' => array (Translate::t ('access_denied')))
+				array ('error' => array (Minz_Translate::t ('access_denied')))
 			);
 		}
 
-		View::prependTitle (Translate::t ('logs') . ' - ');
+		Minz_View::prependTitle (Minz_Translate::t ('logs') . ' - ');
 
-		if (Request::isPost ()) {
+		if (Minz_Request::isPost ()) {
 			file_put_contents(LOG_PATH . '/application.log', '');
 		}
 
 		$logs = array();
 		try {
-			$logDAO = new LogDAO ();
+			$logDAO = new FreshRSS_LogDAO ();
 			$logs = $logDAO->lister ();
 			$logs = array_reverse ($logs);
-		} catch(FileNotExistException $e) {
+		} catch (Minz_FileNotExistException $e) {
 
 		}
 
 		//gestion pagination
-		$page = Request::param ('page', 1);
-		$this->view->logsPaginator = new Paginator ($logs);
+		$page = Minz_Request::param ('page', 1);
+		$this->view->logsPaginator = new Minz_Paginator ($logs);
 		$this->view->logsPaginator->_nbItemsPerPage (50);
 		$this->view->logsPaginator->_currentPage ($page);
 	}
@@ -237,9 +237,9 @@ class indexController extends ActionController {
 		$this->view->_useLayout (false);
 
 		$url = 'https://verifier.login.persona.org/verify';
-		$assert = Request::param ('assertion');
+		$assert = Minz_Request::param ('assertion');
 		$params = 'assertion=' . $assert . '&audience=' .
-			  urlencode (Url::display (null, 'php', true));
+			  urlencode (Minz_Url::display (null, 'php', true));
 		$ch = curl_init ();
 		$options = array (
 			CURLOPT_URL => $url,
@@ -253,12 +253,12 @@ class indexController extends ActionController {
 
 		$res = json_decode ($result, true);
 		if ($res['status'] === 'okay' && $res['email'] === $this->view->conf->mailLogin ()) {
-			Session::_param ('mail', $res['email']);
+			Minz_Session::_param ('mail', $res['email']);
 			invalidateHttpCache();
 		} else {
 			$res = array ();
 			$res['status'] = 'failure';
-			$res['reason'] = Translate::t ('invalid_login');
+			$res['reason'] = Minz_Translate::t ('invalid_login');
 		}
 
 		header('Content-Type: application/json; charset=UTF-8');
@@ -267,7 +267,7 @@ class indexController extends ActionController {
 
 	public function logoutAction () {
 		$this->view->_useLayout (false);
-		Session::_param ('mail');
+		Minz_Session::_param ('mail');
 		invalidateHttpCache();
 	}
 }

+ 2 - 2
app/controllers/javascriptController.php

@@ -1,13 +1,13 @@
 <?php
 
-class javascriptController extends ActionController {
+class FreshRSS_javascript_Controller extends Minz_ActionController {
 	public function firstAction () {
 		$this->view->_useLayout (false);
 		header('Content-type: text/javascript');
 	}
 
 	public function actualizeAction () {
-		$feedDAO = new FeedDAO ();
+		$feedDAO = new FreshRSS_FeedDAO ();
 		$this->view->feeds = $feedDAO->listFeeds ();
 	}
 }

+ 7 - 7
app/layout/aside_configure.phtml

@@ -1,13 +1,13 @@
 <div class="nav nav-list aside">
-	<li class="nav-header"><?php echo Translate::t ('configuration'); ?></li>
+	<li class="nav-header"><?php echo Minz_Translate::t ('configuration'); ?></li>
 
-	<li class="item<?php echo Request::actionName () == 'display' ? ' active' : ''; ?>">
-		<a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Translate::t ('general_and_reading'); ?></a>
+	<li class="item<?php echo Minz_Request::actionName () == 'display' ? ' active' : ''; ?>">
+		<a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('general_and_reading'); ?></a>
 	</li>
-	<li class="item<?php echo Request::actionName () == 'sharing' ? ' active' : ''; ?>">
-		<a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Translate::t ('sharing'); ?></a>
+	<li class="item<?php echo Minz_Request::actionName () == 'sharing' ? ' active' : ''; ?>">
+		<a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a>
 	</li>
-	<li class="item<?php echo Request::actionName () == 'shortcut' ? ' active' : ''; ?>">
-		<a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Translate::t ('shortcuts'); ?></a>
+	<li class="item<?php echo Minz_Request::actionName () == 'shortcut' ? ' active' : ''; ?>">
+		<a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a>
 	</li>
 </div>

+ 14 - 14
app/layout/aside_feed.phtml

@@ -1,17 +1,17 @@
 <ul class="nav nav-list aside aside_feed">
-	<li class="nav-header"><?php echo Translate::t ('your_rss_feeds'); ?></li>
+	<li class="nav-header"><?php echo Minz_Translate::t ('your_rss_feeds'); ?></li>
 
-	<li class="nav-form"><form id="add_rss" method="post" action="<?php echo Url::display (array ('c' => 'feed', 'a' => 'add')); ?>">
+	<li class="nav-form"><form id="add_rss" method="post" action="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'add')); ?>">
 		<div class="stick">
-			<input type="url" name="url_rss" placeholder="<?php echo Translate::t ('add_rss_feed'); ?>" />
+			<input type="url" name="url_rss" placeholder="<?php echo Minz_Translate::t ('add_rss_feed'); ?>" />
 			<div class="dropdown">
 				<div id="dropdown-cat" class="dropdown-target"></div>
 
-				<a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo RSSThemes::icon('down'); ?></a>
+				<a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo FreshRSS_Themes::icon('down'); ?></a>
 				<ul class="dropdown-menu">
 					<li class="dropdown-close"><a href="#close">❌</a></li>
 
-					<li class="dropdown-header"><?php echo Translate::t ('category'); ?></li>
+					<li class="dropdown-header"><?php echo Minz_Translate::t ('category'); ?></li>
 
 					<li class="input">
 						<select name="category" id="category">
@@ -25,25 +25,25 @@
 
 					<li class="separator"></li>
 
-					<li class="dropdown-header"><?php echo Translate::t ('http_authentication'); ?></li>
+					<li class="dropdown-header"><?php echo Minz_Translate::t ('http_authentication'); ?></li>
 					<li class="input">
-						<input type="text" name="username" id="username" placeholder="<?php echo Translate::t ('username'); ?>" />
+						<input type="text" name="username" id="username" placeholder="<?php echo Minz_Translate::t ('username'); ?>" />
 					</li>
 					<li class="input">
-						<input type="password" name="password" id="password" placeholder="<?php echo Translate::t ('password'); ?>" />
+						<input type="password" name="password" id="password" placeholder="<?php echo Minz_Translate::t ('password'); ?>" />
 					</li>
 				</ul>
 			</div>
-			<button class="btn" type="submit"><?php echo RSSThemes::icon('add'); ?></button>
+			<button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('add'); ?></button>
 		</div>
 	</form></li>
 
-	<li class="item<?php echo Request::actionName () == 'importExport' ? ' active' : ''; ?>">
-		<a href="<?php echo _url ('configure', 'importExport'); ?>"><?php echo Translate::t ('import_export_opml'); ?></a>
+	<li class="item<?php echo Minz_Request::actionName () == 'importExport' ? ' active' : ''; ?>">
+		<a href="<?php echo _url ('configure', 'importExport'); ?>"><?php echo Minz_Translate::t ('import_export_opml'); ?></a>
 	</li>
 
-	<li class="item<?php echo Request::actionName () == 'categorize' ? ' active' : ''; ?>">
-		<a href="<?php echo _url ('configure', 'categorize'); ?>"><?php echo Translate::t ('categories_management'); ?></a>
+	<li class="item<?php echo Minz_Request::actionName () == 'categorize' ? ' active' : ''; ?>">
+		<a href="<?php echo _url ('configure', 'categorize'); ?>"><?php echo Minz_Translate::t ('categories_management'); ?></a>
 	</li>
 
 	<li class="separator"></li>
@@ -59,6 +59,6 @@
 	</li>
 	<?php } ?>
 	<?php } else { ?>
-	<li class="item disable"><?php echo Translate::t ('no_rss_feed'); ?></li>
+	<li class="item disable"><?php echo Minz_Translate::t ('no_rss_feed'); ?></li>
 	<?php } ?>
 </ul>

+ 15 - 15
app/layout/aside_flux.phtml

@@ -1,23 +1,23 @@
 <div class="aside aside_flux" id="aside_flux">
-	<a class="toggle_aside" href="#close"><?php echo RSSThemes::icon('close'); ?></a>
+	<a class="toggle_aside" href="#close"><?php echo FreshRSS_Themes::icon('close'); ?></a>
 
 	<ul class="categories">
 		<?php if (!login_is_conf ($this->conf) || is_logged ()) { ?>
 		<li>
 			<div class="stick">
-				<a class="btn btn-important" href="<?php echo _url ('configure', 'feed'); ?>"><?php echo Translate::t ('subscription_management'); ?></a>
-				<a class="btn btn-important" href="<?php echo _url ('configure', 'categorize'); ?>" title="<?php echo Translate::t ('categories_management'); ?>"><?php echo RSSThemes::icon('category-white'); ?></a>
+				<a class="btn btn-important" href="<?php echo _url ('configure', 'feed'); ?>"><?php echo Minz_Translate::t ('subscription_management'); ?></a>
+				<a class="btn btn-important" href="<?php echo _url ('configure', 'categorize'); ?>" title="<?php echo Minz_Translate::t ('categories_management'); ?>"><?php echo FreshRSS_Themes::icon('category-white'); ?></a>
 			</div>
 		</li>
 		<?php } elseif (login_is_conf ($this->conf)) { ?>
-		<li><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Translate::t ('about_freshrss'); ?></a></li>
+		<li><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></li>
 		<?php } ?>
 
 		<li>
 			<div class="category all">
 				<a data-unread="<?php echo $this->nb_not_read; ?>" class="btn<?php echo $this->get_c == 'a' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index'); ?>">
-					<?php echo RSSThemes::icon('all'); ?>
-					<?php echo Translate::t ('all_feeds'); ?>
+					<?php echo FreshRSS_Themes::icon('all'); ?>
+					<?php echo Minz_Translate::t ('all_feeds'); ?>
 				</a>
 			</div>
 		</li>
@@ -25,8 +25,8 @@
 		<li>
 			<div class="category favorites">
 				<a data-unread="<?php echo $this->nb_favorites['unread']; ?>" class="btn<?php echo $this->get_c == 's' ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 's'); ?>">
-					<?php echo RSSThemes::icon('bookmark'); ?>
-					<?php echo Translate::t ('favorite_feeds', $this->nb_favorites['all']); ?>
+					<?php echo FreshRSS_Themes::icon('bookmark'); ?>
+					<?php echo Minz_Translate::t ('favorite_feeds', $this->nb_favorites['all']); ?>
 				</a>
 			</div>
 		</li>
@@ -38,7 +38,7 @@
 			<?php $c_active = false; if ($this->get_c == $cat->id ()) { $c_active = true; } ?>
 			<div class="category stick<?php echo $c_active ? ' active' : ''; ?>">
 				<a data-unread="<?php echo $cat->nbNotRead (); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id ()); ?>"><?php echo $cat->name (); ?></a>
-				<a class="btn dropdown-toggle" href="#"><?php echo RSSThemes::icon($c_active ? 'up' : 'down'); ?></a>
+				<a class="btn dropdown-toggle" href="#"><?php echo FreshRSS_Themes::icon($c_active ? 'up' : 'down'); ?></a>
 			</div>
 
 			<ul class="feeds<?php echo $c_active ? ' active' : ''; ?>">
@@ -49,7 +49,7 @@
 				<li id="f_<?php echo $feed_id; ?>" class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>">
 					<div class="dropdown">
 						<div class="dropdown-target"></div>
-						<a class="dropdown-toggle" data-fweb="<?php echo $feed->website (); ?>"><?php echo RSSThemes::icon('configure'); ?></a>
+						<a class="dropdown-toggle" data-fweb="<?php echo $feed->website (); ?>"><?php echo FreshRSS_Themes::icon('configure'); ?></a>
 <?php /* feed_config_template */ ?>
 					</div>
 					<img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" />
@@ -67,13 +67,13 @@
 <script id="feed_config_template" type="text/html">
 	<ul class="dropdown-menu">
 		<li class="dropdown-close"><a href="#close">❌</a></li>
-		<li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo Translate::t ('filter'); ?></a></li>
-		<li class="item"><a target="_blank" href="http://example.net/"><?php echo Translate::t ('see_website'); ?></a></li>
+		<li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('filter'); ?></a></li>
+		<li class="item"><a target="_blank" href="http://example.net/"><?php echo Minz_Translate::t ('see_website'); ?></a></li>
 		<?php if (!login_is_conf ($this->conf) || is_logged ()) { ?>
 		<li class="separator"></li>
-		<li class="item"><a href="<?php echo _url ('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo Translate::t ('administration'); ?></a></li>
-		<li class="item"><a href="<?php echo _url ('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo Translate::t ('actualize'); ?></a></li>
-		<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', 'f_!!!!!!'); ?>"><?php echo Translate::t ('mark_read'); ?></a></li>
+		<li class="item"><a href="<?php echo _url ('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('administration'); ?></a></li>
+		<li class="item"><a href="<?php echo _url ('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('actualize'); ?></a></li>
+		<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a></li>
 		<?php } ?>
 	</ul>
 </script>

+ 19 - 19
app/layout/header.phtml

@@ -1,9 +1,9 @@
 <?php if (login_is_conf ($this->conf)) { ?>
 <ul class="nav nav-head nav-login">
 	<?php if (!is_logged ()) { ?>
-	<li class="item"><?php echo RSSThemes::icon('login'); ?> <a class="signin" href="#"><?php echo Translate::t ('login'); ?></a></li>
+	<li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li>
 	<?php } else { ?>
-	<li class="item"><?php echo RSSThemes::icon('logout'); ?> <a class="signout" href="#"><?php echo Translate::t ('logout'); ?></a></li>
+	<li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="#"><?php echo Minz_Translate::t ('logout'); ?></a></li>
 	<?php } ?>
 </ul>
 <?php } ?>
@@ -12,8 +12,8 @@
 	<div class="item title">
 		<h1>
 			<a href="<?php echo _url ('index', 'index'); ?>">
-				<img class="logo" src="<?php echo Url::display ('/themes/icons/icon.svg'); ?>" alt="⊚" />
-				<?php echo Configuration::title (); ?>
+				<img class="logo" src="<?php echo Minz_Url::display ('/themes/icons/icon.svg'); ?>" alt="⊚" />
+				<?php echo Minz_Configuration::title (); ?>
 			</a>
 		</h1>
 	</div>
@@ -24,25 +24,25 @@
 		         $this->conf->anonAccess() == 'yes') { ?>
 		<form action="<?php echo _url ('index', 'index'); ?>" method="get">
 			<div class="stick">
-				<?php $search = Request::param ('search', ''); ?>
-				<input type="search" name="search" id="search" value="<?php echo $search; ?>" placeholder="<?php echo Translate::t ('search'); ?>" />
+				<?php $search = Minz_Request::param ('search', ''); ?>
+				<input type="search" name="search" id="search" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search'); ?>" />
 
-				<?php $get = Request::param ('get', ''); ?>
+				<?php $get = Minz_Request::param ('get', ''); ?>
 				<?php if($get != '') { ?>
 				<input type="hidden" name="get" value="<?php echo $get; ?>" />
 				<?php } ?>
 
-				<?php $order = Request::param ('order', ''); ?>
+				<?php $order = Minz_Request::param ('order', ''); ?>
 				<?php if($order != '') { ?>
 				<input type="hidden" name="order" value="<?php echo $order; ?>" />
 				<?php } ?>
 
-				<?php $state = Request::param ('state', ''); ?>
+				<?php $state = Minz_Request::param ('state', ''); ?>
 				<?php if($state != '') { ?>
 				<input type="hidden" name="state" value="<?php echo $state; ?>" />
 				<?php } ?>
 
-				<button class="btn" type="submit"><?php echo RSSThemes::icon('search'); ?></button>
+				<button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('search'); ?></button>
 			</div>
 		</form>
 		<?php } ?>
@@ -53,19 +53,19 @@
 		<div class="dropdown">
 			<div id="dropdown-configure" class="dropdown-target"></div>
 
-			<a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo RSSThemes::icon('configure'); ?></a>
+			<a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo FreshRSS_Themes::icon('configure'); ?></a>
 			<ul class="dropdown-menu">
 				<li class="dropdown-close"><a href="#close">❌</a></li>
-				<li class="dropdown-header"><?php echo Translate::t ('configuration'); ?></li>
-				<li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Translate::t ('general_and_reading'); ?></a></li>
-				<li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Translate::t ('sharing'); ?></a></li>
-				<li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Translate::t ('shortcuts'); ?></a></li>
+				<li class="dropdown-header"><?php echo Minz_Translate::t ('configuration'); ?></li>
+				<li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('general_and_reading'); ?></a></li>
+				<li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a></li>
+				<li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a></li>
 				<li class="separator"></li>
-				<li class="item"><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Translate::t ('about'); ?></a></li>
-				<li class="item"><a href="<?php echo _url ('index', 'logs'); ?>"><?php echo Translate::t ('logs'); ?></a></li>
+				<li class="item"><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about'); ?></a></li>
+				<li class="item"><a href="<?php echo _url ('index', 'logs'); ?>"><?php echo Minz_Translate::t ('logs'); ?></a></li>
 				<?php if (login_is_conf ($this->conf) && is_logged ()) { ?>
 				<li class="separator"></li>
-				<li class="item"><a class="signout" href="#"><?php echo RSSThemes::icon('logout'); ?> <?php echo Translate::t ('logout'); ?></a></li>
+				<li class="item"><a class="signout" href="#"><?php echo FreshRSS_Themes::icon('logout'); ?> <?php echo Minz_Translate::t ('logout'); ?></a></li>
 				<?php } ?>
 			</ul>
 		</div>
@@ -74,7 +74,7 @@
 
 	if (login_is_conf ($this->conf) && !is_logged ()) { ?>
 	<div class="item configure">
-		<?php echo RSSThemes::icon('login'); ?> <a class="signin" href="#"><?php echo Translate::t ('login'); ?></a>
+		<?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a>
 	</div>
 	<?php } ?>
 </div>

+ 9 - 9
app/layout/layout.phtml

@@ -11,19 +11,19 @@
 		//]]></script>
 <?php
 	if (!empty($this->nextId)) {
-		$params = Request::params ();
+		$params = Minz_Request::params ();
 		$params['next'] = $this->nextId;
 ?>
-		<link id="prefetch" rel="next prefetch" href="<?php echo Url::display (array ('c' => Request::controllerName (), 'a' => Request::actionName (), 'params' => $params)); ?>" />
+		<link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display (array ('c' => Minz_Request::controllerName (), 'a' => Minz_Request::actionName (), 'params' => $params)); ?>" />
 <?php } ?>
-		<link rel="icon" href="<?php echo Url::display ('/favicon.ico'); ?>" />
+		<link rel="icon" href="<?php echo Minz_Url::display ('/favicon.ico'); ?>" />
 <?php if (isset ($this->rss_url)) { ?>
-		<link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Url::display ($this->rss_url); ?>" />
+		<link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display ($this->rss_url); ?>" />
 <?php } ?>
-		<link rel="prefetch" href="<?php echo RSSThemes::icon('starred', true); ?>">
-		<link rel="prefetch" href="<?php echo RSSThemes::icon('non-starred', true); ?>">
-		<link rel="prefetch" href="<?php echo RSSThemes::icon('read', true); ?>">
-		<link rel="prefetch" href="<?php echo RSSThemes::icon('unread', true); ?>">
+		<link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>">
+		<link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>">
+		<link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('read', true); ?>">
+		<link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('unread', true); ?>">
 		<meta name="robots" content="noindex,nofollow" />
 	</head>
 	<body>
@@ -39,7 +39,7 @@
 ?>
 <div class="notification <?php echo $this->notification['type']; ?>">
 	<?php echo $this->notification['content']; ?>
-	<a class="close" href=""><?php echo RSSThemes::icon('close'); ?></a>
+	<a class="close" href=""><?php echo FreshRSS_Themes::icon('close'); ?></a>
 </div>
 <?php } ?>
 	</body>

+ 3 - 3
app/layout/nav_entries.phtml

@@ -1,5 +1,5 @@
 <ul id="nav_entries">
-	<li class="item"><a class="previous_entry" href="#"><?php echo RSSThemes::icon('prev'); ?></a></li>
-	<li class="item"><a class="up" href="#"><?php echo RSSThemes::icon('up'); ?></a></li>
-	<li class="item"><a class="next_entry" href="#"><?php echo RSSThemes::icon('next'); ?></a></li>
+	<li class="item"><a class="previous_entry" href="#"><?php echo FreshRSS_Themes::icon('prev'); ?></a></li>
+	<li class="item"><a class="up" href="#"><?php echo FreshRSS_Themes::icon('up'); ?></a></li>
+	<li class="item"><a class="next_entry" href="#"><?php echo FreshRSS_Themes::icon('next'); ?></a></li>
 </ul>

+ 34 - 34
app/layout/nav_menu.phtml

@@ -1,22 +1,22 @@
 <div class="nav_menu">
-	<a class="btn toggle_aside" href="#aside_flux"><?php echo RSSThemes::icon('category'); ?></a>
+	<a class="btn toggle_aside" href="#aside_flux"><?php echo FreshRSS_Themes::icon('category'); ?></a>
 
 	<?php if (!login_is_conf ($this->conf) || is_logged ()) { ?>
-	<a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo RSSThemes::icon('refresh'); ?></a>
+	<a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a>
 
 	<?php
 		$get = false;
-		$string_mark = Translate::t ('mark_all_read');
+		$string_mark = Minz_Translate::t ('mark_all_read');
 		if ($this->get_f) {
 			$get = 'f_' . $this->get_f;
-			$string_mark = Translate::t ('mark_feed_read');
+			$string_mark = Minz_Translate::t ('mark_feed_read');
 		} elseif ($this->get_c && $this->get_c != 'a') {
 			if ($this->get_c === 's') {
 				$get = 's';
 			} else {
 				$get = 'c_' . $this->get_c;
 			}
-			$string_mark = Translate::t ('mark_cat_read');
+			$string_mark = Minz_Translate::t ('mark_cat_read');
 		}
 		$nextGet = $get;
 		if (($this->conf->onread_jump_next () === 'yes') && (strlen ($get) > 2)) {
@@ -57,15 +57,15 @@
 		$p = isset($this->entries[0]) ? $this->entries[0] : null;
 		$idMax = $p === null ? '0' : $p->id();
 		$markReadUrl = _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet, 'idMax', $idMax);
-		Session::_param ('markReadUrl', $markReadUrl);
+		Minz_Session::_param ('markReadUrl', $markReadUrl);
 	?>
 
 	<div class="stick" id="nav_menu_read_all">
-		<a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Translate::t ('mark_read'); ?></a>
+		<a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a>
 		<div class="dropdown">
 			<div id="dropdown-read" class="dropdown-target"></div>
 
-			<a class="dropdown-toggle btn" href="#dropdown-read"><?php echo RSSThemes::icon('down'); ?></a>
+			<a class="dropdown-toggle btn" href="#dropdown-read"><?php echo FreshRSS_Themes::icon('down'); ?></a>
 			<ul class="dropdown-menu">
 				<li class="dropdown-close"><a href="#close">❌</a></li>
 
@@ -75,15 +75,15 @@
 	$today = @strtotime('today');
 	$one_week = $today - 604800;
 ?>
-				<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $today . '000000'); ?>"><?php echo Translate::t ('before_one_day'); ?></a></li>
-				<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $one_week . '000000'); ?>"><?php echo Translate::t ('before_one_week'); ?></a></li>
+				<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $today . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_day'); ?></a></li>
+				<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $one_week . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_week'); ?></a></li>
 			</ul>
 		</div>
 	</div>
 	<?php } ?>
 
 	<?php
-		$params = Request::params ();
+		$params = Minz_Request::params ();
 		if (isset ($params['search'])) {
 			$params['search'] = urlencode ($params['search']);
 		}
@@ -95,33 +95,33 @@
 	?>
 	<div class="dropdown" id="nav_menu_views">
 		<div id="dropdown-views" class="dropdown-target"></div>
-		<a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Translate::t ('display'); ?> <?php echo RSSThemes::icon('down'); ?></a>
+		<a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a>
 		<ul class="dropdown-menu">
 			<li class="dropdown-close"><a href="#close">❌</a></li>
 
 			<?php
 				$url_output = $url;
-				$actual_view = Request::param('output', 'normal');
+				$actual_view = Minz_Request::param('output', 'normal');
 			?>
 			<?php if($actual_view != 'normal') { ?>
 			<li class="item">
 				<?php $url_output['params']['output'] = 'normal'; ?>
-				<a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
-					<?php echo Translate::t ('normal_view'); ?>
+				<a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
+					<?php echo Minz_Translate::t ('normal_view'); ?>
 				</a>
 			</li>
 			<?php } if($actual_view != 'reader') { ?>
 			<li class="item">
 				<?php $url_output['params']['output'] = 'reader'; ?>
-				<a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
-					<?php echo Translate::t ('reader_view'); ?>
+				<a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
+					<?php echo Minz_Translate::t ('reader_view'); ?>
 				</a>
 			</li>
 			<?php } if($actual_view != 'global') { ?>
 			<li class="item">
 				<?php $url_output['params']['output'] = 'global'; ?>
-				<a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
-					<?php echo Translate::t ('global_view'); ?>
+				<a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
+					<?php echo Minz_Translate::t ('global_view'); ?>
 				</a>
 			</li>
 			<?php } ?>
@@ -134,15 +134,15 @@
 					if ($this->state == 'not_read') {
 						$url_state['params']['state'] = 'all';
 				?>
-				<a class="print_all" href="<?php echo Url::display ($url_state); ?>">
-					<?php echo Translate::t ('show_all_articles'); ?>
+				<a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>">
+					<?php echo Minz_Translate::t ('show_all_articles'); ?>
 				</a>
 				<?php
 					} else {
 						$url_state['params']['state'] = 'not_read';
 				?>
-				<a class="print_non_read" href="<?php echo Url::display ($url_state); ?>">
-					<?php echo Translate::t ('show_not_reads'); ?>
+				<a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>">
+					<?php echo Minz_Translate::t ('show_not_reads'); ?>
 				</a>
 				<?php } ?>
 			</li>
@@ -153,15 +153,15 @@
 					if ($this->order === 'DESC') {
 						$url_order['params']['order'] = 'ASC';
 				?>
-				<a href="<?php echo Url::display ($url_order); ?>">
-					<?php echo Translate::t ('older_first'); ?>
+				<a href="<?php echo Minz_Url::display ($url_order); ?>">
+					<?php echo Minz_Translate::t ('older_first'); ?>
 				</a>
 				<?php
 					} else {
 						$url_order['params']['order'] = 'DESC';
 				?>
-				<a href="<?php echo Url::display ($url_order); ?>">
-					<?php echo Translate::t ('newer_first'); ?>
+				<a href="<?php echo Minz_Url::display ($url_order); ?>">
+					<?php echo Minz_Translate::t ('newer_first'); ?>
 				</a>
 				<?php } ?>
 			</li>
@@ -169,8 +169,8 @@
 			<li class="separator"></li>
 
 			<li class="item">
-				<a class="view_rss" target="_blank" href="<?php echo Url::display ($this->rss_url); ?>">
-					<?php echo Translate::t ('rss_view'); ?>
+				<a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>">
+					<?php echo Minz_Translate::t ('rss_view'); ?>
 				</a>
 			</li>
 		</ul>
@@ -178,20 +178,20 @@
 
 	<div class="item search">
 		<form action="<?php echo _url ('index', 'index'); ?>" method="get">
-			<?php $search = Request::param ('search', ''); ?>
-			<input type="search" name="search" value="<?php echo $search; ?>" placeholder="<?php echo Translate::t ('search_short'); ?>" />
+			<?php $search = Minz_Request::param ('search', ''); ?>
+			<input type="search" name="search" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search_short'); ?>" />
 
-			<?php $get = Request::param ('get', ''); ?>
+			<?php $get = Minz_Request::param ('get', ''); ?>
 			<?php if($get != '') { ?>
 			<input type="hidden" name="get" value="<?php echo $get; ?>" />
 			<?php } ?>
 
-			<?php $order = Request::param ('order', ''); ?>
+			<?php $order = Minz_Request::param ('order', ''); ?>
 			<?php if($order != '') { ?>
 			<input type="hidden" name="order" value="<?php echo $order; ?>" />
 			<?php } ?>
 
-			<?php $state = Request::param ('state', ''); ?>
+			<?php $state = Minz_Request::param ('state', ''); ?>
 			<?php if($state != '') { ?>
 			<input type="hidden" name="state" value="<?php echo $state; ?>" />
 			<?php } ?>

+ 4 - 256
app/models/Category.php

@@ -1,6 +1,6 @@
 <?php
 
-class Category extends Model {
+class FreshRSS_Category extends Minz_Model {
 	private $id = 0;
 	private $name;
 	private $color;
@@ -33,7 +33,7 @@ class Category extends Model {
 	}
 	public function nbFeed () {
 		if ($this->nbFeed < 0) {
-			$catDAO = new CategoryDAO ();
+			$catDAO = new FreshRSS_CategoryDAO ();
 			$this->nbFeed = $catDAO->countFeed ($this->id ());
 		}
 
@@ -41,7 +41,7 @@ class Category extends Model {
 	}
 	public function nbNotRead () {
 		if ($this->nbNotRead < 0) {
-			$catDAO = new CategoryDAO ();
+			$catDAO = new FreshRSS_CategoryDAO ();
 			$this->nbNotRead = $catDAO->countNotRead ($this->id ());
 		}
 
@@ -49,7 +49,7 @@ class Category extends Model {
 	}
 	public function feeds () {
 		if (is_null ($this->feeds)) {
-			$feedDAO = new FeedDAO ();
+			$feedDAO = new FreshRSS_FeedDAO ();
 			$this->feeds = $feedDAO->listByCategory ($this->id ());
 			$this->nbFeed = 0;
 			$this->nbNotRead = 0;
@@ -83,255 +83,3 @@ class Category extends Model {
 		$this->feeds = $values;
 	}
 }
-
-class CategoryDAO extends Model_pdo {
-	public function addCategory ($valuesTmp) {
-		$sql = 'INSERT INTO `' . $this->prefix . 'category` (name, color) VALUES(?, ?)';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			substr($valuesTmp['name'], 0, 255),
-			substr($valuesTmp['color'], 0, 7),
-		);
-
-		if ($stm && $stm->execute ($values)) {
-			return $this->bd->lastInsertId();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function updateCategory ($id, $valuesTmp) {
-		$sql = 'UPDATE `' . $this->prefix . 'category` SET name=?, color=? WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			$valuesTmp['name'],
-			$valuesTmp['color'],
-			$id
-		);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function deleteCategory ($id) {
-		$sql = 'DELETE FROM `' . $this->prefix . 'category` WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($id);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function searchById ($id) {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($id);
-
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$cat = HelperCategory::daoToCategory ($res);
-
-		if (isset ($cat[0])) {
-			return $cat[0];
-		} else {
-			return false;
-		}
-	}
-	public function searchByName ($name) {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE name=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($name);
-
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$cat = HelperCategory::daoToCategory ($res);
-
-		if (isset ($cat[0])) {
-			return $cat[0];
-		} else {
-			return false;
-		}
-	}
-
-	public function listCategories ($prePopulateFeeds = true, $details = false) {
-		if ($prePopulateFeeds) {
-			$sql = 'SELECT c.id AS c_id, c.name AS c_name, '
-			     . ($details ? 'c.color AS c_color, ' : '')
-			     . ($details ? 'f.* ' : 'f.id, f.name, f.website, f.priority, f.error, f.cache_nbEntries, f.cache_nbUnreads ')
-			     . 'FROM `' . $this->prefix . 'category` c '
-			     . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category = c.id '
-			     . 'GROUP BY f.id '
-			     . 'ORDER BY c.name, f.name';
-			$stm = $this->bd->prepare ($sql);
-			$stm->execute ();
-			return HelperCategory::daoToCategoryPrepopulated ($stm->fetchAll (PDO::FETCH_ASSOC));
-		} else {
-			$sql = 'SELECT * FROM `' . $this->prefix . 'category` ORDER BY name';
-			$stm = $this->bd->prepare ($sql);
-			$stm->execute ();
-			return HelperCategory::daoToCategory ($stm->fetchAll (PDO::FETCH_ASSOC));
-		}
-	}
-
-	public function getDefault () {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=1';
-		$stm = $this->bd->prepare ($sql);
-
-		$stm->execute ();
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$cat = HelperCategory::daoToCategory ($res);
-
-		if (isset ($cat[0])) {
-			return $cat[0];
-		} else {
-			return false;
-		}
-	}
-	public function checkDefault () {
-		$def_cat = $this->searchById (1);
-
-		if ($def_cat === false) {
-			$cat = new Category (Translate::t ('default_category'));
-			$cat->_id (1);
-
-			$values = array (
-				'id' => $cat->id (),
-				'name' => $cat->name (),
-				'color' => $cat->color ()
-			);
-
-			$this->addCategory ($values);
-		}
-	}
-
-	public function count () {
-		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'category`';
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-
-		return $res[0]['count'];
-	}
-
-	public function countFeed ($id) {
-		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'feed` WHERE category=?';
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-
-		return $res[0]['count'];
-	}
-
-	public function countNotRead ($id) {
-		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE category=? AND e.is_read=0';
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-
-		return $res[0]['count'];
-	}
-}
-
-class HelperCategory {
-	public static function findFeed($categories, $feed_id) {
-		foreach ($categories as $category) {
-			foreach ($category->feeds () as $feed) {
-				if ($feed->id () === $feed_id) {
-					return $feed;
-				}
-			}
-		}
-		return null;
-	}
-
-	public static function CountUnreads($categories, $minPriority = 0) {
-		$n = 0;
-		foreach ($categories as $category) {
-			foreach ($category->feeds () as $feed) {
-				if ($feed->priority () >= $minPriority) {
-					$n += $feed->nbNotRead();
-				}
-			}
-		}
-		return $n;
-	}
-
-	public static function daoToCategoryPrepopulated ($listDAO) {
-		$list = array ();
-
-		if (!is_array ($listDAO)) {
-			$listDAO = array ($listDAO);
-		}
-
-		$previousLine = null;
-		$feedsDao = array();
-		foreach ($listDAO as $line) {
-			if ($previousLine['c_id'] != null && $line['c_id'] !== $previousLine['c_id']) {
-				// End of the current category, we add it to the $list
-				$cat = new Category (
-					$previousLine['c_name'],
-					isset($previousLine['c_color']) ? $previousLine['c_color'] : '',
-					HelperFeed::daoToFeed ($feedsDao, $previousLine['c_id'])
-				);
-				$cat->_id ($previousLine['c_id']);
-				$list[$previousLine['c_id']] = $cat;
-
-				$feedsDao = array();	//Prepare for next category
-			}
-
-			$previousLine = $line;
-			$feedsDao[] = $line;
-		}
-
-		// add the last category
-		if ($previousLine != null) {
-			$cat = new Category (
-				$previousLine['c_name'],
-				isset($previousLine['c_color']) ? $previousLine['c_color'] : '',
-				HelperFeed::daoToFeed ($feedsDao, $previousLine['c_id'])
-			);
-			$cat->_id ($previousLine['c_id']);
-			$list[$previousLine['c_id']] = $cat;
-		}
-
-		return $list;
-	}
-
-	public static function daoToCategory ($listDAO) {
-		$list = array ();
-
-		if (!is_array ($listDAO)) {
-			$listDAO = array ($listDAO);
-		}
-
-		foreach ($listDAO as $key => $dao) {
-			$cat = new Category (
-				$dao['name'],
-				$dao['color']
-			);
-			$cat->_id ($dao['id']);
-			$list[$key] = $cat;
-		}
-
-		return $list;
-	}
-}

+ 1 - 1
app/models/Days.php

@@ -1,6 +1,6 @@
 <?php
 
-class Days {
+class FreshRSS_Days {
 	const TODAY = 0;
 	const YESTERDAY = 1;
 	const BEFORE_YESTERDAY = 2;

+ 6 - 432
app/models/Entry.php

@@ -1,6 +1,5 @@
 <?php
-
-class Entry extends Model {
+class FreshRSS_Entry extends Minz_Model {
 
 	private $id = 0;
 	private $guid;
@@ -73,7 +72,7 @@ class Entry extends Model {
 	}
 	public function feed ($object = false) {
 		if ($object) {
-			$feedDAO = new FeedDAO ();
+			$feedDAO = new FreshRSS_FeedDAO ();
 			return $feedDAO->searchById ($this->feed);
 		} else {
 			return $this->feed;
@@ -140,13 +139,13 @@ class Entry extends Model {
 		$today = @strtotime('today');
 		$yesterday = $today - 86400;
 
-		if ($day === Days::TODAY &&
+		if ($day === FreshRSS_Days::TODAY &&
 		    $date >= $today && $date < $today + 86400) {
 			return true;
-		} elseif ($day === Days::YESTERDAY &&
+		} elseif ($day === FreshRSS_Days::YESTERDAY &&
 		    $date >= $yesterday && $date < $yesterday + 86400) {
 			return true;
-		} elseif ($day === Days::BEFORE_YESTERDAY && $date < $yesterday) {
+		} elseif ($day === FreshRSS_Days::BEFORE_YESTERDAY && $date < $yesterday) {
 			return true;
 		} else {
 			return false;
@@ -157,7 +156,7 @@ class Entry extends Model {
 		// Gestion du contenu
 		// On cherche à récupérer les articles en entier... même si le flux ne le propose pas
 		if ($pathEntries) {
-			$entryDAO = new EntryDAO();
+			$entryDAO = new FreshRSS_EntryDAO();
 			$entry = $entryDAO->searchByGuid($this->feed, $this->guid);
 
 			if($entry) {
@@ -192,428 +191,3 @@ class Entry extends Model {
 		);
 	}
 }
-
-class EntryDAO extends Model_pdo {
-	public function addEntry ($valuesTmp) {
-		$sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, content_bin, link, date, is_read, is_favorite, id_feed, tags) '
-		     . 'VALUES(?, ?, ?, ?, COMPRESS(?), ?, ?, ?, ?, ?, ?)';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			$valuesTmp['id'],
-			substr($valuesTmp['guid'], 0, 760),
-			substr($valuesTmp['title'], 0, 255),
-			substr($valuesTmp['author'], 0, 255),
-			$valuesTmp['content'],
-			substr($valuesTmp['link'], 0, 1023),
-			$valuesTmp['date'],
-			$valuesTmp['is_read'],
-			$valuesTmp['is_favorite'],
-			$valuesTmp['id_feed'],
-			substr($valuesTmp['tags'], 0, 1023),
-		);
-
-		if ($stm && $stm->execute ($values)) {
-			return $this->bd->lastInsertId();
-		} else {
-			$info = $stm->errorInfo();
-			if ((int)($info[0] / 1000) !== 23) {	//Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries
-				Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
-				. ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::ERROR);
-			} /*else {
-				Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
-				. ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::DEBUG);
-			}*/
-			return false;
-		}
-	}
-
-	public function markFavorite ($id, $is_favorite = true) {
-		$sql = 'UPDATE `' . $this->prefix . 'entry` e '
-		     . 'SET e.is_favorite = ? '
-		     . 'WHERE e.id=?';
-		$values = array ($is_favorite ? 1 : 0, $id);
-		$stm = $this->bd->prepare ($sql);
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-	public function markRead ($id, $is_read = true) {
-		$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-		     . 'SET e.is_read = ?,'
-		     . 'f.cache_nbUnreads=f.cache_nbUnreads' . ($is_read ? '-' : '+') . '1 '
-		     . 'WHERE e.id=?';
-		$values = array ($is_read ? 1 : 0, $id);
-		$stm = $this->bd->prepare ($sql);
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-	public function markReadEntries ($idMax = 0, $favorites = false) {
-		if ($idMax === 0) {
-			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-			     . 'SET e.is_read = 1, f.cache_nbUnreads=0 '
-			     . 'WHERE e.is_read = 0 AND ';
-			if ($favorites) {
-				$sql .= 'e.is_favorite = 1';
-			} else {
-				$sql .= 'f.priority > 0';
-			}
-			$stm = $this->bd->prepare ($sql);
-			if ($stm && $stm->execute ()) {
-				return $stm->rowCount();
-			} else {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				return false;
-			}
-		} else {
-			$this->bd->beginTransaction ();
-
-			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-			     . 'SET e.is_read = 1 '
-			     . 'WHERE e.is_read = 0 AND e.id <= ? AND ';
-			if ($favorites) {
-				$sql .= 'e.is_favorite = 1';
-			} else {
-				$sql .= 'f.priority > 0';
-			}
-			$values = array ($idMax);
-			$stm = $this->bd->prepare ($sql);
-			if (!($stm && $stm->execute ($values))) {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				$this->bd->rollBack ();
-				return false;
-			}
-			$affected = $stm->rowCount();
-
-			if ($affected > 0) {
-				$sql = 'UPDATE `' . $this->prefix . 'feed` f '
-			     . 'LEFT OUTER JOIN ('
-			     .	'SELECT e.id_feed, '
-			     .	'COUNT(*) AS nbUnreads '
-			     .	'FROM `' . $this->prefix . 'entry` e '
-			     .	'WHERE e.is_read = 0 '
-			     .	'GROUP BY e.id_feed'
-			     . ') x ON x.id_feed=f.id '
-			     . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0)';
-				$stm = $this->bd->prepare ($sql);
-				if (!($stm && $stm->execute ())) {
-					$info = $stm->errorInfo();
-					Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-					$this->bd->rollBack ();
-					return false;
-				}
-			}
-
-			$this->bd->commit ();
-			return $affected;
-		}
-	}
-	public function markReadCat ($id, $idMax = 0) {
-		if ($idMax === 0) {
-			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-			     . 'SET e.is_read = 1, f.cache_nbUnreads=0 '
-			     . 'WHERE f.category = ? AND e.is_read = 0';
-			$values = array ($id);
-			$stm = $this->bd->prepare ($sql);
-			if ($stm && $stm->execute ($values)) {
-				return $stm->rowCount();
-			} else {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				return false;
-			}
-		} else {
-			$this->bd->beginTransaction ();
-
-			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-			     . 'SET e.is_read = 1 '
-			     . 'WHERE f.category = ? AND e.is_read = 0 AND e.id <= ?';
-			$values = array ($id, $idMax);
-			$stm = $this->bd->prepare ($sql);
-			if (!($stm && $stm->execute ($values))) {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				$this->bd->rollBack ();
-				return false;
-			}
-			$affected = $stm->rowCount();
-
-			if ($affected > 0) {
-				$sql = 'UPDATE `' . $this->prefix . 'feed` f '
-			     . 'LEFT OUTER JOIN ('
-			     .	'SELECT e.id_feed, '
-			     .	'COUNT(*) AS nbUnreads '
-			     .	'FROM `' . $this->prefix . 'entry` e '
-			     .	'WHERE e.is_read = 0 '
-			     .	'GROUP BY e.id_feed'
-			     . ') x ON x.id_feed=f.id '
-			     . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0) '
-			     . 'WHERE f.category = ?';
-				$values = array ($id);
-				$stm = $this->bd->prepare ($sql);
-				if (!($stm && $stm->execute ($values))) {
-					$info = $stm->errorInfo();
-					Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-					$this->bd->rollBack ();
-					return false;
-				}
-			}
-
-			$this->bd->commit ();
-			return $affected;
-		}
-	}
-	public function markReadFeed ($id, $idMax = 0) {
-		if ($idMax === 0) {
-			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-			     . 'SET e.is_read = 1, f.cache_nbUnreads=0 '
-			     . 'WHERE f.id=? AND e.is_read = 0';
-			$values = array ($id);
-			$stm = $this->bd->prepare ($sql);
-			if ($stm && $stm->execute ($values)) {
-				return $stm->rowCount();
-			} else {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				return false;
-			}
-		} else {
-			$this->bd->beginTransaction ();
-
-			$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-			     . 'SET e.is_read = 1 '
-			     . 'WHERE f.id=? AND e.is_read = 0 AND e.id <= ?';
-			$values = array ($id, $idMax);
-			$stm = $this->bd->prepare ($sql);
-			if (!($stm && $stm->execute ($values))) {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				$this->bd->rollBack ();
-				return false;
-			}
-			$affected = $stm->rowCount();
-
-			if ($affected > 0) {
-				$sql = 'UPDATE `' . $this->prefix . 'feed` f '
-				     . 'SET f.cache_nbUnreads=f.cache_nbUnreads-' . $affected
-				     . ' WHERE f.id=?';
-				$values = array ($id);
-				$stm = $this->bd->prepare ($sql);
-				if (!($stm && $stm->execute ($values))) {
-					$info = $stm->errorInfo();
-					Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-					$this->bd->rollBack ();
-					return false;
-				}
-			}
-
-			$this->bd->commit ();
-			return $affected;
-		}
-	}
-
-	public function searchByGuid ($feed_id, $id) {
-		// un guid est unique pour un flux donné
-		$sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags '
-		     . 'FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND guid=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			$feed_id,
-			$id
-		);
-
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$entries = HelperEntry::daoToEntry ($res);
-		return isset ($entries[0]) ? $entries[0] : false;
-	}
-
-	public function searchById ($id) {
-		$sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags '
-		     . 'FROM `' . $this->prefix . 'entry` WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($id);
-
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$entries = HelperEntry::daoToEntry ($res);
-		return isset ($entries[0]) ? $entries[0] : false;
-	}
-
-	public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = -1, $filter = '') {
-		$where = '';
-		$values = array();
-		switch ($type) {
-			case 'a':
-				$where .= 'priority > 0 ';
-				break;
-			case 's':
-				$where .= 'is_favorite = 1 ';
-				break;
-			case 'c':
-				$where .= 'category = ? ';
-				$values[] = intval($id);
-				break;
-			case 'f':
-				$where .= 'id_feed = ? ';
-				$values[] = intval($id);
-				break;
-			default:
-				throw new EntriesGetterException ('Bad type in Entry->listByType: [' . $type . ']!');
-		}
-		switch ($state) {
-			case 'all':
-				break;
-			case 'not_read':
-				$where .= 'AND is_read = 0 ';
-				break;
-			case 'read':
-				$where .= 'AND is_read = 1 ';
-				break;
-			default:
-				throw new EntriesGetterException ('Bad state in Entry->listByType: [' . $state . ']!');
-		}
-		switch ($order) {
-			case 'DESC':
-			case 'ASC':
-				break;
-			default:
-				throw new EntriesGetterException ('Bad order in Entry->listByType: [' . $order . ']!');
-		}
-		if ($firstId > 0) {
-			$where .= 'AND e.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' ';
-		}
-		$terms = array_unique(explode(' ', trim($filter)));
-		sort($terms);	//Put #tags first
-		$having = '';
-		foreach ($terms as $word) {
-			if (!empty($word)) {
-				if ($word[0] === '#' && isset($word[1])) {
-					$having .= 'AND tags LIKE ? ';
-					$values[] = '%' . $word .'%';
-				} elseif (!empty($word)) {
-					$having .= 'AND (e.title LIKE ? OR content LIKE ?) ';
-					$values[] = '%' . $word .'%';
-					$values[] = '%' . $word .'%';
-				}
-			}
-		}
-
-		$sql = 'SELECT e.id, e.guid, e.title, e.author, UNCOMPRESS(e.content_bin) AS content, e.link, e.date, e.is_read, e.is_favorite, e.id_feed, e.tags '
-		     . 'FROM `' . $this->prefix . 'entry` e '
-		     . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE ' . $where
-		     . (empty($having) ? '' : 'HAVING' . substr($having, 3))
-		     . 'ORDER BY e.id ' . $order;
-
-		if ($limit > 0) {
-			$sql .= ' LIMIT ' . $limit;	//TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/
-		}
-
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ($values);
-
-		return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
-	}
-
-	public function listLastGuidsByFeed($id, $n) {
-		$sql = 'SELECT guid FROM `' . $this->prefix . 'entry` WHERE id_feed=? ORDER BY id DESC LIMIT ' . intval($n);
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		$stm->execute ($values);
-		return $stm->fetchAll (PDO::FETCH_COLUMN, 0);
-	}
-
-	public function countUnreadRead () {
-		$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0'
-		     . ' UNION SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0 AND is_read = 0';
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
-		$all = empty($res[0]) ? 0 : $res[0];
-		$unread = empty($res[1]) ? 0 : $res[1];
-		return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread);
-	}
-	public function count ($minPriority = null) {
-		$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id';
-		if ($minPriority !== null) {
-			$sql = ' WHERE priority > ' . intval($minPriority);
-		}
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
-		return $res[0];
-	}
-	public function countNotRead ($minPriority = null) {
-		$sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE is_read = 0';
-		if ($minPriority !== null) {
-			$sql = ' AND priority > ' . intval($minPriority);
-		}
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
-		return $res[0];
-	}
-
-	public function countUnreadReadFavorites () {
-		$sql = 'SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1'
-		     . ' UNION SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 AND is_read = 0';
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-		$res = $stm->fetchAll (PDO::FETCH_COLUMN, 0);
-		$all = empty($res[0]) ? 0 : $res[0];
-		$unread = empty($res[1]) ? 0 : $res[1];
-		return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread);
-	}
-
-	public function optimizeTable() {
-		$sql = 'OPTIMIZE TABLE `' . $this->prefix . 'entry`';
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-	}
-}
-
-class HelperEntry {
-	public static function daoToEntry ($listDAO) {
-		$list = array ();
-
-		if (!is_array ($listDAO)) {
-			$listDAO = array ($listDAO);
-		}
-
-		foreach ($listDAO as $key => $dao) {
-			$entry = new Entry (
-				$dao['id_feed'],
-				$dao['guid'],
-				$dao['title'],
-				$dao['author'],
-				$dao['content'],
-				$dao['link'],
-				$dao['date'],
-				$dao['is_read'],
-				$dao['is_favorite'],
-				$dao['tags']
-			);
-			if (isset ($dao['id'])) {
-				$entry->_id ($dao['id']);
-			}
-			$list[] = $entry;
-		}
-
-		unset ($listDAO);
-
-		return $list;
-	}
-}

+ 0 - 19
app/models/Exception/FeedException.php

@@ -1,19 +0,0 @@
-<?php
-
-class FeedException extends Exception {
-	public function __construct ($message) {
-		parent::__construct ($message);
-	}
-}
-
-class BadUrlException extends FeedException {
-	public function __construct ($url) {
-		parent::__construct ('`' . $url . '` is not a valid URL');
-	}
-}
-
-class OpmlException extends FeedException {
-	public function __construct ($name_file) {
-		parent::__construct ('OPML file is invalid');
-	}
-}

+ 10 - 352
app/models/Feed.php

@@ -1,6 +1,5 @@
 <?php
-
-class Feed extends Model {
+class FreshRSS_Feed extends Minz_Model {
 	private $id = 0;
 	private $url;
 	private $category = 1;
@@ -81,7 +80,7 @@ class Feed extends Model {
 	}
 	public function nbEntries () {
 		if ($this->nbEntries < 0) {
-			$feedDAO = new FeedDAO ();
+			$feedDAO = new FreshRSS_FeedDAO ();
 			$this->nbEntries = $feedDAO->countEntries ($this->id ());
 		}
 
@@ -89,7 +88,7 @@ class Feed extends Model {
 	}
 	public function nbNotRead () {
 		if ($this->nbNotRead < 0) {
-			$feedDAO = new FeedDAO ();
+			$feedDAO = new FreshRSS_FeedDAO ();
 			$this->nbNotRead = $feedDAO->countNotRead ($this->id ());
 		}
 
@@ -111,7 +110,7 @@ class Feed extends Model {
 		@unlink($path . '.txt');
 	}
 	public function favicon () {
-		return Url::display ('/f.php?' . $this->id ());
+		return Minz_Url::display ('/f.php?' . $this->id ());
 	}
 
 	public function _id ($value) {
@@ -122,7 +121,7 @@ class Feed extends Model {
 			$value = checkUrl($value);
 		}
 		if (empty ($value)) {
-			throw new BadUrlException ($value);
+			throw new FreshRSS_BadUrl_Exception ($value);
 		}
 		$this->url = $value;
 	}
@@ -188,13 +187,13 @@ class Feed extends Model {
 	public function load () {
 		if (!is_null ($this->url)) {
 			if (CACHE_PATH === false) {
-				throw new FileNotExistException (
+				throw new Minz_FileNotExistException (
 					'CACHE_PATH',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			} else {
 				$feed = new SimplePie ();
-				$feed->set_useragent(Translate::t ('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION);
+				$feed->set_useragent(Minz_Translate::t ('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION);
 				$url = htmlspecialchars_decode ($this->url, ENT_QUOTES);
 				if ($this->httpAuth != '') {
 					$url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url);
@@ -244,7 +243,7 @@ class Feed extends Model {
 				$feed->init ();
 
 				if ($feed->error ()) {
-					throw new FeedException ($feed->error . ' [' . $url . ']');
+					throw new FreshRSS_Feed_Exception ($feed->error . ' [' . $url . ']');
 				}
 
 				// si on a utilisé l'auto-discover, notre url va avoir changé
@@ -299,7 +298,7 @@ class Feed extends Model {
 				}
 			}
 
-			$entry = new Entry (
+			$entry = new FreshRSS_Entry (
 				$this->id (),
 				$item->get_id (),
 				!is_null ($title) ? $title : '',
@@ -318,344 +317,3 @@ class Feed extends Model {
 		$this->entries = $entries;
 	}
 }
-
-class FeedDAO extends Model_pdo {
-	public function addFeed ($valuesTmp) {
-		$sql = 'INSERT INTO `' . $this->prefix . 'feed` (url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, 0)';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			substr($valuesTmp['url'], 0, 511),
-			$valuesTmp['category'],
-			substr($valuesTmp['name'], 0, 255),
-			substr($valuesTmp['website'], 0, 255),
-			substr($valuesTmp['description'], 0, 1023),
-			$valuesTmp['lastUpdate'],
-			base64_encode ($valuesTmp['httpAuth']),
-		);
-
-		if ($stm && $stm->execute ($values)) {
-			return $this->bd->lastInsertId();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function updateFeed ($id, $valuesTmp) {
-		$set = '';
-		foreach ($valuesTmp as $key => $v) {
-			$set .= $key . '=?, ';
-
-			if ($key == 'httpAuth') {
-				$valuesTmp[$key] = base64_encode ($v);
-			}
-		}
-		$set = substr ($set, 0, -2);
-
-		$sql = 'UPDATE `' . $this->prefix . 'feed` SET ' . $set . ' WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		foreach ($valuesTmp as $v) {
-			$values[] = $v;
-		}
-		$values[] = $id;
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function updateLastUpdate ($id, $inError = 0) {
-		$sql = 'UPDATE `' . $this->prefix . 'feed` f '	//2 sub-requests with FOREIGN KEY(e.id_feed), INDEX(e.is_read) faster than 1 request with GROUP BY or CASE
-		     . 'SET f.cache_nbEntries=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=f.id),'
-		     . 'f.cache_nbUnreads=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=f.id AND e2.is_read=0),'
-		     . 'lastUpdate=?, error=? '
-		     . 'WHERE f.id=?';
-
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			time (),
-			$inError,
-			$id,
-		);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function changeCategory ($idOldCat, $idNewCat) {
-		$catDAO = new CategoryDAO ();
-		$newCat = $catDAO->searchById ($idNewCat);
-		if (!$newCat) {
-			$newCat = $catDAO->getDefault ();
-		}
-
-		$sql = 'UPDATE `' . $this->prefix . 'feed` SET category=? WHERE category=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array (
-			$newCat->id (),
-			$idOldCat
-		);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function deleteFeed ($id) {
-		/*//For MYISAM (MySQL 5.5-) without FOREIGN KEY
-		$sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?';
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		if (!($stm && $stm->execute ($values))) {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}*/
-
-		$sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($id);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-	public function deleteFeedByCategory ($id) {
-		/*//For MYISAM (MySQL 5.5-) without FOREIGN KEY
-		$sql = 'DELETE FROM `' . $this->prefix . 'entry` e '
-		     . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '
-		     . 'WHERE f.category=?';
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		if (!($stm && $stm->execute ($values))) {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}*/
-
-		$sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE category=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($id);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function searchById ($id) {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE id=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($id);
-
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$feed = HelperFeed::daoToFeed ($res);
-
-		if (isset ($feed[$id])) {
-			return $feed[$id];
-		} else {
-			return false;
-		}
-	}
-	public function searchByUrl ($url) {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE url=?';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($url);
-
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-		$feed = current (HelperFeed::daoToFeed ($res));
-
-		if (isset ($feed)) {
-			return $feed;
-		} else {
-			return false;
-		}
-	}
-
-	public function listFeeds () {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` ORDER BY name';
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-
-		return HelperFeed::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
-	}
-
-	public function listFeedsOrderUpdate () {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` ORDER BY lastUpdate';
-		$stm = $this->bd->prepare ($sql);
-		$stm->execute ();
-
-		return HelperFeed::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
-	}
-
-	public function listByCategory ($cat) {
-		$sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE category=? ORDER BY name';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($cat);
-
-		$stm->execute ($values);
-
-		return HelperFeed::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
-	}
-
-	public function countEntries ($id) {
-		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=?';
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-
-		return $res[0]['count'];
-	}
-	public function countNotRead ($id) {
-		$sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND is_read=0';
-		$stm = $this->bd->prepare ($sql);
-		$values = array ($id);
-		$stm->execute ($values);
-		$res = $stm->fetchAll (PDO::FETCH_ASSOC);
-
-		return $res[0]['count'];
-	}
-	public function updateCachedValues () {	//For one single feed, call updateLastUpdate($id)
-		$sql = 'UPDATE `' . $this->prefix . 'feed` f '
-		     . 'INNER JOIN ('
-		     .	'SELECT e.id_feed, '
-		     .	'COUNT(CASE WHEN e.is_read = 0 THEN 1 END) AS nbUnreads, '
-		     .	'COUNT(e.id) AS nbEntries '
-		     .	'FROM `' . $this->prefix . 'entry` e '
-		     .	'GROUP BY e.id_feed'
-		     . ') x ON x.id_feed=f.id '
-		     . 'SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads';
-		$stm = $this->bd->prepare ($sql);
-
-		$values = array ($feed_id);
-
-		if ($stm && $stm->execute ($values)) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-
-	public function truncate ($id) {
-		$sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e WHERE e.id_feed=?';
-		$stm = $this->bd->prepare($sql);
-		$values = array($id);
-		$this->bd->beginTransaction ();
-		if (!($stm && $stm->execute ($values))) {
-				$info = $stm->errorInfo();
-				Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-				$this->bd->rollBack ();
-				return false;
-			}
-		$affected = $stm->rowCount();
-
-		$sql = 'UPDATE `' . $this->prefix . 'feed` f '
-			 . 'SET f.cache_nbEntries=0, f.cache_nbUnreads=0 WHERE f.id=?';
-		$values = array ($id);
-		$stm = $this->bd->prepare ($sql);
-		if (!($stm && $stm->execute ($values))) {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			$this->bd->rollBack ();
-			return false;
-		}
-
-		$this->bd->commit ();
-		return $affected;
-	}
-
-	public function cleanOldEntries ($id, $date_min, $keep = 15) {	//Remember to call updateLastUpdate($id) just after
-		$sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e '
-		     . 'WHERE e.id_feed = :id_feed AND e.id <= :id_max AND e.is_favorite = 0 AND e.id NOT IN '
-		     . '(SELECT id FROM (SELECT e2.id FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed = :id_feed ORDER BY id DESC LIMIT :keep) keep)';	//Double select because of: MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
-		$stm = $this->bd->prepare ($sql);
-
-		$id_max = intval($date_min) . '000000';
-
-		$stm->bindParam(':id_feed', $id, PDO::PARAM_INT);
-		$stm->bindParam(':id_max', $id_max, PDO::PARAM_INT);
-		$stm->bindParam(':keep', $keep, PDO::PARAM_INT);
-
-		if ($stm && $stm->execute ()) {
-			return $stm->rowCount();
-		} else {
-			$info = $stm->errorInfo();
-			Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
-			return false;
-		}
-	}
-}
-
-class HelperFeed {
-	public static function daoToFeed ($listDAO, $catID = null) {
-		$list = array ();
-
-		if (!is_array ($listDAO)) {
-			$listDAO = array ($listDAO);
-		}
-
-		foreach ($listDAO as $key => $dao) {
-			if (!isset ($dao['name'])) {
-				continue;
-			}
-			if (isset ($dao['id'])) {
-				$key = $dao['id'];
-			}
-
-			$myFeed = new Feed (isset($dao['url']) ? $dao['url'] : '', false);
-			$myFeed->_category ($catID === null ? $dao['category'] : $catID);
-			$myFeed->_name ($dao['name']);
-			$myFeed->_website ($dao['website'], false);
-			$myFeed->_description (isset($dao['description']) ? $dao['description'] : '');
-			$myFeed->_lastUpdate (isset($dao['lastUpdate']) ? $dao['lastUpdate'] : 0);
-			$myFeed->_priority ($dao['priority']);
-			$myFeed->_pathEntries (isset($dao['pathEntries']) ? $dao['pathEntries'] : '');
-			$myFeed->_httpAuth (isset($dao['httpAuth']) ? base64_decode ($dao['httpAuth']) : '');
-			$myFeed->_error ($dao['error']);
-			$myFeed->_keepHistory (isset($dao['keep_history']) ? $dao['keep_history'] : '');
-			$myFeed->_nbNotRead ($dao['cache_nbUnreads']);
-			$myFeed->_nbEntries ($dao['cache_nbEntries']);
-			if (isset ($dao['id'])) {
-				$myFeed->_id ($dao['id']);
-			}
-			$list[$key] = $myFeed;
-		}
-
-		return $list;
-	}
-}

+ 0 - 46
app/models/Log_Model.php

@@ -1,46 +0,0 @@
-<?php
-
-class Log_Model extends Model {
-	private $date;
-	private $level;
-	private $information;
-
-	public function date () {
-		return $this->date;
-	}
-	public function level () {
-		return $this->level;
-	}
-	public function info () {
-		return $this->information;
-	}
-	public function _date ($date) {
-		$this->date = $date;
-	}
-	public function _level ($level) {
-		$this->level = $level;
-	}
-	public function _info ($information) {
-		$this->information = $information;
-	}
-}
-
-class LogDAO extends Model_txt {
-	public function __construct () {
-		parent::__construct (LOG_PATH . '/application.log', 'r+');
-	}
-
-	public function lister () {
-		$logs = array ();
-		while (($line = $this->readLine ()) !== false) {
-			if (preg_match ('/^\[([^\[]+)\] \[([^\[]+)\] --- (.*)$/', $line, $matches)) {
-				$myLog = new Log_Model ();
-				$myLog->_date ($matches[1]);
-				$myLog->_level ($matches[2]);
-				$myLog->_info ($matches[3]);
-				$logs[] = $myLog;
-			}
-		}
-		return $logs;
-	}
-}

+ 11 - 11
app/views/configure/categorize.phtml

@@ -1,28 +1,28 @@
 <?php $this->partial ('aside_feed'); ?>
 
 <div class="post">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
 	<form method="post" action="<?php echo _url ('configure', 'categorize'); ?>">
-		<legend><?php echo Translate::t ('categories_management'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('categories_management'); ?></legend>
 
-		<p class="alert alert-warn"><?php echo Translate::t ('feeds_moved_category_deleted', $this->defaultCategory->name ()); ?></p>
+		<p class="alert alert-warn"><?php echo Minz_Translate::t ('feeds_moved_category_deleted', $this->defaultCategory->name ()); ?></p>
 
 		<?php $i = 0; foreach ($this->categories as $cat) { $i++; ?>
 		<div class="form-group">
 			<label class="group-name" for="cat_<?php echo $cat->id (); ?>">
-				<?php echo Translate::t ('category_number', $i); ?>
+				<?php echo Minz_Translate::t ('category_number', $i); ?>
 			</label>
 			<div class="group-controls">
 				<input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" />
 
 				<?php if ($cat->nbFeed () > 0) { ?>
-				<a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Translate::t ('ask_empty'); ?></a>
+				<a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Minz_Translate::t ('ask_empty'); ?></a>
 				<?php } ?>
-				(<?php echo Translate::t ('number_feeds', $cat->nbFeed ()); ?>)
+				(<?php echo Minz_Translate::t ('number_feeds', $cat->nbFeed ()); ?>)
 
 				<?php if ($cat->id () == $this->defaultCategory->id ()) { ?>
-				<?php echo RSSThemes::icon('help'); ?> <?php echo Translate::t ('can_not_be_deleted'); ?>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('can_not_be_deleted'); ?>
 				<?php } ?>
 
 				<input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" />
@@ -31,16 +31,16 @@
 		<?php } ?>
 
 		<div class="form-group">
-			<label class="group-name" for="new_category"><?php echo Translate::t ('add_category'); ?></label>
+			<label class="group-name" for="new_category"><?php echo Minz_Translate::t ('add_category'); ?></label>
 			<div class="group-controls">
-				<input type="text" id="new_category" name="new_category" placeholder="<?php echo Translate::t ('new_category'); ?>" />
+				<input type="text" id="new_category" name="new_category" placeholder="<?php echo Minz_Translate::t ('new_category'); ?>" />
 			</div>
 		</div>
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
-				<button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button>
+				<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
+				<button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
 			</div>
 		</div>
 	</form>

+ 53 - 53
app/views/configure/display.phtml

@@ -1,13 +1,13 @@
 <?php $this->partial ('aside_configure'); ?>
 
 <div class="post">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
 	<form method="post" action="<?php echo _url ('configure', 'display'); ?>">
-		<legend><?php echo Translate::t ('general_configuration'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('general_configuration'); ?></legend>
 
 		<div class="form-group">
-			<label class="group-name" for="language"><?php echo Translate::t ('language'); ?></label>
+			<label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label>
 			<div class="group-controls">
 				<select name="language" id="language">
 				<?php $languages = $this->conf->availableLanguages (); ?>
@@ -19,12 +19,12 @@
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="theme"><?php echo Translate::t ('theme'); ?></label>
+			<label class="group-name" for="theme"><?php echo Minz_Translate::t ('theme'); ?></label>
 			<div class="group-controls">
 				<select name="theme" id="theme">
 				<?php foreach ($this->themes as $theme) { ?>
 				<option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme () == $theme['path'] ? ' selected="selected"' : ''; ?>>
-					<?php echo $theme['name'] . ' ' . Translate::t ('by') . ' ' . $theme['author']; ?> 
+					<?php echo $theme['name'] . ' ' . Minz_Translate::t ('by') . ' ' . $theme['author']; ?> 
 				</option>
 				<?php } ?>
 				</select>
@@ -32,68 +32,68 @@
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="old_entries"><?php echo Translate::t ('delete_articles_every'); ?></label>
+			<label class="group-name" for="old_entries"><?php echo Minz_Translate::t ('delete_articles_every'); ?></label>
 			<div class="group-controls">
-				<input type="number" id="old_entries" name="old_entries" value="<?php echo $this->conf->oldEntries (); ?>" /> <?php echo Translate::t ('month'); ?>
+				<input type="number" id="old_entries" name="old_entries" value="<?php echo $this->conf->oldEntries (); ?>" /> <?php echo Minz_Translate::t ('month'); ?>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="mail_login"><?php echo Translate::t ('persona_connection_email'); ?></label>
+			<label class="group-name" for="mail_login"><?php echo Minz_Translate::t ('persona_connection_email'); ?></label>
 			<?php $mail = $this->conf->mailLogin (); ?>
 			<div class="group-controls">
-				<input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" />
-				<noscript><b><?php echo Translate::t ('javascript_should_be_activated'); ?></b></noscript>
+				<input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" />
+				<noscript><b><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></b></noscript>
 				<label class="checkbox" for="anon_access">
 					<input type="checkbox" name="anon_access" id="anon_access" value="yes"<?php echo $this->conf->anonAccess () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('allow_anonymous'); ?>
+					<?php echo Minz_Translate::t ('allow_anonymous'); ?>
 				</label>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="token"><?php echo Translate::t ('auth_token'); ?></label>
+			<label class="group-name" for="token"><?php echo Minz_Translate::t ('auth_token'); ?></label>
 			<?php $token = $this->conf->token (); ?>
 			<div class="group-controls">
-				<input type="text" id="token" name="token" value="<?php echo $token; ?>"  placeholder="<?php echo Translate::t ('blank_to_disable'); ?>"/>
-				<?php echo RSSThemes::icon('help'); ?> <?php echo Translate::t('explain_token', Url::display(null, 'html', true), $token); ?>
+				<input type="text" id="token" name="token" value="<?php echo $token; ?>"  placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>"/>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
 			</div>
 		</div>
 	
-		<legend><?php echo Translate::t ('reading_configuration'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend>
 
 		<div class="form-group">
-			<label class="group-name" for="posts_per_page"><?php echo Translate::t ('articles_per_page'); ?></label>
+			<label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label>
 			<div class="group-controls">
 				<input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->postsPerPage (); ?>" />
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="sort_order"><?php echo Translate::t ('sort_order'); ?></label>
+			<label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label>
 			<div class="group-controls">
 				<select name="sort_order" id="sort_order">
-					<option value="DESC"<?php echo $this->conf->sortOrder () === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('newer_first'); ?></option>
-					<option value="ASC"<?php echo $this->conf->sortOrder () === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('older_first'); ?></option>
+					<option value="DESC"<?php echo $this->conf->sortOrder () === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option>
+					<option value="ASC"<?php echo $this->conf->sortOrder () === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option>
 				</select>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="view_mode"><?php echo Translate::t ('default_view'); ?></label>
+			<label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label>
 			<div class="group-controls">
 				<select name="view_mode" id="view_mode">
-					<option value="normal"<?php echo $this->conf->viewMode () == 'normal' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('normal_view'); ?></option>
-					<option value="reader"<?php echo $this->conf->viewMode () == 'reader' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('reader_view'); ?></option>
-					<option value="global"<?php echo $this->conf->viewMode () == 'global' ? ' selected="selected"' : ''; ?>><?php echo Translate::t ('global_view'); ?></option>
+					<option value="normal"<?php echo $this->conf->viewMode () == 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option>
+					<option value="reader"<?php echo $this->conf->viewMode () == 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>
+					<option value="global"<?php echo $this->conf->viewMode () == 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>
 				</select>
 				<label class="radio" for="radio_all">
 					<input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('show_all_articles'); ?>
+					<?php echo Minz_Translate::t ('show_all_articles'); ?>
 				</label>
 				<label class="radio" for="radio_not_read">
 					<input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('show_not_reads'); ?>
+					<?php echo Minz_Translate::t ('show_not_reads'); ?>
 				</label>
 			</div>
 		</div>
@@ -102,8 +102,8 @@
 			<div class="group-controls">
 				<label class="checkbox" for="auto_load_more">
 					<input type="checkbox" name="auto_load_more" id="auto_load_more" value="yes"<?php echo $this->conf->autoLoadMore () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('auto_load_more'); ?>
-					<?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+					<?php echo Minz_Translate::t ('auto_load_more'); ?>
+					<?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
 				</label>
 			</div>
 		</div>
@@ -112,8 +112,8 @@
 			<div class="group-controls">
 				<label class="checkbox" for="display_posts">
 					<input type="checkbox" name="display_posts" id="display_posts" value="yes"<?php echo $this->conf->displayPosts () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('display_articles_unfolded'); ?>
-					<?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+					<?php echo Minz_Translate::t ('display_articles_unfolded'); ?>
+					<?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
 				</label>
 			</div>
 		</div>
@@ -122,61 +122,61 @@
 			<div class="group-controls">
 				<label class="checkbox" for="lazyload">
 					<input type="checkbox" name="lazyload" id="lazyload" value="yes"<?php echo $this->conf->lazyload () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('img_with_lazyload'); ?>
-					<?php echo $this->conf->lazyload () == 'yes' ? '<noscript> - <b>' . Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+					<?php echo Minz_Translate::t ('img_with_lazyload'); ?>
+					<?php echo $this->conf->lazyload () == 'yes' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
 				</label>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('auto_read_when'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label>
 			<div class="group-controls">
 				<label class="checkbox" for="check_open_article">
 					<input type="checkbox" name="mark_open_article" id="check_open_article" value="yes"<?php echo $this->conf->markWhenArticle () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('article_selected'); ?>
+					<?php echo Minz_Translate::t ('article_selected'); ?>
 				</label>
 				<label class="checkbox" for="check_open_site">
 					<input type="checkbox" name="mark_open_site" id="check_open_site" value="yes"<?php echo $this->conf->markWhenSite () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('article_open_on_website'); ?>
+					<?php echo Minz_Translate::t ('article_open_on_website'); ?>
 				</label>
 				<label class="checkbox" for="check_scroll">
 					<input type="checkbox" name="mark_scroll" id="check_scroll" value="yes"<?php echo $this->conf->markWhenScroll () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('scroll'); ?>
+					<?php echo Minz_Translate::t ('scroll'); ?>
 				</label>
 				<label class="checkbox" for="check_reception">
 					<input type="checkbox" name="mark_upon_reception" id="check_reception" value="yes"<?php echo $this->conf->markUponReception () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('upon_reception'); ?>
+					<?php echo Minz_Translate::t ('upon_reception'); ?>
 				</label>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('after_onread'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label>
 			<div class="group-controls">
 				<label class="checkbox" for="onread_jump_next">
 					<input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="yes"<?php echo $this->conf->onread_jump_next () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('jump_next'); ?>
+					<?php echo Minz_Translate::t ('jump_next'); ?>
 				</label>
 			</div>
 		</div>
 
-		<legend><?php echo Translate::t ('reading_icons'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('reading_icons'); ?></legend>
 		<div class="form-group">
 			<table>
 				<thead>
 					<tr>
 						<th> </th>
-						<th title="<?php echo Translate::t ('mark_read'); ?>"><?php echo RSSThemes::icon('read'); ?></th>
-						<th title="<?php echo Translate::t ('mark_favorite'); ?>"><?php echo RSSThemes::icon('bookmark'); ?></th>
-						<th><?php echo Translate::t ('sharing'); ?></th>
-						<th><?php echo Translate::t ('related_tags'); ?></th>
-						<th><?php echo Translate::t ('publication_date'); ?></th>
-						<th><?php echo RSSThemes::icon('link'); ?></th>
+						<th title="<?php echo Minz_Translate::t ('mark_read'); ?>"><?php echo FreshRSS_Themes::icon('read'); ?></th>
+						<th title="<?php echo Minz_Translate::t ('mark_favorite'); ?>"><?php echo FreshRSS_Themes::icon('bookmark'); ?></th>
+						<th><?php echo Minz_Translate::t ('sharing'); ?></th>
+						<th><?php echo Minz_Translate::t ('related_tags'); ?></th>
+						<th><?php echo Minz_Translate::t ('publication_date'); ?></th>
+						<th><?php echo FreshRSS_Themes::icon('link'); ?></th>
 					</tr>
 				</thead>
 				<tbody>
 					<tr>
-						<th><?php echo Translate::t ('top_line'); ?></th>
+						<th><?php echo Minz_Translate::t ('top_line'); ?></th>
 						<td><input type="checkbox" name="topline_read" value="yes"<?php echo $this->conf->toplineRead () ? ' checked="checked"' : ''; ?> /></td>
 						<td><input type="checkbox" name="topline_favorite" value="yes"<?php echo $this->conf->toplineFavorite () ? ' checked="checked"' : ''; ?> /></td>
 						<td><input type="checkbox" disabled="disabled" /></td>
@@ -184,7 +184,7 @@
 						<td><input type="checkbox" name="topline_date" value="yes"<?php echo $this->conf->toplineDate () ? ' checked="checked"' : ''; ?> /></td>
 						<td><input type="checkbox" name="topline_link" value="yes"<?php echo $this->conf->toplineLink () ? ' checked="checked"' : ''; ?> /></td>
 					</tr><tr>
-						<th><?php echo Translate::t ('bottom_line'); ?></th>
+						<th><?php echo Minz_Translate::t ('bottom_line'); ?></th>
 						<td><input type="checkbox" name="bottomline_read" value="yes"<?php echo $this->conf->bottomlineRead () ? ' checked="checked"' : ''; ?> /></td>
 						<td><input type="checkbox" name="bottomline_favorite" value="yes"<?php echo $this->conf->bottomlineFavorite () ? ' checked="checked"' : ''; ?> /></td>
 						<td><input type="checkbox" name="bottomline_sharing" value="yes"<?php echo $this->conf->bottomlineSharing () ? ' checked="checked"' : ''; ?> /></td>
@@ -196,22 +196,22 @@
 			</table>
 		</div>
 
-		<legend><?php echo Translate::t ('advanced'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
 		<div class="form-group">
 			<label class="group-name"></label>
 			<div class="group-controls">
-				<p><?php echo $this->nb_total; ?> <?php echo Translate::t('articles') ?>, <?php echo formatBytes($this->size_total); ?>.</p>
+				<p><?php echo $this->nb_total; ?> <?php echo Minz_Translate::t('articles') ?>, <?php echo formatBytes($this->size_total); ?>.</p>
 				<p><a class="btn" href="<?php echo _url('entry', 'optimize'); ?>">
-					<?php echo Translate::t('optimize_bdd'); ?>
+					<?php echo Minz_Translate::t('optimize_bdd'); ?>
 				</a></p>
-				<?php echo RSSThemes::icon('help'); ?> <?php echo Translate::t('optimize_todo_sometimes'); ?>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('optimize_todo_sometimes'); ?>
 			</div>
 		</div>
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
-				<button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button>
+				<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
+				<button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
 			</div>
 		</div>
 	</form>

+ 27 - 27
app/views/configure/feed.phtml

@@ -2,46 +2,46 @@
 
 <?php if ($this->flux) { ?>
 <div class="post">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Translate::t ('filter'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a>
 
 	<h1><?php echo $this->flux->name (); ?></h1>
 	<?php echo $this->flux->description (); ?>
 
 	<?php if ($this->flux->inError ()) { ?>
-	<p class="alert alert-error"><span class="alert-head"><?php echo Translate::t ('damn'); ?></span> <?php echo Translate::t ('feed_in_error'); ?></p>
+	<p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p>
 	<?php } ?>
 
 	<form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>">
-		<legend><?php echo Translate::t ('informations'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('informations'); ?></legend>
 		<div class="form-group">
-			<label class="group-name" for="name"><?php echo Translate::t ('title'); ?></label>
+			<label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label>
 			<div class="group-controls">
 				<input type="text" name="name" id="name" value="<?php echo $this->flux->name () ; ?>" />
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('feed_description'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('feed_description'); ?></label>
 			<div class="group-controls">
 				<textarea name="description" id="description"><?php echo $this->flux->description (); ?></textarea>
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('website_url'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('website_url'); ?></label>
 			<div class="group-controls">
 				<input type="text" name="website" id="website" value="<?php echo $this->flux->website (); ?>" />
-				<a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo RSSThemes::icon('link'); ?></a>
+				<a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('feed_url'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('feed_url'); ?></label>
 			<div class="group-controls">
 				<input type="text" name="url" id="url" value="<?php echo $this->flux->url (); ?>" />
-				<a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo RSSThemes::icon('link'); ?></a>
-				  <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Translate::t ('feed_validator'); ?></a>
+				<a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
+				  <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a>
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name" for="category"><?php echo Translate::t ('category'); ?></label>
+			<label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label>
 			<div class="group-controls">
 				<select name="category" id="category">
 				<?php foreach ($this->categories as $cat) { ?>
@@ -56,54 +56,54 @@
 			<label class="group-name"></label>
 			<div class="group-controls">
 				<a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>">
-					<?php echo RSSThemes::icon('refresh'); ?> <?php echo Translate::t('actualize'); ?>
+					<?php echo FreshRSS_Themes::icon('refresh'); ?> <?php echo Minz_Translate::t('actualize'); ?>
 				</a>
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('number_articles'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('number_articles'); ?></label>
 			<div class="group-controls">
 				<span class="control"><?php echo $this->flux->nbEntries (); ?></span>
 				<label class="checkbox" for="keep_history">
 					<input type="checkbox" name="keep_history" id="keep_history" value="yes"<?php echo $this->flux->keepHistory () == 'yes' ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('keep_history'); ?>
+					<?php echo Minz_Translate::t ('keep_history'); ?>
 				</label>
 			</div>
 		</div>
 		<div class="form-group">
 			<label class="group-name"></label>
 			<div class="group-controls">
-				<button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Translate::t ('truncate'); ?></button>
+				<button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button>
 			</div>
 		</div>
 
-		<legend><?php echo Translate::t ('advanced'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
 		<div class="form-group">
-			<label class="group-name" for="priority"><?php echo Translate::t ('show_in_all_flux'); ?></label>
+			<label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label>
 			<div class="group-controls">
 				<label class="checkbox" for="priority">
 					<input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ('yes'); ?>
+					<?php echo Minz_Translate::t ('yes'); ?>
 				</label>
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name" for="path_entries"><?php echo Translate::t ('css_path_on_website'); ?></label>
+			<label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label>
 			<div class="group-controls">
-				<input type="text" name="path_entries" id="path_entries" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" />
-				<?php echo RSSThemes::icon('help'); ?> <?php echo Translate::t ('retrieve_truncated_feeds'); ?>
+				<input type="text" name="path_entries" id="path_entries" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" />
+				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?>
 			</div>
 		</div>
 
 		<?php $auth = $this->flux->httpAuth (false); ?>
 		<div class="form-group">
-			<label class="group-name" for="http_user"><?php echo Translate::t ('http_username'); ?></label>
+			<label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label>
 			<div class="group-controls">
 				<input type="text" name="http_user" id="http_user" value="<?php echo $auth['username']; ?>" autocomplete="off" />
-				<?php echo RSSThemes::icon('help'); ?> <?php echo Translate::t ('access_protected_feeds'); ?>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?>
 			</div>
 
-			<label class="group-name" for="http_pass"><?php echo Translate::t ('http_password'); ?></label>
+			<label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label>
 			<div class="group-controls">
 				<input type="password" name="http_pass" id="http_pass" value="<?php echo $auth['password']; ?>" autocomplete="off" />
 			</div>
@@ -112,13 +112,13 @@
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
-				<button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Translate::t ('delete'); ?></button>
+				<button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
+				<button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('delete'); ?></button>
 			</div>
 		</div>
 	</form>
 </div>
 
 <?php } else { ?>
-<div class="alert alert-warn"><span class="alert-head"><?php echo Translate::t ('no_selected_feed'); ?></span> <?php echo Translate::t ('think_to_add'); ?></div>
+<div class="alert alert-warn"><span class="alert-head"><?php echo Minz_Translate::t ('no_selected_feed'); ?></span> <?php echo Minz_Translate::t ('think_to_add'); ?></div>
 <?php } ?>

+ 9 - 9
app/views/configure/importExport.phtml

@@ -1,9 +1,9 @@
 <?php if ($this->req == 'export') { ?>
 <?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; // résout bug sur certain serveur ?>
-<!-- Generated by <?php echo Configuration::title (); ?> -->
+<!-- Generated by <?php echo Minz_Configuration::title (); ?> -->
 <opml version="2.0">
 	<head>
-		<title><?php echo Configuration::title (); ?> OPML Feed</title>
+		<title><?php echo Minz_Configuration::title (); ?> OPML Feed</title>
 		<dateCreated><?php echo date('D, d M Y H:i:s'); ?></dateCreated>
 	</head>
 	<body>
@@ -14,12 +14,12 @@
 <?php $this->partial ('aside_feed'); ?>
 
 <div class="post ">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
-	<form method="post" action="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data">
-		<legend><?php echo Translate::t ('import_export_opml'); ?></legend>
+	<form method="post" action="<?php echo Minz_Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data">
+		<legend><?php echo Minz_Translate::t ('import_export_opml'); ?></legend>
 		<div class="form-group">
-			<label class="group-name" for="file"><?php echo Translate::t ('file_to_import'); ?></label>
+			<label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label>
 			<div class="group-controls">
 				<input type="file" name="file" id="file" />
 			</div>
@@ -27,9 +27,9 @@
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo Translate::t ('import'); ?></button>
-				<?php echo Translate::t ('or'); ?>
-				<a target="_blank" class="btn btn-important" href="<?php echo _url ('configure', 'importExport', 'q', 'export'); ?>"><?php echo Translate::t ('export'); ?></a>
+				<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button>
+				<?php echo Minz_Translate::t ('or'); ?>
+				<a target="_blank" class="btn btn-important" href="<?php echo _url ('configure', 'importExport', 'q', 'export'); ?>"><?php echo Minz_Translate::t ('export'); ?></a>
 			</div>
 		</div>
 	</form>

+ 15 - 15
app/views/configure/sharing.phtml

@@ -1,45 +1,45 @@
 <?php $this->partial ('aside_configure'); ?>
 
 <div class="post">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
 	<form method="post" action="<?php echo _url ('configure', 'sharing'); ?>">
-		<legend><?php echo Translate::t ('sharing'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('sharing'); ?></legend>
 		<div class="form-group">
 			<label class="group-name" for="shaarli">
-				<?php echo Translate::t ('your_shaarli'); ?>
+				<?php echo Minz_Translate::t ('your_shaarli'); ?>
 			</label>
 			<div class="group-controls">
-				<input type="url" id="shaarli" name="shaarli" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" size="64" />
+				<input type="url" id="shaarli" name="shaarli" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" />
 
-				<?php echo RSSThemes::icon('help'); ?> <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli"><?php echo Translate::t ('more_information'); ?></a>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli"><?php echo Minz_Translate::t ('more_information'); ?></a>
 			</div>
 		</div>
 
 		<div class="form-group">
 			<label class="group-name" for="poche">
-				<?php echo Translate::t ('your_poche'); ?>
+				<?php echo Minz_Translate::t ('your_poche'); ?>
 			</label>
 			<div class="group-controls">
-				<input type="url" id="poche" name="poche" value="<?php echo $this->conf->sharing ('poche'); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" size="64" />
+				<input type="url" id="poche" name="poche" value="<?php echo $this->conf->sharing ('poche'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" />
 
-				<?php echo RSSThemes::icon('help'); ?> <a target="_blank" href="http://www.inthepoche.com/"><?php echo Translate::t ('more_information'); ?></a>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://www.inthepoche.com/"><?php echo Minz_Translate::t ('more_information'); ?></a>
 			</div>
 		</div>
 
 		<div class="form-group">
 			<label class="group-name" for="diaspora">
-				<?php echo Translate::t ('your_diaspora_pod'); ?>
+				<?php echo Minz_Translate::t ('your_diaspora_pod'); ?>
 			</label>
 			<div class="group-controls">
-				<input type="url" id="diaspora" name="diaspora" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" size="64" />
+				<input type="url" id="diaspora" name="diaspora" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" />
 
-				<?php echo RSSThemes::icon('help'); ?> <a target="_blank" href="https://diasporafoundation.org/"><?php echo Translate::t ('more_information'); ?></a>
+				<?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="https://diasporafoundation.org/"><?php echo Minz_Translate::t ('more_information'); ?></a>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name"><?php echo Translate::t ('activate_sharing'); ?></label>
+			<label class="group-name"><?php echo Minz_Translate::t ('activate_sharing'); ?></label>
 			<div class="group-controls">
 				<?php
 					$services = array ('twitter', 'g+', 'facebook', 'email', 'print');
@@ -48,7 +48,7 @@
 				?>
 				<label class="checkbox" for="<?php echo $service; ?>">
 					<input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="yes"<?php echo $this->conf->sharing ($service) ? ' checked="checked"' : ''; ?> />
-					<?php echo Translate::t ($service); ?>
+					<?php echo Minz_Translate::t ($service); ?>
 				</label>
 				<?php } ?>
 			</div>
@@ -56,8 +56,8 @@
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
-				<button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button>
+				<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
+				<button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
 			</div>
 		</div>
 	</form>

+ 15 - 15
app/views/configure/shortcut.phtml

@@ -1,7 +1,7 @@
 <?php $this->partial ('aside_configure'); ?>
 
 <div class="post">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
 	<datalist id="keys">
 		<?php foreach ($this->list_keys as $key) { ?>
@@ -12,57 +12,57 @@
 	<?php $s = $this->conf->shortcuts (); ?>
 
 	<form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>">
-		<legend><?php echo Translate::t ('shortcuts_management'); ?></legend>
+		<legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend>
 
-		<noscript><p class="alert alert-error"><?php echo Translate::t ('javascript_for_shortcuts'); ?></p></noscript>
+		<noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript>
 
 		<div class="form-group">
-			<label class="group-name" for="mark_read"><?php echo Translate::t ('mark_read'); ?></label>
+			<label class="group-name" for="mark_read"><?php echo Minz_Translate::t ('mark_read'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" />
-				<?php echo Translate::t ('shift_for_all_read'); ?>
+				<?php echo Minz_Translate::t ('shift_for_all_read'); ?>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="mark_favorite"><?php echo Translate::t ('mark_favorite'); ?></label>
+			<label class="group-name" for="mark_favorite"><?php echo Minz_Translate::t ('mark_favorite'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" />
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="go_website"><?php echo Translate::t ('see_on_website'); ?></label>
+			<label class="group-name" for="go_website"><?php echo Minz_Translate::t ('see_on_website'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" />
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="next_entry"><?php echo Translate::t ('next_article'); ?></label>
+			<label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('next_article'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" />
-				<?php echo Translate::t ('shift_for_last'); ?>
+				<?php echo Minz_Translate::t ('shift_for_last'); ?>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="prev_entry"><?php echo Translate::t ('previous_article'); ?></label>
+			<label class="group-name" for="prev_entry"><?php echo Minz_Translate::t ('previous_article'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" />
-				<?php echo Translate::t ('shift_for_first'); ?>
+				<?php echo Minz_Translate::t ('shift_for_first'); ?>
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="collapse_entry"><?php echo Translate::t ('collapse_article'); ?></label>
+			<label class="group-name" for="collapse_entry"><?php echo Minz_Translate::t ('collapse_article'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?php echo $s['collapse_entry']; ?>" />
 			</div>
 		</div>
 
 		<div class="form-group">
-			<label class="group-name" for="load_more_shortcut"><?php echo Translate::t ('load_more'); ?></label>
+			<label class="group-name" for="load_more_shortcut"><?php echo Minz_Translate::t ('load_more'); ?></label>
 			<div class="group-controls">
 				<input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?php echo $s['load_more']; ?>" />
 			</div>
@@ -70,8 +70,8 @@
 
 		<div class="form-group form-actions">
 			<div class="group-controls">
-				<button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
-				<button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button>
+				<button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
+				<button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
 			</div>
 		</div>
 	</form>

+ 8 - 8
app/views/entry/bookmark.phtml

@@ -1,16 +1,16 @@
 <?php
 header('Content-Type: application/json; charset=UTF-8');
 
-if (Request::param ('is_favorite')) {
-	Request::_param ('is_favorite', 0);
+if (Minz_Request::param ('is_favorite')) {
+	Minz_Request::_param ('is_favorite', 0);
 } else {
-	Request::_param ('is_favorite', 1);
+	Minz_Request::_param ('is_favorite', 1);
 }
 
-$url = Url::display (array (
-	'c' => Request::controllerName (),
-	'a' => Request::actionName (),
-	'params' => Request::params (),
+$url = Minz_Url::display (array (
+	'c' => Minz_Request::controllerName (),
+	'a' => Minz_Request::actionName (),
+	'params' => Minz_Request::params (),
 ));
 
-echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => RSSThemes::icon(Request::param ('is_favorite') ? 'non-starred' : 'starred')));
+echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred')));

+ 8 - 8
app/views/entry/read.phtml

@@ -1,16 +1,16 @@
 <?php
 header('Content-Type: application/json; charset=UTF-8');
 
-if (Request::param ('is_read')) {
-	Request::_param ('is_read', 0);
+if (Minz_Request::param ('is_read')) {
+	Minz_Request::_param ('is_read', 0);
 } else {
-	Request::_param ('is_read', 1);
+	Minz_Request::_param ('is_read', 1);
 }
 
-$url = Url::display (array (
-	'c' => Request::controllerName (),
-	'a' => Request::actionName (),
-	'params' => Request::params (),
+$url = Minz_Url::display (array (
+	'c' => Minz_Request::controllerName (),
+	'a' => Minz_Request::actionName (),
+	'params' => Minz_Request::params (),
 ));
 
-echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => RSSThemes::icon(Request::param ('is_read') ? 'unread' : 'read')));
+echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read')));

+ 2 - 2
app/views/error/index.phtml

@@ -3,8 +3,8 @@
 		<h1 class="alert-head"><?php echo $this->code; ?></h1>
 
 		<p>
-			<?php echo Translate::t ('page_not_found'); ?><br />
-			<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+			<?php echo Minz_Translate::t ('page_not_found'); ?><br />
+			<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 		</p>
 	</div>
 </div>

+ 10 - 10
app/views/helpers/javascript_vars.phtml

@@ -2,12 +2,12 @@
 	echo '"use strict";', "\n";
 	$mark = $this->conf->markWhen ();
 	echo 'var ',
-		'hide_posts=', ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'false' : 'true',
+		'hide_posts=', ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'false' : 'true',
 		',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false',
 		',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false',
 		',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false',
 		',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false',
-		',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'true' : 'false',
+		',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'true' : 'false',
 		',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false';
 
 	$s = $this->conf->shortcuts ();
@@ -21,11 +21,11 @@
 			'load_more:"', $s['load_more'], '"',
 		"},\n";
 
-	if (Request::param ('output') === 'global') {
-		echo "iconClose='", RSSThemes::icon('close'), "',\n";
+	if (Minz_Request::param ('output') === 'global') {
+		echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n";
 	}
 
-	$mail = Session::param ('mail', 'null');
+	$mail = Minz_Session::param ('mail', 'null');
 	if ($mail != 'null') {
 		$mail = '"' . $mail . '"';
 	}
@@ -35,11 +35,11 @@
 		'url_logout="', _url ('index', 'logout'), '",',
 		'current_user_mail=', $mail, ",\n";
 
-	echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ",\n";
+	echo 'load_shortcuts=', Minz_Request::controllerName () === 'index' && Minz_Request::actionName () === 'index' ? 'true' : 'false', ",\n";
 
-	echo 'str_confirmation="', Translate::t('confirm_action'), '"', ",\n";
+	echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n";
 
-	echo 'auto_actualize_feeds=', Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n";
-	if (Session::param('actualize_feeds', false)) {
-		Session::_param('actualize_feeds');
+	echo 'auto_actualize_feeds=', Minz_Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n";
+	if (Minz_Session::param('actualize_feeds', false)) {
+		Minz_Session::_param('actualize_feeds');
 	}

+ 8 - 8
app/views/helpers/logs_pagination.phtml

@@ -1,7 +1,7 @@
 <?php
-	$c = Request::controllerName ();
-	$a = Request::actionName ();
-	$params = Request::params ();
+	$c = Minz_Request::controllerName ();
+	$a = Minz_Request::actionName ();
+	$params = Minz_Request::params ();
 ?>
 
 <?php if ($this->nbPage > 1) { ?>
@@ -9,14 +9,14 @@
 	<?php $params[$getteur] = 1; ?>
 	<li class="item pager-first">
 		<?php if ($this->currentPage > 1) { ?>
-		<a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Translate::t('first'); ?></a>
+		<a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Minz_Translate::t('first'); ?></a>
 		<?php } ?>
 	</li>
 
 	<?php $params[$getteur] = $this->currentPage - 1; ?>
 	<li class="item pager-previous">
 		<?php if ($this->currentPage > 1) { ?>
-		<a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Translate::t('previous'); ?></a>
+		<a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Minz_Translate::t('previous'); ?></a>
 		<?php } ?>
 	</li>
 
@@ -24,7 +24,7 @@
 		<?php if($i > 0 && $i <= $this->nbPage) { ?>
 			<?php if ($i != $this->currentPage) { ?>
 			<?php $params[$getteur] = $i; ?>
-			<li class="item pager-item"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li>
+			<li class="item pager-item"><a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li>
 			<?php } else { ?>
 			<li class="item pager-current"><?php echo $i; ?></li>
 			<?php } ?>
@@ -34,13 +34,13 @@
 	<?php $params[$getteur] = $this->currentPage + 1; ?>
 	<li class="item pager-next">
 		<?php if ($this->currentPage < $this->nbPage) { ?>
-		<a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t('next'); ?> ›</a>
+		<a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('next'); ?> ›</a>
 		<?php } ?>
 	</li>
 	<?php $params[$getteur] = $this->nbPage; ?>
 	<li class="item pager-last">
 		<?php if ($this->currentPage < $this->nbPage) { ?>
-		<a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t('last'); ?> »</a>
+		<a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('last'); ?> »</a>
 		<?php } ?>
 	</li>
 </ul>

+ 9 - 9
app/views/helpers/pagination.phtml

@@ -1,25 +1,25 @@
 <?php
-	$c = Request::controllerName ();
-	$a = Request::actionName ();
-	$params = Request::params ();
-	$markReadUrl = Session::param ('markReadUrl');
-	Session::_param ('markReadUrl', false);
+	$c = Minz_Request::controllerName ();
+	$a = Minz_Request::actionName ();
+	$params = Minz_Request::params ();
+	$markReadUrl = Minz_Session::param ('markReadUrl');
+	Minz_Session::_param ('markReadUrl', false);
 ?>
 
 <ul class="pagination">
 	<li class="item pager-next">
 	<?php if (!empty($this->nextId)) { ?>
 	<?php $params['next'] = $this->nextId; ?>
-	<a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a>
+	<a id="load_more" href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t ('load_more'); ?></a>
 	<?php } elseif ($markReadUrl) { ?>
 	<a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>">
-		<?php echo Translate::t ('nothing_to_load'); ?><br />
+		<?php echo Minz_Translate::t ('nothing_to_load'); ?><br />
 		<span class="bigTick">✔</span><br />
-		<?php echo Translate::t ('mark_all_read'); ?>
+		<?php echo Minz_Translate::t ('mark_all_read'); ?>
 	</a>
 	<?php } else { ?>
 	<a id="bigMarkAsRead" href=".">
-		<?php echo Translate::t ('nothing_to_load'); ?><br />
+		<?php echo Minz_Translate::t ('nothing_to_load'); ?><br />
 	</a>
 	<?php } ?>
 	</li>

+ 1 - 1
app/views/helpers/view/global_view.phtml

@@ -32,5 +32,5 @@
 
 <div id="overlay"></div>
 <div id="panel"<?php echo $this->conf->displayPosts () === 'no' ? ' class="hide_posts"' : ''; ?>>
-	<a class="close" href="#"><?php echo RSSThemes::icon('close'); ?></a>
+	<a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a>
 </div>

+ 26 - 27
app/views/helpers/view/normal_view.phtml

@@ -24,23 +24,23 @@ if (!empty($this->entries)) {
 	?>
 	<?php foreach ($this->entries as $item) { ?>
 
-	<?php if ($display_today && $item->isDay (Days::TODAY)) { ?>
+	<?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY)) { ?>
 	<div class="day" id="day_today">
-		<?php echo Translate::t ('today'); ?>
+		<?php echo Minz_Translate::t ('today'); ?>
 		<span class="date"> - <?php echo timestamptodate (time (), false); ?></span>
 		<span class="name"><?php echo $this->currentName; ?></span>
 	</div>
 	<?php $display_today = false; } ?>
-	<?php if ($display_yesterday && $item->isDay (Days::YESTERDAY)) { ?>
+	<?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY)) { ?>
 	<div class="day" id="day_yesterday">
-		<?php echo Translate::t ('yesterday'); ?>
+		<?php echo Minz_Translate::t ('yesterday'); ?>
 		<span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span>
 		<span class="name"><?php echo $this->currentName; ?></span>
 	</div>
 	<?php $display_yesterday = false; } ?>
-	<?php if ($display_others && $item->isDay (Days::BEFORE_YESTERDAY)) { ?>
+	<?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY)) { ?>
 	<div class="day" id="day_before_yesterday">
-		<?php echo Translate::t ('before_yesterday'); ?>
+		<?php echo Minz_Translate::t ('before_yesterday'); ?>
 		<span class="name"><?php echo $this->currentName; ?></span>
 	</div>
 	<?php $display_others = false; } ?>
@@ -51,13 +51,13 @@ if (!empty($this->entries)) {
 				if ($this->conf->toplineRead ()) {
 					?><li class="item manage"><?php
 						?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
-							echo RSSThemes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
+							echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
 					?></li><?php
 				}
 				if ($this->conf->toplineFavorite ()) {
 					 ?><li class="item manage"><?php
 						?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
-							echo RSSThemes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
+							echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
 					?></li><?php
 				}
 			}
@@ -67,7 +67,7 @@ if (!empty($this->entries)) {
 			<li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
 			<li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
 			<?php if ($this->conf->toplineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
-			<?php if ($this->conf->toplineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo RSSThemes::icon('link'); ?></a></li><?php } ?>
+			<?php if ($this->conf->toplineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
 		</ul>
 
 		<div class="flux_content">
@@ -75,7 +75,7 @@ if (!empty($this->entries)) {
 				<h1 class="title"><?php echo $item->title (); ?></h1>
 				<?php
 					$author = $item->author ();
-					echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : '';
+					echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : '';
 					if($this->conf->lazyload() == 'yes') {
 						echo lazyimg($item->content ());
 					} else {
@@ -83,19 +83,18 @@ if (!empty($this->entries)) {
 					}
 				?>
 			</div>
-
 			<ul class="horizontal-list bottom"><?php
 				if (!login_is_conf ($this->conf) || is_logged ()) {
 					if ($this->conf->bottomlineRead ()) {
 						?><li class="item manage"><?php
 							?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
-								echo RSSThemes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
+								echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
 						?></li><?php
 					}
 					if ($this->conf->bottomlineFavorite ()) {
 						?><li class="item manage"><?php
 							?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
-								echo RSSThemes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
+								echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
 						?></li><?php
 					}
 				} ?>
@@ -111,8 +110,8 @@ if (!empty($this->entries)) {
 					<div class="dropdown">
 						<div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div>
 						<a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>">
-							<?php echo RSSThemes::icon('share'); ?>
-							<?php echo Translate::t ('share'); ?>
+							<?php echo FreshRSS_Themes::icon('share'); ?>
+							<?php echo Minz_Translate::t ('share'); ?>
 						</a>
 
 						<ul class="dropdown-menu">
@@ -120,49 +119,49 @@ if (!empty($this->entries)) {
 							<?php if ($logged && $shaarli) { ?>
 							<li class="item">
 								<a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&amp;title=' . $title . '&amp;source=FreshRSS'; ?>">
-									<?php echo Translate::t ('shaarli'); ?>
+									<?php echo Minz_Translate::t ('shaarli'); ?>
 								</a>
 							</li>
 							<?php } if ($logged && $poche) { ?>
 							<li class="item">
 								<a target="_blank" href="<?php echo $poche . '?action=add&amp;url=' . base64_encode (urldecode($link)); ?>">
-									<?php echo Translate::t ('poche'); ?>
+									<?php echo Minz_Translate::t ('poche'); ?>
 								</a>
 							</li>
 							<?php } if ($logged && $diaspora) { ?>
 							<li class="item">
 								<a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&amp;title=' . $title; ?>">
-									<?php echo Translate::t ('diaspora'); ?>
+									<?php echo Minz_Translate::t ('diaspora'); ?>
 								</a>
 							</li>
 							<?php } if ($twitter) { ?>
 							<li class="item">
 								<a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&amp;text=<?php echo $title; ?>">
-									<?php echo Translate::t ('twitter'); ?>
+									<?php echo Minz_Translate::t ('twitter'); ?>
 								</a>
 							</li>
 							<?php } if ($google_plus) { ?>
 							<li class="item">
 								<a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>">
-									<?php echo Translate::t ('g+'); ?>
+									<?php echo Minz_Translate::t ('g+'); ?>
 								</a>
 							</li>
 							<?php } if ($facebook) { ?>
 							<li class="item">
 								<a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&amp;t=<?php echo $title; ?>">
-									<?php echo Translate::t ('facebook'); ?>
+									<?php echo Minz_Translate::t ('facebook'); ?>
 								</a>
 							</li>
 							<?php } if ($email) { ?>
 							<li class="item">
 								<a href="mailto:?subject=<?php echo urldecode($title); ?>&amp;body=<?php echo $link; ?>">
-									<?php echo Translate::t ('by_email'); ?>
+									<?php echo Minz_Translate::t ('by_email'); ?>
 								</a>
 							</li>
 							<?php } if ($print) { ?>
 							<li class="item">
 								<a href="#" class="print-article">
-									<?php echo Translate::t ('print'); ?>
+									<?php echo Minz_Translate::t ('print'); ?>
 								</a>
 							</li>
 							<?php } ?>
@@ -178,8 +177,8 @@ if (!empty($this->entries)) {
 					<div class="dropdown">
 						<div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div>
 						<a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>">
-							<?php echo RSSThemes::icon('tag'); ?>
-							<?php echo Translate::t ('related_tags'); ?>
+							<?php echo FreshRSS_Themes::icon('tag'); ?>
+							<?php echo Minz_Translate::t ('related_tags'); ?>
 						</a>
 						<ul class="dropdown-menu">
 							<li class="dropdown-close"><a href="#close">❌</a></li>
@@ -191,7 +190,7 @@ if (!empty($this->entries)) {
 				</li>
 				<?php } ?>
 				<?php if ($this->conf->bottomlineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
-				<?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo RSSThemes::icon('link'); ?></a></li><?php } ?>
+				<?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
 			</ul>
 		</div>
 	</div>
@@ -204,6 +203,6 @@ if (!empty($this->entries)) {
 
 <?php } else { ?>
 <div id="stream" class="alert alert-warn normal">
-	<span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span>
+	<span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span>
 </div>
 <?php } ?>

+ 2 - 2
app/views/helpers/view/reader_view.phtml

@@ -21,7 +21,7 @@ if (!empty($this->entries)) {
 
 				<div class="author">
 					<?php $author = $item->author (); ?>
-					<?php echo $author != '' ? Translate::t ('by_author', $author) . ' - ' : ''; ?>
+					<?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' - ' : ''; ?>
 					<?php echo $item->date (); ?>
 				</div>
 
@@ -42,6 +42,6 @@ if (!empty($this->entries)) {
 
 <?php } else { ?>
 <div id="stream" class="alert alert-warn reader">
-	<span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span>
+	<span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span>
 </div>
 <?php } ?>

+ 3 - 3
app/views/helpers/view/rss_view.phtml

@@ -2,11 +2,11 @@
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
 	<channel>
 		<title><?php echo $this->rss_title; ?></title>
-		<link><?php echo Url::display(null, 'html', true); ?></link>
-		<description><?php echo Translate::t ('rss_feeds_of', $this->rss_title); ?></description>
+		<link><?php echo Minz_Url::display(null, 'html', true); ?></link>
+		<description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description>
 		<pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate>
 		<lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate>
-		<atom:link href="<?php echo Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" />
+		<atom:link href="<?php echo Minz_Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" />
 <?php
 foreach ($this->entries as $item) {
 ?>

+ 12 - 12
app/views/index/about.phtml

@@ -1,24 +1,24 @@
 <div class="post content">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
-	<h1><?php echo Translate::t ('about_freshrss'); ?></h1>
+	<h1><?php echo Minz_Translate::t ('about_freshrss'); ?></h1>
 
 	<dl class="infos">
-		<dt><?php echo Translate::t ('project_website'); ?></dt>
+		<dt><?php echo Minz_Translate::t ('project_website'); ?></dt>
 		<dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd>
 
-		<dt><?php echo Translate::t ('lead_developer'); ?></dt>
-		<dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> - <a href="http://marienfressinaud.fr"><?php echo Translate::t ('website'); ?></a></dd>
+		<dt><?php echo Minz_Translate::t ('lead_developer'); ?></dt>
+		<dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> - <a href="http://marienfressinaud.fr"><?php echo Minz_Translate::t ('website'); ?></a></dd>
 
-		<dt><?php echo Translate::t ('bugs_reports'); ?></dt>
-		<dd><?php echo Translate::t ('github_or_email'); ?></dd>
+		<dt><?php echo Minz_Translate::t ('bugs_reports'); ?></dt>
+		<dd><?php echo Minz_Translate::t ('github_or_email'); ?></dd>
 
-		<dt><?php echo Translate::t ('license'); ?></dt>
-		<dd><?php echo Translate::t ('agpl3'); ?></dd>
+		<dt><?php echo Minz_Translate::t ('license'); ?></dt>
+		<dd><?php echo Minz_Translate::t ('agpl3'); ?></dd>
 	</dl>
 
-	<p><?php echo Translate::t ('freshrss_description'); ?></p>
+	<p><?php echo Minz_Translate::t ('freshrss_description'); ?></p>
 
-	<h1><?php echo Translate::t ('credits'); ?></h1>
-	<p><?php echo Translate::t ('credits_content'); ?></p>
+	<h1><?php echo Minz_Translate::t ('credits'); ?></h1>
+	<p><?php echo Minz_Translate::t ('credits_content'); ?></p>
 </div>

+ 5 - 5
app/views/index/index.phtml

@@ -1,8 +1,8 @@
 <?php
 
-$output = Request::param ('output', 'normal');
+$output = Minz_Request::param ('output', 'normal');
 $token = $this->conf->token();
-$token_param = Request::param ('token', '');
+$token_param = Minz_Request::param ('token', '');
 $token_is_ok = ($token != '' && $token == $token_param);
 
 if(!login_is_conf ($this->conf) ||
@@ -21,9 +21,9 @@ if(!login_is_conf ($this->conf) ||
 } else {
 ?>
 <div class="post content">
-	<h1><?php echo Translate::t ('forbidden_access'); ?></h1>
-	<p><?php echo Translate::t ('forbidden_access_description'); ?></p>
-	<p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Translate::t ('about_freshrss'); ?></a></p>
+	<h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1>
+	<p><?php echo Minz_Translate::t ('forbidden_access_description'); ?></p>
+	<p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p>
 </div>
 <?php
 }

+ 4 - 4
app/views/index/logs.phtml

@@ -1,10 +1,10 @@
 <div class="post content">
-	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+	<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>
 
-	<h1><?php echo Translate::t ('logs'); ?></h1>
+	<h1><?php echo Minz_Translate::t ('logs'); ?></h1>
 	<form method="post" action="<?php echo _url ('index', 'logs'); ?>"><p>
 		<input type="hidden" name="clearLogs" />
-		<button type="submit" class="btn"><?php echo Translate::t ('clear_logs'); ?></button>
+		<button type="submit" class="btn"><?php echo Minz_Translate::t ('clear_logs'); ?></button>
 	</p></form>
 
 	<?php $items = $this->logsPaginator->items (); ?>
@@ -20,6 +20,6 @@
 		<?php $this->logsPaginator->render ('logs_pagination.phtml','page'); ?>
 	</div>
 	<?php } else { ?>
-	<p class="alert alert-warn"><?php echo Translate::t ('logs_empty'); ?></p>
+	<p class="alert alert-warn"><?php echo Minz_Translate::t ('logs_empty'); ?></p>
 	<?php } ?>
 </div>

+ 2 - 2
app/views/javascript/actualize.phtml

@@ -1,12 +1,12 @@
 var feeds = new Array ();
 <?php foreach ($this->feeds as $feed) { ?>
-feeds.push ("<?php echo Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>");
+feeds.push ("<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>");
 <?php } ?>
 
 function initProgressBar (init) {
 	if (init) {
 		$("body").after ("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\
-			<?php echo Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feeds.length + "</span><br />\
+			<?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feeds.length + "</span><br />\
 			<progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feeds.length + "\"></progress>\
 		</div>");
 	} else {

+ 9 - 0
lib/Minz/ActionException.php

@@ -0,0 +1,9 @@
+<?php
+class Minz_ActionException extends Minz_Exception {
+	public function __construct ($controller_name, $action_name, $code = self::ERROR) {
+		$message = '`' . $action_name . '` cannot be invoked on `'
+		         . $controller_name . '`';
+		
+		parent::__construct ($message, $code);
+	}
+}

+ 9 - 0
lib/Minz/BadConfigurationException.php

@@ -0,0 +1,9 @@
+<?php
+class Minz_BadConfigurationException extends Minz_Exception {
+	public function __construct ($part_missing, $code = self::ERROR) {
+		$message = '`' . $part_missing
+		         . '` in the configuration file is missing or is misconfigured';
+		
+		parent::__construct ($message, $code);
+	}
+}

+ 3 - 3
lib/minz/Minz_Cache.php → lib/Minz/Cache.php

@@ -35,7 +35,7 @@ class Minz_Cache {
 	 * Setteurs
 	 */
 	public function _fileName () {
-		$file = md5 (Request::getURI ());
+		$file = md5 (Minz_Request::getURI ());
 
 		$this->file = CACHE_PATH . '/'.$file;
 	}
@@ -43,7 +43,7 @@ class Minz_Cache {
 	public function _expire () {
 		if ($this->exist ()) {
 			$this->expire = filemtime ($this->file)
-			              + Configuration::delayCache ();
+			              + Minz_Configuration::delayCache ();
 		}
 	}
 
@@ -52,7 +52,7 @@ class Minz_Cache {
 	 * @return true si activé, false sinon
 	 */
 	public static function isEnabled () {
-		return Configuration::cacheEnabled () && self::$enabled;
+		return Minz_Configuration::cacheEnabled () && self::$enabled;
 	}
 
 	/**

+ 9 - 0
lib/Minz/ControllerNotActionControllerException.php

@@ -0,0 +1,9 @@
+<?php
+class Minz_ControllerNotActionControllerException extends Minz_Exception {
+	public function __construct ($controller_name, $code = self::ERROR) {
+		$message = 'Controller `' . $controller_name
+		         . '` isn\'t instance of ActionController';
+		
+		parent::__construct ($message, $code);
+	}
+}

+ 9 - 0
lib/Minz/ControllerNotExistException.php

@@ -0,0 +1,9 @@
+<?php
+class Minz_ControllerNotExistException extends Minz_Exception {
+	public function __construct ($controller_name, $code = self::ERROR) {
+		$message = 'Controller `' . $controller_name
+		         . '` doesn\'t exist';
+		
+		parent::__construct ($message, $code);
+	}
+}

+ 8 - 0
lib/Minz/CurrentPagePaginationException.php

@@ -0,0 +1,8 @@
+<?php
+class Minz_CurrentPagePaginationException extends Minz_Exception {
+	public function __construct ($page) {
+		$message = 'Page number `' . $page . '` doesn\'t exist';
+		
+		parent::__construct ($message, self::ERROR);
+	}
+}

+ 16 - 0
lib/Minz/Exception.php

@@ -0,0 +1,16 @@
+<?php
+class Minz_Exception extends Exception {
+	const ERROR = 0;
+	const WARNING = 10;
+	const NOTICE = 20;
+
+	public function __construct ($message, $code = self::ERROR) {
+		if ($code != Minz_Exception::ERROR
+		 && $code != Minz_Exception::WARNING
+		 && $code != Minz_Exception::NOTICE) {
+			$code = Minz_Exception::ERROR;
+		}
+
+		parent::__construct ($message, $code);
+	}
+}

+ 8 - 0
lib/Minz/FileNotExistException.php

@@ -0,0 +1,8 @@
+<?php
+class Minz_FileNotExistException extends Minz_Exception {
+	public function __construct ($file_name, $code = self::ERROR) {
+		$message = 'File doesn\'t exist : `' . $file_name.'`';
+		
+		parent::__construct ($message, $code);
+	}
+}

+ 6 - 6
lib/minz/Minz_Log.php → lib/Minz/Log.php

@@ -31,10 +31,10 @@ class Minz_Log {
 	 * @param $file_name fichier de log, par défaut LOG_PATH/application.log
 	 */
 	public static function record ($information, $level, $file_name = null) {
-		$env = Configuration::environment ();
+		$env = Minz_Configuration::environment ();
 		
-		if (! ($env === Configuration::SILENT
-		       || ($env === Configuration::PRODUCTION
+		if (! ($env === Minz_Configuration::SILENT
+		       || ($env === Minz_Configuration::PRODUCTION
 		       && ($level >= Minz_Log::NOTICE)))) {
 			if (is_null ($file_name)) {
 				$file_name = LOG_PATH . '/application.log';
@@ -57,7 +57,7 @@ class Minz_Log {
 				$level_label = 'unknown';
 			}
 			
-			if ($env == Configuration::PRODUCTION) {
+			if ($env == Minz_Configuration::PRODUCTION) {
 				$file = @fopen ($file_name, 'a');
 			} else {
 				$file = fopen ($file_name, 'a');
@@ -70,9 +70,9 @@ class Minz_Log {
 				fwrite ($file, $log); 
 				fclose ($file);
 			} else {
-				throw new PermissionDeniedException (
+				throw new Minz_PermissionDeniedException (
 					$file_name,
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 		}

+ 3 - 3
lib/minz/dao/Model_array.php → lib/Minz/ModelArray.php

@@ -7,7 +7,7 @@
 /**
  * La classe Model_array représente le modèle interragissant avec les fichiers de type texte gérant des tableaux php
  */
-class Model_array extends Model_txt {
+class Minz_ModelArray extends Minz_ModelTxt {
 	/**
 	 * $array Le tableau php contenu dans le fichier $nameFile
 	 */
@@ -22,7 +22,7 @@ class Model_array extends Model_txt {
 		parent::__construct ($nameFile);
 		
 		if (!$this->getLock ('read')) {
-			throw new PermissionDeniedException ($this->filename);
+			throw new Minz_PermissionDeniedException ($this->filename);
 		} else {
 			$this->array = include ($this->filename);
 			$this->releaseLock ();
@@ -41,7 +41,7 @@ class Model_array extends Model_txt {
 	 **/
 	public function writeFile ($array) {
 		if (!$this->getLock ('write')) {
-			throw new PermissionDeniedException ($this->namefile);
+			throw new Minz_PermissionDeniedException ($this->namefile);
 		} else {
 			$this->erase ();
 		

+ 6 - 6
lib/minz/dao/Model_pdo.php → lib/Minz/ModelPdo.php

@@ -8,7 +8,7 @@
  * La classe Model_sql représente le modèle interragissant avec les bases de données
  * Seul la connexion MySQL est prise en charge pour le moment
  */
-class Model_pdo {
+class Minz_ModelPdo {
 
 	/**
 	 * Partage la connexion à la base de données entre toutes les instances.
@@ -35,7 +35,7 @@ class Model_pdo {
 			return;
 		}
 
-		$db = Configuration::dataBase ();
+		$db = Minz_Configuration::dataBase ();
 		$driver_options = null;
 
 		try {
@@ -60,13 +60,13 @@ class Model_pdo {
 			);
 			self::$sharedBd = $this->bd;
 
-			$userPrefix = Configuration::currentUser ();
+			$userPrefix = Minz_Configuration::currentUser ();
 			$this->prefix = $db['prefix'] . (empty($userPrefix) ? '' : ($userPrefix . '_'));
 			self::$sharedPrefix = $this->prefix;
 		} catch (Exception $e) {
-			throw new PDOConnectionException (
+			throw new Minz_PDOConnectionException (
 				$string,
-				$db['user'], MinzException::ERROR
+				$db['user'], Minz_Exception::ERROR
 			);
 		}
 	}
@@ -82,7 +82,7 @@ class Model_pdo {
 	}
 
 	public function size() {
-		$db = Configuration::dataBase ();
+		$db = Minz_Configuration::dataBase ();
 		$sql = 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = ?';
 		$stm = $this->bd->prepare ($sql);
 		$values = array ($db['base']);

+ 5 - 5
lib/minz/dao/Model_txt.php → lib/Minz/ModelTxt.php

@@ -7,7 +7,7 @@
 /**
  * La classe Model_txt représente le modèle interragissant avec les fichiers de type texte
  */
-class Model_txt {
+class Minz_ModelTxt {
 	/**
 	 * $file représente le fichier à ouvrir
 	 */
@@ -28,18 +28,18 @@ class Model_txt {
 	public function __construct ($nameFile, $mode = 'a+') {
 		$this->filename = $nameFile;
 		if (!file_exists($this->filename)) {
-			throw new FileNotExistException (
+			throw new Minz_FileNotExistException (
 				$this->filename,
-				MinzException::WARNING
+				Minz_Exception::WARNING
 			);
 		}
 
 		$this->file = @fopen ($this->filename, $mode);
 		
 		if (!$this->file) {
-			throw new PermissionDeniedException (
+			throw new Minz_PermissionDeniedException (
 				$this->filename,
-				MinzException::WARNING
+				Minz_Exception::WARNING
 			);
 		}
 	}

+ 9 - 0
lib/Minz/PDOConnectionException.php

@@ -0,0 +1,9 @@
+<?php
+class Minz_PDOConnectionException extends Minz_Exception {
+	public function __construct ($string_connection, $user, $code = self::ERROR) {
+		$message = 'Access to database is denied for `' . $user . '`'
+		         . ' (`' . $string_connection . '`)';
+		
+		parent::__construct ($message, $code);
+	}
+}

+ 8 - 0
lib/Minz/PermissionDeniedException.php

@@ -0,0 +1,8 @@
+<?php
+class Minz_PermissionDeniedException extends Minz_Exception {
+	public function __construct ($file_name, $code = self::ERROR) {
+		$message = 'Permission is denied for `' . $file_name.'`';
+
+		parent::__construct ($message, $code);
+	}
+}

+ 16 - 0
lib/Minz/RouteNotFoundException.php

@@ -0,0 +1,16 @@
+<?php
+class Minz_RouteNotFoundException extends Minz_Exception {
+	private $route;
+	
+	public function __construct ($route, $code = self::ERROR) {
+		$this->route = $route;
+		
+		$message = 'Route `' . $route . '` not found';
+		
+		parent::__construct ($message, $code);
+	}
+	
+	public function route () {
+		return $this->route;
+	}
+}

+ 0 - 86
lib/SimplePie_autoloader.php

@@ -1,86 +0,0 @@
-<?php
-/**
- * SimplePie
- *
- * A PHP-Based RSS and Atom Feed Framework.
- * Takes the hard work out of managing a complete RSS/Atom solution.
- *
- * Copyright (c) 2004-2009, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- * 	* Redistributions of source code must retain the above copyright notice, this list of
- * 	  conditions and the following disclaimer.
- *
- * 	* Redistributions in binary form must reproduce the above copyright notice, this list
- * 	  of conditions and the following disclaimer in the documentation and/or other materials
- * 	  provided with the distribution.
- *
- * 	* Neither the name of the SimplePie Team nor the names of its contributors may be used
- * 	  to endorse or promote products derived from this software without specific prior
- * 	  written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
- * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * @package SimplePie
- * @version 1.3.1
- * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
- * @author Ryan Parman
- * @author Geoffrey Sneddon
- * @author Ryan McCue
- * @link http://simplepie.org/ SimplePie
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- */
-
-
-// autoloader
-spl_autoload_register(array(new SimplePie_Autoloader(), 'autoload'));
-
-if (!class_exists('SimplePie'))
-{
-	trigger_error('Autoloader not registered properly', E_USER_ERROR);
-}
-
-/**
- * Autoloader class
- *
- * @package SimplePie
- * @subpackage API
- */
-class SimplePie_Autoloader
-{
-	/**
-	 * Constructor
-	 */
-	public function __construct()
-	{
-		$this->path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'SimplePie';
-	}
-
-	/**
-	 * Autoloader
-	 *
-	 * @param string $class The name of the class to attempt to load.
-	 */
-	public function autoload($class)
-	{
-		// Only load the class if it starts with "SimplePie"
-		if (strpos($class, 'SimplePie') !== 0)
-		{
-			return;
-		}
-
-		$filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
-		include $filename;
-	}
-}

+ 35 - 10
lib/lib_rss.php

@@ -15,6 +15,31 @@ if (!function_exists('json_encode')) {
 	}
 }
 
+//<Auto-loading>
+function classAutoloader($class) {
+	if (strpos($class, 'FreshRSS') === 0) {
+		$components = explode('_', $class);
+		switch (count($components)) {
+			case 1:
+				include(APP_PATH . '/' . $components[0] . '.php');
+				return;
+			case 2:
+				include(APP_PATH . '/Models/' . $components[1] . '.php');
+				return;
+			case 3:	//Controllers, Exceptions
+				include(APP_PATH . '/' . $components[2] . 's/' . $components[1] . $components[2] . '.php');
+				return;
+		}
+	} elseif (strpos($class, 'Minz') === 0) {
+		include(LIB_PATH . '/' . str_replace('_', '/', $class) . '.php');
+	} elseif (strpos($class, 'SimplePie') === 0) {
+		include(LIB_PATH . '/SimplePie/' . str_replace('_', '/', $class) . '.php');
+	}
+}
+
+spl_autoload_register('classAutoloader');
+//</Auto-loading>
+
 function checkUrl($url) {
 	if (empty ($url)) {
 		return '';
@@ -33,7 +58,7 @@ function checkUrl($url) {
 
 // vérifie qu'on est connecté
 function is_logged () {
-	return Session::param ('mail') != false;
+	return Minz_Session::param ('mail') != false;
 }
 
 // vérifie que le système d'authentification est configuré
@@ -63,11 +88,11 @@ function formatBytes($bytes, $precision = 2, $system = 'IEC') {
 }
 
 function timestamptodate ($t, $hour = true) {
-	$month = Translate::t (date('M', $t));
+	$month = Minz_Translate::t (date('M', $t));
 	if ($hour) {
-		$date = Translate::t ('format_date_hour', $month);
+		$date = Minz_Translate::t ('format_date_hour', $month);
 	} else {
-		$date = Translate::t ('format_date', $month);
+		$date = Minz_Translate::t ('format_date', $month);
 	}
 
 	return @date ($date, $t);
@@ -123,10 +148,10 @@ function opml_import ($xml) {
 	$opml = simplexml_import_dom($dom);
 
 	if (!$opml) {
-		throw new OpmlException ();
+		throw new FreshRSS_Opml_Exception ();
 	}
 
-	$catDAO = new CategoryDAO();
+	$catDAO = new FreshRSS_CategoryDAO();
 	$catDAO->checkDefault();
 	$defCat = $catDAO->getDefault();
 
@@ -152,10 +177,10 @@ function opml_import ($xml) {
 				// Y ne sera pas ajouté et le flux non plus vu que l'id
 				// de sa catégorie n'exisera pas
 				$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
-				$catDAO = new CategoryDAO ();
+				$catDAO = new FreshRSS_CategoryDAO ();
 				$cat = $catDAO->searchByName ($title);
 				if ($cat === false) {
-					$cat = new Category ($title);
+					$cat = new FreshRSS_Category ($title);
 					$values = array (
 						'name' => $cat->name (),
 						'color' => $cat->color ()
@@ -204,7 +229,7 @@ function getFeed ($outline, $cat_id) {
 		$title = (string) $outline['title'];
 	}
 	$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
-	$feed = new Feed ($url);
+	$feed = new FreshRSS_Feed ($url);
 	$feed->_category ($cat_id);
 	$feed->_name ($title);
 	if (isset($outline['htmlUrl'])) {
@@ -250,7 +275,7 @@ function get_content_by_parsing ($url, $path) {
 function lazyimg($content) {
 	return preg_replace(
 		'/<img([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i',
-		'<img$1src="' . Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>',
+		'<img$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>',
 		$content
 	);
 }

+ 2 - 2
lib/minz/ActionController.php

@@ -7,7 +7,7 @@
 /**
  * La classe ActionController représente le contrôleur de l'application
  */
-class ActionController {
+class Minz_ActionController {
 	protected $router;
 	protected $view;
 
@@ -18,7 +18,7 @@ class ActionController {
 	 */
 	public function __construct ($router) {
 		$this->router = $router;
-		$this->view = new View ();
+		$this->view = new Minz_View ();
 		$this->view->attributeParams ();
 	}
 

+ 30 - 30
lib/minz/Configuration.php

@@ -7,7 +7,7 @@
 /**
  * La classe Configuration permet de gérer la configuration de l'application
  */
-class Configuration {
+class Minz_Configuration {
 	const CONF_PATH_NAME = '/application.ini';
 
 	/**
@@ -43,7 +43,7 @@ class Configuration {
 	 *     - base le nom de la base de données
 	 */
 	private static $sel_application = '';
-	private static $environment = Configuration::PRODUCTION;
+	private static $environment = Minz_Configuration::PRODUCTION;
 	private static $base_url = '';
 	private static $use_url_rewriting = false;
 	private static $title = '';
@@ -99,30 +99,30 @@ class Configuration {
 
 	/**
 	 * Initialise les variables de configuration
-	 * @exception FileNotExistException si le CONF_PATH_NAME n'existe pas
-	 * @exception BadConfigurationException si CONF_PATH_NAME mal formaté
+	 * @exception Minz_FileNotExistException si le CONF_PATH_NAME n'existe pas
+	 * @exception Minz_BadConfigurationException si CONF_PATH_NAME mal formaté
 	 */
 	public static function init () {
 		try {
 			self::parseFile ();
 			self::setReporting ();
-		} catch (FileNotExistException $e) {
+		} catch (Minz_FileNotExistException $e) {
 			throw $e;
-		} catch (BadConfigurationException $e) {
+		} catch (Minz_BadConfigurationException $e) {
 			throw $e;
 		}
 	}
 
 	/**
 	 * Parse un fichier de configuration de type ".ini"
-	 * @exception FileNotExistException si le CONF_PATH_NAME n'existe pas
-	 * @exception BadConfigurationException si CONF_PATH_NAME mal formaté
+	 * @exception Minz_FileNotExistException si le CONF_PATH_NAME n'existe pas
+	 * @exception Minz_BadConfigurationException si CONF_PATH_NAME mal formaté
 	 */
 	private static function parseFile () {
 		if (!file_exists (DATA_PATH . self::CONF_PATH_NAME)) {
-			throw new FileNotExistException (
+			throw new Minz_FileNotExistException (
 				DATA_PATH . self::CONF_PATH_NAME,
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 
@@ -132,17 +132,17 @@ class Configuration {
 		);
 
 		if (!$ini_array) {
-			throw new PermissionDeniedException (
+			throw new Minz_PermissionDeniedException (
 				DATA_PATH . self::CONF_PATH_NAME,
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 
 		// [general] est obligatoire
 		if (!isset ($ini_array['general'])) {
-			throw new BadConfigurationException (
+			throw new Minz_BadConfigurationException (
 				'[general]',
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 		$general = $ini_array['general'];
@@ -150,9 +150,9 @@ class Configuration {
 
 		// sel_application est obligatoire
 		if (!isset ($general['sel_application'])) {
-			throw new BadConfigurationException (
+			throw new Minz_BadConfigurationException (
 				'sel_application',
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 		self::$sel_application = $general['sel_application'];
@@ -160,18 +160,18 @@ class Configuration {
 		if (isset ($general['environment'])) {
 			switch ($general['environment']) {
 			case 'silent':
-				self::$environment = Configuration::SILENT;
+				self::$environment = Minz_Configuration::SILENT;
 				break;
 			case 'development':
-				self::$environment = Configuration::DEVELOPMENT;
+				self::$environment = Minz_Configuration::DEVELOPMENT;
 				break;
 			case 'production':
-				self::$environment = Configuration::PRODUCTION;
+				self::$environment = Minz_Configuration::PRODUCTION;
 				break;
 			default:
-				throw new BadConfigurationException (
+				throw new Minz_BadConfigurationException (
 					'environment',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 
@@ -194,7 +194,7 @@ class Configuration {
 			if (CACHE_PATH === false && self::$cache_enabled) {
 				throw new FileNotExistException (
 					'CACHE_PATH',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 		}
@@ -213,27 +213,27 @@ class Configuration {
 		}
 		if ($db) {
 			if (!isset ($db['host'])) {
-				throw new BadConfigurationException (
+				throw new Minz_BadConfigurationException (
 					'host',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 			if (!isset ($db['user'])) {
-				throw new BadConfigurationException (
+				throw new Minz_BadConfigurationException (
 					'user',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 			if (!isset ($db['password'])) {
-				throw new BadConfigurationException (
+				throw new Minz_BadConfigurationException (
 					'password',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 			if (!isset ($db['base'])) {
-				throw new BadConfigurationException (
+				throw new Minz_BadConfigurationException (
 					'base',
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 

+ 20 - 34
lib/minz/Dispatcher.php

@@ -9,8 +9,8 @@
  * déterminée dans la Request
  * C'est un singleton
  */
-class Dispatcher {
-	const CONTROLLERS_PATH_NAME = '/controllers';
+class Minz_Dispatcher {
+	const CONTROLLERS_PATH_NAME = '/Controllers';
 
 	/* singleton */
 	private static $instance = null;
@@ -23,7 +23,7 @@ class Dispatcher {
 	 */
 	public static function getInstance ($router) {
 		if (is_null (self::$instance)) {
-			self::$instance = new Dispatcher ($router);
+			self::$instance = new Minz_Dispatcher ($router);
 		}
 		return self::$instance;
 	}
@@ -38,7 +38,7 @@ class Dispatcher {
 	/**
 	 * Lance le controller indiqué dans Request
 	 * Remplit le body de Response à partir de la Vue
-	 * @exception MinzException
+	 * @exception Minz_Exception
 	 */
 	public function run () {
 		$cache = new Minz_Cache();
@@ -53,29 +53,25 @@ class Dispatcher {
 			$cache->render ();
 			$text = ob_get_clean();
 		} else {
-			while (Request::$reseted) {
-				Request::$reseted = false;
+			while (Minz_Request::$reseted) {
+				Minz_Request::$reseted = false;
 
 				try {
-					$this->createController (
-						Request::controllerName ()
-						. 'Controller'
-					);
-
+					$this->createController ('FreshRSS_' . Minz_Request::controllerName () . '_Controller');
 					$this->controller->init ();
 					$this->controller->firstAction ();
 					$this->launchAction (
-						Request::actionName ()
+						Minz_Request::actionName ()
 						. 'Action'
 					);
 					$this->controller->lastAction ();
 
-					if (!Request::$reseted) {
+					if (!Minz_Request::$reseted) {
 						ob_start ();
 						$this->controller->view ()->build ();
 						$text = ob_get_clean();
 					}
-				} catch (MinzException $e) {
+				} catch (Minz_Exception $e) {
 					throw $e;
 				}
 			}
@@ -85,14 +81,12 @@ class Dispatcher {
 			}
 		}
 
-		Response::setBody ($text);
+		Minz_Response::setBody ($text);
 	}
 
 	/**
 	 * Instancie le Controller
 	 * @param $controller_name le nom du controller à instancier
-	 * @exception FileNotExistException le fichier correspondant au
-	 *          > controller n'existe pas
 	 * @exception ControllerNotExistException le controller n'existe pas
 	 * @exception ControllerNotActionControllerException controller n'est
 	 *          > pas une instance de ActionController
@@ -101,26 +95,18 @@ class Dispatcher {
 		$filename = APP_PATH . self::CONTROLLERS_PATH_NAME . '/'
 		          . $controller_name . '.php';
 
-		if (!file_exists ($filename)) {
-			throw new FileNotExistException (
-				$filename,
-				MinzException::ERROR
-			);
-		}
-		require_once ($filename);
-
 		if (!class_exists ($controller_name)) {
-			throw new ControllerNotExistException (
+			throw new Minz_ControllerNotExistException (
 				$controller_name,
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 		$this->controller = new $controller_name ($this->router);
 
-		if (! ($this->controller instanceof ActionController)) {
-			throw new ControllerNotActionControllerException (
+		if (! ($this->controller instanceof Minz_ActionController)) {
+			throw new Minz_ControllerNotActionControllerException (
 				$controller_name,
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 	}
@@ -129,18 +115,18 @@ class Dispatcher {
 	 * Lance l'action sur le controller du dispatcher
 	 * @param $action_name le nom de l'action
 	 * @exception ActionException si on ne peut pas exécuter l'action sur
-	 *          > le controller
+	 *  le controller
 	 */
 	private function launchAction ($action_name) {
-		if (!Request::$reseted) {
+		if (!Minz_Request::$reseted) {
 			if (!is_callable (array (
 				$this->controller,
 				$action_name
 			))) {
-				throw new ActionException (
+				throw new Minz_ActionException (
 					get_class ($this->controller),
 					$action_name,
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 			call_user_func (array (

+ 20 - 20
lib/minz/Error.php

@@ -1,5 +1,5 @@
 <?php
-/** 
+/**
  * MINZ - Copyright 2011 Marien Fressinaud
  * Sous licence AGPL3 <http://www.gnu.org/licenses/>
 */
@@ -7,7 +7,7 @@
 /**
  * La classe Error permet de lancer des erreurs HTTP
  */
-class Error {
+class Minz_Error {
 	public function __construct () { }
 
 	/**
@@ -21,28 +21,28 @@ class Error {
 	*/
 	public static function error ($code = 404, $logs = array (), $redirect = false) {
 		$logs = self::processLogs ($logs);
-		$error_filename = APP_PATH . '/controllers/errorController.php';
-		
+		$error_filename = APP_PATH . '/Controllers/ErrorController.php';
+
 		if (file_exists ($error_filename)) {
 			$params = array (
 				'code' => $code,
 				'logs' => $logs
 			);
-			
-			Response::setHeader ($code);
+
+			Minz_Response::setHeader ($code);
 			if ($redirect) {
-				Request::forward (array (
+				Minz_Request::forward (array (
 					'c' => 'error'
 				), true);
 			} else {
-				Request::forward (array (
+				Minz_Request::forward (array (
 					'c' => 'error',
 					'params' => $params
 				), false);
 			}
 		} else {
 			$text = '<h1>An error occured</h1>'."\n";
-			
+
 			if (!empty ($logs)) {
 				$text .= '<ul>'."\n";
 				foreach ($logs as $log) {
@@ -50,14 +50,14 @@ class Error {
 				}
 				$text .= '</ul>'."\n";
 			}
-			
-			Response::setHeader ($code);
-			Response::setBody ($text);
-			Response::send ();
+
+			Minz_Response::setHeader ($code);
+			Minz_Response::setBody ($text);
+			Minz_Response::send ();
 			exit ();
 		}
 	}
-	
+
 	/**
 	 * Permet de retourner les logs de façon à n'avoir que
 	 * ceux que l'on veut réellement
@@ -66,12 +66,12 @@ class Error {
 	 *       > en fonction de l'environment
 	 */
 	private static function processLogs ($logs) {
-		$env = Configuration::environment ();
+		$env = Minz_Configuration::environment ();
 		$logs_ok = array ();
 		$error = array ();
 		$warning = array ();
 		$notice = array ();
-		
+
 		if (isset ($logs['error'])) {
 			$error = $logs['error'];
 		}
@@ -81,14 +81,14 @@ class Error {
 		if (isset ($logs['notice'])) {
 			$notice = $logs['notice'];
 		}
-		
-		if ($env == Configuration::PRODUCTION) {
+
+		if ($env == Minz_Configuration::PRODUCTION) {
 			$logs_ok = $error;
 		}
-		if ($env == Configuration::DEVELOPMENT) {
+		if ($env == Minz_Configuration::DEVELOPMENT) {
 			$logs_ok = array_merge ($error, $warning, $notice);
 		}
-		
+
 		return $logs_ok;
 	}
 }

+ 25 - 55
lib/minz/FrontController.php

@@ -2,109 +2,79 @@
 # ***** BEGIN LICENSE BLOCK *****
 # MINZ - a free PHP Framework like Zend Framework
 # Copyright (C) 2011 Marien Fressinaud
-# 
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
 # published by the Free Software Foundation, either version 3 of the
 # License, or (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU Affero General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # ***** END LICENSE BLOCK *****
 
 /**
- * La classe FrontController est le noyau du framework, elle lance l'application
+ * La classe FrontController est le Dispatcher du framework, elle lance l'application
  * Elle est appelée en général dans le fichier index.php à la racine du serveur
  */
-class FrontController {
+class Minz_FrontController {
 	protected $dispatcher;
 	protected $router;
-	
+
 	/**
 	 * Constructeur
 	 * Initialise le router et le dispatcher
 	 */
 	public function __construct () {
-		$this->loadLib ();
-
 		if (LOG_PATH === false) {
 			$this->killApp ('Path doesn\'t exist : LOG_PATH');
 		}
-		
+
 		try {
-			Configuration::init ();
+			Minz_Configuration::init ();
 
-			Request::init ();
+			Minz_Request::init ();
 
-			$this->router = new Router ();
+			$this->router = new Minz_Router ();
 			$this->router->init ();
-		} catch (RouteNotFoundException $e) {
+		} catch (Minz_RouteNotFoundException $e) {
 			Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
-			Error::error (
+			Minz_Error::error (
 				404,
 				array ('error' => array ($e->getMessage ()))
 			);
-		} catch (MinzException $e) {
+		} catch (Minz_Exception $e) {
 			Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
 			$this->killApp ($e->getMessage ());
 		}
-		
-		$this->dispatcher = Dispatcher::getInstance ($this->router);
-	}
-	
-	/**
-	 * Inclue les fichiers de la librairie
-	 */
-	private function loadLib () {
-		require ('ActionController.php');
-		require ('Minz_Cache.php');
-		require ('Configuration.php');
-		require ('Dispatcher.php');
-		require ('Error.php');
-		require ('Helper.php');
-		require ('Minz_Log.php');
-		require ('Model.php');
-		require ('Paginator.php');
-		require ('Request.php');
-		require ('Response.php');
-		require ('Router.php');
-		require ('Session.php');
-		require ('Translate.php');
-		require ('Url.php');
-		require ('View.php');
-		
-		require ('dao/Model_pdo.php');
-		require ('dao/Model_txt.php');
-		require ('dao/Model_array.php');
-		
-		require ('exceptions/MinzException.php');
+
+		$this->dispatcher = Minz_Dispatcher::getInstance ($this->router);
 	}
-	
+
 	/**
 	 * Démarre l'application (lance le dispatcher et renvoie la réponse
 	 */
 	public function run () {
 		try {
 			$this->dispatcher->run ();
-			Response::send ();
-		} catch (MinzException $e) {
+			Minz_Response::send ();
+		} catch (Minz_Exception $e) {
 			try {
 				Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
-			} catch (PermissionDeniedException $e) {
+			} catch (Minz_PermissionDeniedException $e) {
 				$this->killApp ($e->getMessage ());
 			}
 
-			if ($e instanceof FileNotExistException ||
-					$e instanceof ControllerNotExistException ||
-					$e instanceof ControllerNotActionControllerException ||
-					$e instanceof ActionException) {
-				Error::error (
+			if ($e instanceof Minz_FileNotExistException ||
+					$e instanceof Minz_ControllerNotExistException ||
+					$e instanceof Minz_ControllerNotActionControllerException ||
+					$e instanceof Minz_ActionException) {
+				Minz_Error::error (
 					404,
 					array ('error' => array ($e->getMessage ())),
 					true
@@ -114,7 +84,7 @@ class FrontController {
 			}
 		}
 	}
-	
+
 	/**
 	* Permet d'arrêter le programme en urgence
 	*/

+ 1 - 1
lib/minz/Helper.php

@@ -7,7 +7,7 @@
 /**
  * La classe Helper représente une aide pour des tâches récurrentes
  */
-class Helper {
+class Minz_Helper {
 	/**
 	 * Annule les effets des magic_quotes pour une variable donnée
 	 * @param $var variable à traiter (tableau ou simple variable)

+ 1 - 1
lib/minz/Model.php

@@ -7,6 +7,6 @@
 /**
  * La classe Model représente un modèle de l'application (représentation MVC)
  */
-class Model {
+class Minz_Model {
 
 }

+ 1 - 1
lib/minz/Paginator.php

@@ -7,7 +7,7 @@
 /**
  * La classe Paginator permet de gérer la pagination de l'application facilement
  */
-class Paginator {
+class Minz_Paginator {
 	/**
 	 * $items tableau des éléments à afficher/gérer
 	 */

+ 7 - 9
lib/minz/Request.php

@@ -7,7 +7,7 @@
 /**
  * Request représente la requête http
  */
-class Request {
+class Minz_Request {
 	private static $controller_name = '';
 	private static $action_name = '';
 	private static $params = array ();
@@ -96,7 +96,7 @@ class Request {
 	 * @return la base de l'url
 	 */
 	public static function getBaseUrl () {
-		return Configuration::baseUrl ();
+		return Minz_Configuration::baseUrl ();
 	}
 
 	/**
@@ -124,10 +124,10 @@ class Request {
 	 *                > sinon, le dispatcher recharge en interne
 	 */
 	public static function forward ($url = array (), $redirect = false) {
-		$url = Url::checkUrl ($url);
+		$url = Minz_Url::checkUrl ($url);
 
 		if ($redirect) {
-			header ('Location: ' . Url::display ($url, 'php'));
+			header ('Location: ' . Minz_Url::display ($url, 'php'));
 			exit ();
 		} else {
 			self::$reseted = true;
@@ -185,9 +185,9 @@ class Request {
 	 */
 	private static function magicQuotesOff () {
 		if (get_magic_quotes_gpc ()) {
-			$_GET = Helper::stripslashes_r ($_GET);
-			$_POST = Helper::stripslashes_r ($_POST);
-			$_COOKIE = Helper::stripslashes_r ($_COOKIE);
+			$_GET = Minz_Helper::stripslashes_r ($_GET);
+			$_POST = Minz_Helper::stripslashes_r ($_POST);
+			$_COOKIE = Minz_Helper::stripslashes_r ($_COOKIE);
 		}
 	}
 
@@ -195,5 +195,3 @@ class Request {
 		return !empty ($_POST) || !empty ($_FILES);
 	}
 }
-
-

+ 1 - 1
lib/minz/Response.php

@@ -7,7 +7,7 @@
 /**
  * Response représente la requête http renvoyée à l'utilisateur
  */
-class Response {
+class Minz_Response {
 	private static $header = 'HTTP/1.0 200 OK';
 	private static $body = '';
 	

+ 17 - 17
lib/minz/Router.php

@@ -8,7 +8,7 @@
  * La classe Router gère le routage de l'application
  * Les routes sont définies dans APP_PATH.'/configuration/routes.php'
  */
-class Router {
+class Minz_Router {
 	const ROUTES_PATH_NAME = '/configuration/routes.php';
 
 	private $routes = array ();
@@ -19,7 +19,7 @@ class Router {
 	 *            et que l'on utilise l'url rewriting
 	 */
 	public function __construct () {
-		if (Configuration::useUrlRewriting ()) {
+		if (Minz_Configuration::useUrlRewriting ()) {
 			if (file_exists (APP_PATH . self::ROUTES_PATH_NAME)) {
 				$routes = include (
 					APP_PATH . self::ROUTES_PATH_NAME
@@ -34,9 +34,9 @@ class Router {
 					$routes
 				);
 			} else {
-				throw new FileNotExistException (
+				throw new Minz_FileNotExistException (
 					self::ROUTES_PATH_NAME,
-					MinzException::ERROR
+					Minz_Exception::ERROR
 				);
 			}
 		}
@@ -51,10 +51,10 @@ class Router {
 	public function init () {
 		$url = array ();
 		
-		if (Configuration::useUrlRewriting ()) {
+		if (Minz_Configuration::useUrlRewriting ()) {
 			try {
 				$url = $this->buildWithRewriting ();
-			} catch (RouteNotFoundException $e) {
+			} catch (Minz_RouteNotFoundException $e) {
 				throw $e;
 			}
 		} else {
@@ -63,10 +63,10 @@ class Router {
 		
 		$url['params'] = array_merge (
 			$url['params'],
-			Request::fetchPOST ()
+			Minz_Request::fetchPOST ()
 		);
 		
-		Request::forward ($url);
+		Minz_Request::forward ($url);
 	}
 	
 	/**
@@ -77,15 +77,15 @@ class Router {
 	public function buildWithoutRewriting () {
 		$url = array ();
 		
-		$url['c'] = Request::fetchGET (
+		$url['c'] = Minz_Request::fetchGET (
 			'c',
-			Request::defaultControllerName ()
+			Minz_Request::defaultControllerName ()
 		);
-		$url['a'] = Request::fetchGET (
+		$url['a'] = Minz_Request::fetchGET (
 			'a',
-			Request::defaultActionName ()
+			Minz_Request::defaultActionName ()
 		);
-		$url['params'] = Request::fetchGET ();
+		$url['params'] = Minz_Request::fetchGET ();
 		
 		// post-traitement
 		unset ($url['params']['c']);
@@ -103,7 +103,7 @@ class Router {
 	 */
 	public function buildWithRewriting () {
 		$url = array ();
-		$uri = Request::getURI ();
+		$uri = Minz_Request::getURI ();
 		$find = false;
 		
 		foreach ($this->routes as $route) {
@@ -121,14 +121,14 @@ class Router {
 		}
 		
 		if (!$find && $uri != '/') {
-			throw new RouteNotFoundException (
+			throw new Minz_RouteNotFoundException (
 				$uri,
-				MinzException::ERROR
+				Minz_Exception::ERROR
 			);
 		}
 		
 		// post-traitement
-		$url = Url::checkUrl ($url);
+		$url = Minz_Url::checkUrl ($url);
 		
 		return $url;
 	}

+ 3 - 3
lib/minz/Session.php

@@ -4,7 +4,7 @@
  * La classe Session gère la session utilisateur
  * C'est un singleton
  */
-class Session {
+class Minz_Session {
 	/**
 	 * $session stocke les variables de session
 	 */
@@ -15,7 +15,7 @@ class Session {
 	 */
 	public static function init () {
 		// démarre la session
-		session_name (md5 (Configuration::selApplication ()));
+		session_name (md5 (Minz_Configuration::selApplication ()));
 		session_start ();
 		
 		if (isset ($_SESSION)) {
@@ -55,7 +55,7 @@ class Session {
 
 			if($p == 'language') {
 				// reset pour remettre à jour le fichier de langue à utiliser
-				Translate::reset ();
+				Minz_Translate::reset ();
 			}
 		}
 	}

+ 3 - 3
lib/minz/Translate.php

@@ -8,7 +8,7 @@
  * La classe Translate se charge de la traduction
  * Utilise les fichiers du répertoire /app/i18n/
  */
-class Translate {
+class Minz_Translate {
 	/**
 	 * $language est la langue à afficher
 	 */
@@ -25,8 +25,8 @@ class Translate {
 	 * l'enregistre dans $translates
 	 */
 	public static function init () {
-		$l = Configuration::language ();
-		self::$language = Session::param ('language', $l);
+		$l = Minz_Configuration::language ();
+		self::$language = Minz_Session::param ('language', $l);
 		
 		$l_path = APP_PATH . '/i18n/' . self::$language . '.php';
 		

+ 9 - 9
lib/minz/Url.php

@@ -3,7 +3,7 @@
 /**
  * La classe Url permet de gérer les URL à travers MINZ
  */
-class Url {
+class Minz_Url {
 	/**
 	 * Affiche une Url formatée selon que l'on utilise l'url_rewriting ou non
 	 * si oui, on cherche dans la table de routage la correspondance pour formater
@@ -29,16 +29,16 @@ class Url {
 			} else {
 				$protocol = 'http:';
 			}
-			$url_string = $protocol . '//' . Request::getDomainName () . Request::getBaseUrl ();
+			$url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl ();
 		}
 		else {
 			$url_string = '.';
 		}
 
 		if (is_array ($url)) {
-			$router = new Router ();
+			$router = new Minz_Router ();
 
-			if (Configuration::useUrlRewriting ()) {
+			if (Minz_Configuration::useUrlRewriting ()) {
 				$url_string .= $router->printUriRewrited ($url);
 			} else {
 				$url_string .= self::printUri ($url, $encodage);
@@ -67,13 +67,13 @@ class Url {
 		}
 		
 		if (isset ($url['c'])
-		 && $url['c'] != Request::defaultControllerName ()) {
+		 && $url['c'] != Minz_Request::defaultControllerName ()) {
 			$uri .= $separator . 'c=' . $url['c'];
 			$separator = $and;
 		}
 		
 		if (isset ($url['a'])
-		 && $url['a'] != Request::defaultActionName ()) {
+		 && $url['a'] != Minz_Request::defaultActionName ()) {
 			$uri .= $separator . 'a=' . $url['a'];
 			$separator = $and;
 		}
@@ -98,10 +98,10 @@ class Url {
 		
 		if (is_array ($url)) {
 			if (!isset ($url['c'])) {
-				$url_checked['c'] = Request::defaultControllerName ();
+				$url_checked['c'] = Minz_Request::defaultControllerName ();
 			}
 			if (!isset ($url['a'])) {
-				$url_checked['a'] = Request::defaultActionName ();
+				$url_checked['a'] = Minz_Request::defaultActionName ();
 			}
 			if (!isset ($url['params'])) {
 				$url_checked['params'] = array ();
@@ -125,5 +125,5 @@ function _url ($controller, $action) {
 		$params[$args[$i]] = $args[$i + 1];
 	}
 
-	return Url::display (array ('c' => $controller, 'a' => $action, 'params' => $params));
+	return Minz_Url::display (array ('c' => $controller, 'a' => $action, 'params' => $params));
 }

+ 5 - 5
lib/minz/View.php

@@ -7,7 +7,7 @@
 /**
  * La classe View représente la vue de l'application
  */
-class View {
+class Minz_View {
 	const VIEWS_PATH_NAME = '/views';
 	const LAYOUT_PATH_NAME = '/layout';
 	const LAYOUT_FILENAME = '/layout.phtml';
@@ -28,8 +28,8 @@ class View {
 	public function __construct () {
 		$this->view_filename = APP_PATH
 		                     . self::VIEWS_PATH_NAME . '/'
-		                     . Request::controllerName () . '/'
-		                     . Request::actionName () . '.phtml';
+		                     . Minz_Request::controllerName () . '/'
+		                     . Minz_Request::actionName () . '.phtml';
 
 		if (file_exists (APP_PATH
 		               . self::LAYOUT_PATH_NAME
@@ -37,7 +37,7 @@ class View {
 			$this->use_layout = true;
 		}
 
-		self::$title = Configuration::title ();
+		self::$title = Minz_Configuration::title ();
 	}
 
 	/**
@@ -232,7 +232,7 @@ class View {
 		self::$params[$key] = $value;
 	}
 	public function attributeParams () {
-		foreach (View::$params as $key => $value) {
+		foreach (Minz_View::$params as $key => $value) {
 			$this->$key = $value;
 		}
 	}

+ 0 - 94
lib/minz/exceptions/MinzException.php

@@ -1,94 +0,0 @@
-<?php
-
-class MinzException extends Exception {
-	const ERROR = 0;
-	const WARNING = 10;
-	const NOTICE = 20;
-
-	public function __construct ($message, $code = self::ERROR) {
-		if ($code != MinzException::ERROR
-		 && $code != MinzException::WARNING
-		 && $code != MinzException::NOTICE) {
-			$code = MinzException::ERROR;
-		}
-		
-		parent::__construct ($message, $code);
-	}
-}
-
-class PermissionDeniedException extends MinzException {
-	public function __construct ($file_name, $code = self::ERROR) {
-		$message = 'Permission is denied for `' . $file_name.'`';
-
-		parent::__construct ($message, $code);
-	}
-}
-class FileNotExistException extends MinzException {
-	public function __construct ($file_name, $code = self::ERROR) {
-		$message = 'File doesn\'t exist : `' . $file_name.'`';
-		
-		parent::__construct ($message, $code);
-	}
-}
-class BadConfigurationException extends MinzException {
-	public function __construct ($part_missing, $code = self::ERROR) {
-		$message = '`' . $part_missing
-		         . '` in the configuration file is missing or is misconfigured';
-		
-		parent::__construct ($message, $code);
-	}
-}
-class ControllerNotExistException extends MinzException {
-	public function __construct ($controller_name, $code = self::ERROR) {
-		$message = 'Controller `' . $controller_name
-		         . '` doesn\'t exist';
-		
-		parent::__construct ($message, $code);
-	}
-}
-class ControllerNotActionControllerException extends MinzException {
-	public function __construct ($controller_name, $code = self::ERROR) {
-		$message = 'Controller `' . $controller_name
-		         . '` isn\'t instance of ActionController';
-		
-		parent::__construct ($message, $code);
-	}
-}
-class ActionException extends MinzException {
-	public function __construct ($controller_name, $action_name, $code = self::ERROR) {
-		$message = '`' . $action_name . '` cannot be invoked on `'
-		         . $controller_name . '`';
-		
-		parent::__construct ($message, $code);
-	}
-}
-class RouteNotFoundException extends MinzException {
-	private $route;
-	
-	public function __construct ($route, $code = self::ERROR) {
-		$this->route = $route;
-		
-		$message = 'Route `' . $route . '` not found';
-		
-		parent::__construct ($message, $code);
-	}
-	
-	public function route () {
-		return $this->route;
-	}
-}
-class PDOConnectionException extends MinzException {
-	public function __construct ($string_connection, $user, $code = self::ERROR) {
-		$message = 'Access to database is denied for `' . $user . '`'
-		         . ' (`' . $string_connection . '`)';
-		
-		parent::__construct ($message, $code);
-	}
-}
-class CurrentPagePaginationException extends MinzException {
-	public function __construct ($page) {
-		$message = 'Page number `' . $page . '` doesn\'t exist';
-		
-		parent::__construct ($message, self::ERROR);
-	}
-}

+ 2 - 10
public/index.php

@@ -37,18 +37,10 @@ if (file_exists ('install.php')) {
 		}
 	}
 
-	set_include_path (get_include_path ()
-		         . PATH_SEPARATOR
-		         . LIB_PATH
-		         . PATH_SEPARATOR
-		         . LIB_PATH . '/minz'
-		         . PATH_SEPARATOR
-		         . APP_PATH);
-
-	require (APP_PATH . '/App_FrontController.php');
+	require(LIB_PATH . '/lib_rss.php');	//Includes class autoloader
 
 	try {
-		$front_controller = new App_FrontController ();
+		$front_controller = new FreshRSS();
 		$front_controller->init ();
 		$front_controller->run ();
 	} catch (Exception $e) {