summaryrefslogtreecommitdiff
path: root/app/Controllers/statsController.php
diff options
context:
space:
mode:
authorGravatar plopoyop <clement@iMac-de-Clement.local> 2014-09-24 20:06:34 +0200
committerGravatar plopoyop <clement@iMac-de-Clement.local> 2014-09-24 20:06:34 +0200
commitc446625c7f6eda76b03fdac228b2f7b4ded74130 (patch)
tree42ab49b32804eeca003dfe69d6456ecf732b8fb1 /app/Controllers/statsController.php
parentffbfbb92cc89c5ae07e0a28ee3477fcd0c44505d (diff)
parenta12d90d85d86c168a6e8a13345f05897f17958a4 (diff)
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'app/Controllers/statsController.php')
-rw-r--r--app/Controllers/statsController.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 000b41dd2..256543f37 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -1,7 +1,21 @@
<?php
+/**
+ * Controller to handle application statistics.
+ */
class FreshRSS_stats_Controller extends Minz_ActionController {
+ /**
+ * This action handles the statistic main page.
+ *
+ * It displays the statistic main page.
+ * The values computed to display the page are:
+ * - repartition of read/unread/favorite/not favorite
+ * - number of article per day
+ * - number of feed by category
+ * - number of article by category
+ * - list of most prolific feed
+ */
public function indexAction() {
$statsDAO = FreshRSS_Factory::createStatsDAO();
Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js')));
@@ -12,6 +26,17 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->topFeed = $statsDAO->calculateTopFeed();
}
+ /**
+ * This action handles the idle feed statistic page.
+ *
+ * It displays the list of idle feed for different period. The supported
+ * periods are:
+ * - last year
+ * - last 6 months
+ * - last 3 months
+ * - last month
+ * - last week
+ */
public function idleAction() {
$statsDAO = FreshRSS_Factory::createStatsDAO();
$feeds = $statsDAO->calculateFeedLastDate();
@@ -56,6 +81,18 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->idleFeeds = $idleFeeds;
}
+ /**
+ * This action handles the article repartition statistic page.
+ *
+ * It displays the number of article and the average of article for the
+ * following periods:
+ * - hour of the day
+ * - day of the week
+ * - month
+ *
+ * @todo verify that the metrics used here make some sense. Especially
+ * for the average.
+ */
public function repartitionAction() {
$statsDAO = FreshRSS_Factory::createStatsDAO();
$categoryDAO = new FreshRSS_CategoryDAO();
@@ -74,6 +111,11 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id);
}
+ /**
+ * This action is called before every other action in that class. It is
+ * the common boiler plate for every action. It is triggered by the
+ * underlying framework.
+ */
public function firstAction() {
if (!$this->view->loginOk) {
Minz_Error::error(