aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-12-31 17:00:51 +0100
committerGravatar GitHub <noreply@github.com> 2021-12-31 17:00:51 +0100
commit77e9877316fcfacb26799afdf32d94c8411da80e (patch)
tree7fd9c85bf4854054be6536c14d120bc8b790debe /app
parent09c84fb3bc44bf8e45619c27acc15b967aea14ce (diff)
Add PHPStan (#4021)
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/authController.php8
-rwxr-xr-xapp/Controllers/configureController.php21
-rwxr-xr-xapp/Controllers/entryController.php9
-rw-r--r--app/Controllers/errorController.php2
-rw-r--r--app/Controllers/extensionController.php2
-rwxr-xr-xapp/Controllers/feedController.php17
-rw-r--r--app/Controllers/importExportController.php9
-rwxr-xr-xapp/Controllers/indexController.php20
-rw-r--r--app/Controllers/statsController.php10
-rw-r--r--app/Controllers/subscriptionController.php10
-rw-r--r--app/Controllers/tagController.php13
-rw-r--r--app/Controllers/updateController.php8
-rw-r--r--app/Controllers/userController.php13
-rw-r--r--app/FreshRSS.php12
-rw-r--r--app/Models/DatabaseDAO.php6
-rw-r--r--app/Models/EntryDAO.php2
-rw-r--r--app/Models/Search.php1
-rw-r--r--app/Models/TagDAO.php2
-rw-r--r--app/Models/UserDAO.php5
-rw-r--r--app/Models/View.php119
-rw-r--r--app/SQL/install.sql.mysql.php14
-rw-r--r--app/SQL/install.sql.pgsql.php12
-rw-r--r--app/SQL/install.sql.sqlite.php12
-rw-r--r--app/Services/ExportService.php6
-rwxr-xr-xapp/actualize_script.php28
-rw-r--r--app/layout/aside_feed.phtml1
-rw-r--r--app/layout/layout.phtml11
-rw-r--r--app/layout/simple.phtml11
-rw-r--r--app/views/auth/formLogin.phtml1
-rw-r--r--app/views/auth/index.phtml5
-rw-r--r--app/views/auth/register.phtml1
-rw-r--r--app/views/configure/archiving.phtml7
-rw-r--r--app/views/configure/display.phtml7
-rw-r--r--app/views/configure/integration.phtml7
-rw-r--r--app/views/configure/queries.phtml5
-rw-r--r--app/views/configure/query.phtml1
-rw-r--r--app/views/configure/reading.phtml9
-rw-r--r--app/views/configure/shortcut.phtml7
-rw-r--r--app/views/configure/system.phtml5
-rwxr-xr-xapp/views/entry/bookmark.phtml1
-rwxr-xr-xapp/views/entry/read.phtml1
-rw-r--r--app/views/error/index.phtml5
-rw-r--r--app/views/extension/configure.phtml2
-rw-r--r--app/views/extension/index.phtml5
-rw-r--r--app/views/feed/add.phtml1
-rw-r--r--app/views/feed/contentSelectorPreview.phtml7
-rw-r--r--app/views/helpers/category/update.phtml3
-rw-r--r--app/views/helpers/configure/query.phtml1
-rw-r--r--app/views/helpers/export/articles.phtml1
-rw-r--r--app/views/helpers/export/opml.phtml1
-rw-r--r--app/views/helpers/extension/configure.phtml1
-rw-r--r--app/views/helpers/extension/details.phtml1
-rw-r--r--app/views/helpers/feed/update.phtml1
-rw-r--r--app/views/helpers/index/normal/entry_bottom.phtml1
-rw-r--r--app/views/helpers/index/normal/entry_header.phtml1
-rw-r--r--app/views/helpers/javascript_vars.phtml1
-rwxr-xr-xapp/views/helpers/logs_pagination.phtml6
-rwxr-xr-xapp/views/helpers/pagination.phtml1
-rw-r--r--app/views/importExport/export.phtml1
-rw-r--r--app/views/importExport/index.phtml5
-rw-r--r--app/views/index/about.phtml9
-rw-r--r--app/views/index/global.phtml1
-rw-r--r--app/views/index/logs.phtml1
-rw-r--r--app/views/index/normal.phtml1
-rw-r--r--app/views/index/reader.phtml1
-rwxr-xr-xapp/views/index/rss.phtml1
-rw-r--r--app/views/index/tos.phtml1
-rw-r--r--app/views/javascript/actualize.phtml1
-rw-r--r--app/views/javascript/nbUnreadsPerFeed.phtml1
-rw-r--r--app/views/javascript/nonce.phtml1
-rw-r--r--app/views/stats/idle.phtml5
-rw-r--r--app/views/stats/index.phtml5
-rw-r--r--app/views/stats/repartition.phtml5
-rw-r--r--app/views/subscription/add.phtml7
-rw-r--r--app/views/subscription/bookmarklet.phtml5
-rw-r--r--app/views/subscription/category.phtml2
-rw-r--r--app/views/subscription/feed.phtml1
-rw-r--r--app/views/subscription/index.phtml7
-rw-r--r--app/views/tag/getTagsForEntry.phtml1
-rw-r--r--app/views/tag/index.phtml7
-rw-r--r--app/views/update/apply.phtml10
-rw-r--r--app/views/update/checkInstall.phtml5
-rw-r--r--app/views/update/index.phtml5
-rw-r--r--app/views/user/details.phtml5
-rw-r--r--app/views/user/manage.phtml7
-rw-r--r--app/views/user/profile.phtml3
-rw-r--r--app/views/user/validateEmail.phtml1
-rw-r--r--app/views/user_mailer/email_need_validation.txt.php1
88 files changed, 430 insertions, 156 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php
index e48bf39e8..085278a4f 100644
--- a/app/Controllers/authController.php
+++ b/app/Controllers/authController.php
@@ -22,7 +22,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
Minz_Error::error(403);
}
- Minz_View::prependTitle(_t('admin.auth.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('admin.auth.title') . ' · ');
if (Minz_Request::isPost()) {
$ok = true;
@@ -107,8 +107,8 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
public function formLoginAction() {
invalidateHttpCache();
- Minz_View::prependTitle(_t('gen.auth.login') . ' · ');
- Minz_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js')));
+ FreshRSS_View::prependTitle(_t('gen.auth.login') . ' · ');
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js')));
$limits = FreshRSS_Context::$system_conf->limits;
$this->view->cookie_days = round($limits['cookie_duration'] / 86400, 1);
@@ -237,6 +237,6 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
$this->view->show_tos_checkbox = file_exists(join_path(DATA_PATH, 'tos.html'));
$this->view->show_email_field = FreshRSS_Context::$system_conf->force_email_validation;
$this->view->preferred_language = Minz_Translate::getLanguage(null, Minz_Request::getPreferredLanguages(), FreshRSS_Context::$system_conf->language);
- Minz_View::prependTitle(_t('gen.auth.registration.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('gen.auth.registration.title') . ' · ');
}
}
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index e8d8fb546..b8bf97e77 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -70,7 +70,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
$this->view->themes = FreshRSS_Themes::get();
- Minz_View::prependTitle(_t('conf.display.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.display.title') . ' · ');
}
/**
@@ -134,7 +134,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'reading' ]);
}
- Minz_View::prependTitle(_t('conf.reading.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.reading.title') . ' · ');
}
/**
@@ -148,8 +148,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
* some unwanted behavior when the end-user was using an ad-blocker.
*/
public function integrationAction() {
- Minz_View::appendScript(Minz_Url::display('/scripts/integration.js?' . @filemtime(PUBLIC_PATH . '/scripts/integration.js')));
- Minz_View::appendScript(Minz_Url::display('/scripts/draggable.js?' . @filemtime(PUBLIC_PATH . '/scripts/draggable.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/integration.js?' . @filemtime(PUBLIC_PATH . '/scripts/integration.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/draggable.js?' . @filemtime(PUBLIC_PATH . '/scripts/draggable.js')));
if (Minz_Request::isPost()) {
$params = $_POST;
@@ -160,7 +160,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'integration' ]);
}
- Minz_View::prependTitle(_t('conf.sharing.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.sharing.title') . ' · ');
}
/**
@@ -191,7 +191,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
Minz_Request::good(_t('feedback.conf.shortcuts_updated'), array('c' => 'configure', 'a' => 'shortcut'));
}
- Minz_View::prependTitle(_t('conf.shortcut.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.shortcut.title') . ' · ');
}
/**
@@ -264,7 +264,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
$this->view->size_total = $databaseDAO->size(true);
}
- Minz_View::prependTitle(_t('conf.archiving.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.archiving.title') . ' · ');
}
/**
@@ -278,7 +278,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
* checking if categories and feeds are still in use.
*/
public function queriesAction() {
- Minz_View::appendScript(Minz_Url::display('/scripts/draggable.js?' . @filemtime(PUBLIC_PATH . '/scripts/draggable.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/draggable.js?' . @filemtime(PUBLIC_PATH . '/scripts/draggable.js')));
$category_dao = FreshRSS_Factory::createCategoryDao();
$feed_dao = FreshRSS_Factory::createFeedDao();
@@ -287,6 +287,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
if (Minz_Request::isPost()) {
$params = Minz_Request::param('queries', array());
+ $queries = [];
foreach ($params as $key => $query) {
if (!$query['name']) {
$query['name'] = _t('conf.query.number', $key + 1);
@@ -319,7 +320,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
$this->view->queryId = $id;
}
- Minz_View::prependTitle(_t('conf.query.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.query.title') . ' · ');
}
/**
@@ -370,7 +371,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'queries', 'params' => ['id' => $id] ]);
}
- Minz_View::prependTitle(_t('conf.query.title') . ' · ' . $query->getName() . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.query.title') . ' · ' . $query->getName() . ' · ');
}
/**
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index 15e4aa3fd..2f5c6594c 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -4,6 +4,13 @@
* Controller to handle every entry actions.
*/
class FreshRSS_entry_Controller extends Minz_ActionController {
+
+ /**
+ * JavaScript request or not.
+ * @var bool
+ */
+ private $ajax = false;
+
/**
* 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
@@ -114,7 +121,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
'c' => 'index',
'a' => 'index',
'params' => $params,
- ), true);
+ ));
}
}
diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php
index 325081aed..658cc71af 100644
--- a/app/Controllers/errorController.php
+++ b/app/Controllers/errorController.php
@@ -63,6 +63,6 @@ class FreshRSS_error_Controller extends Minz_ActionController {
$this->view->errorMessage = $error_message;
}
- Minz_View::prependTitle($this->view->code . ' · ');
+ FreshRSS_View::prependTitle($this->view->code . ' · ');
}
}
diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php
index a932954a9..69f52cebf 100644
--- a/app/Controllers/extensionController.php
+++ b/app/Controllers/extensionController.php
@@ -19,7 +19,7 @@ class FreshRSS_extension_Controller extends Minz_ActionController {
* This action lists all the extensions available to the current user.
*/
public function indexAction() {
- Minz_View::prependTitle(_t('admin.extensions.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('admin.extensions.title') . ' · ');
$this->view->extension_list = array(
'system' => array(),
'user' => array(),
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index c94b3216a..1f64687de 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -190,19 +190,19 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
} catch (FreshRSS_BadUrl_Exception $e) {
// Given url was not a valid url!
Minz_Log::warning($e->getMessage());
- Minz_Request::bad(_t('feedback.sub.feed.invalid_url', $url), $url_redirect);
+ return Minz_Request::bad(_t('feedback.sub.feed.invalid_url', $url), $url_redirect);
} catch (FreshRSS_Feed_Exception $e) {
// Something went bad (timeout, server not found, etc.)
Minz_Log::warning($e->getMessage());
- Minz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect);
+ return Minz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect);
} catch (Minz_FileNotExistException $e) {
// Cache directory doesn't exist!
Minz_Log::error($e->getMessage());
- Minz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect);
+ return Minz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect);
} catch (FreshRSS_AlreadySubscribed_Exception $e) {
- Minz_Request::bad(_t('feedback.sub.feed.already_subscribed', $e->feedName()), $url_redirect);
+ return Minz_Request::bad(_t('feedback.sub.feed.already_subscribed', $e->feedName()), $url_redirect);
} catch (FreshRSS_FeedNotAdded_Exception $e) {
- Minz_Request::bad(_t('feedback.sub.feed.not_added', $e->feedName()), $url_redirect);
+ return Minz_Request::bad(_t('feedback.sub.feed.not_added', $e->feedName()), $url_redirect);
}
// Entries are in DB, we redirect to feed configuration page.
@@ -211,10 +211,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
Minz_Request::good(_t('feedback.sub.feed.added', $feed->name()), $url_redirect);
} else {
// GET request: we must ask confirmation to user before adding feed.
- Minz_View::prependTitle(_t('sub.feed.title_add') . ' · ');
+ FreshRSS_View::prependTitle(_t('sub.feed.title_add') . ' · ');
- $this->catDAO = FreshRSS_Factory::createCategoryDao();
- $this->view->categories = $this->catDAO->listCategories(false);
+ $catDAO = FreshRSS_Factory::createCategoryDao();
+ $this->view->categories = $catDAO->listCategories(false);
$this->view->feed = new FreshRSS_Feed($url);
try {
// We try to get more information about the feed.
@@ -567,6 +567,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$force = Minz_Request::param('force');
$maxFeeds = (int)Minz_Request::param('maxFeeds');
$noCommit = ($_POST['noCommit'] ?? 0) == 1;
+ $feed = null;
if ($id == -1 && !$noCommit) { //Special request only to commit & refresh DB cache
$updated_feeds = 0;
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php
index f3b898df4..0634bf54c 100644
--- a/app/Controllers/importExportController.php
+++ b/app/Controllers/importExportController.php
@@ -4,6 +4,11 @@
* Controller to handle every import and export actions.
*/
class FreshRSS_importExport_Controller extends Minz_ActionController {
+
+ private $catDAO;
+ private $entryDAO;
+ private $feedDAO;
+
/**
* 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
@@ -26,7 +31,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
*/
public function indexAction() {
$this->view->feeds = $this->feedDAO->listFeeds();
- Minz_View::prependTitle(_t('sub.import_export.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('sub.import_export.title') . ' · ');
}
private static function megabytes($size_str) {
@@ -504,6 +509,8 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
$website = $origin['htmlUrl'];
} elseif (!empty($origin['feedUrl'])) {
$website = $origin['feedUrl'];
+ } else {
+ $website = '';
}
$name = empty($origin['title']) ? $website : $origin['title'];
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index ff746f4bf..eadfe252b 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -41,12 +41,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$this->view->categories = FreshRSS_Context::$categories;
- $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title();
+ $this->view->rss_title = FreshRSS_Context::$name . ' | ' . FreshRSS_View::title();
$title = FreshRSS_Context::$name;
if (FreshRSS_Context::$get_unread > 0) {
$title = '(' . FreshRSS_Context::$get_unread . ') ' . $title;
}
- Minz_View::prependTitle($title . ' · ');
+ FreshRSS_View::prependTitle($title . ' · ');
FreshRSS_Context::$id_max = time() . '000000';
@@ -104,8 +104,8 @@ class FreshRSS_index_Controller extends Minz_ActionController {
return;
}
- Minz_View::appendScript(Minz_Url::display('/scripts/extra.js?' . @filemtime(PUBLIC_PATH . '/scripts/extra.js')));
- Minz_View::appendScript(Minz_Url::display('/scripts/global_view.js?' . @filemtime(PUBLIC_PATH . '/scripts/global_view.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/extra.js?' . @filemtime(PUBLIC_PATH . '/scripts/extra.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/global_view.js?' . @filemtime(PUBLIC_PATH . '/scripts/global_view.js')));
try {
$this->updateContext();
@@ -115,12 +115,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$this->view->categories = FreshRSS_Context::$categories;
- $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title();
+ $this->view->rss_title = FreshRSS_Context::$name . ' | ' . FreshRSS_View::title();
$title = _t('index.feed.title_global');
if (FreshRSS_Context::$get_unread > 0) {
$title = '(' . FreshRSS_Context::$get_unread . ') ' . $title;
}
- Minz_View::prependTitle($title . ' · ');
+ FreshRSS_View::prependTitle($title . ' · ');
$this->_csp([
'default-src' => "'self'",
@@ -161,7 +161,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
// No layout for RSS output.
$this->view->url = PUBLIC_TO_INDEX_PATH . '/' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']);
- $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title();
+ $this->view->rss_title = FreshRSS_Context::$name . ' | ' . FreshRSS_View::title();
$this->view->_layout(false);
header('Content-Type: application/rss+xml; charset=utf-8');
}
@@ -253,7 +253,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
* This action displays the about page of FreshRSS.
*/
public function aboutAction() {
- Minz_View::prependTitle(_t('index.about.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('index.about.title') . ' · ');
}
/**
@@ -270,7 +270,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$this->view->terms_of_service = $terms_of_service;
$this->view->can_register = !max_registrations_reached();
- Minz_View::prependTitle(_t('index.tos.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('index.tos.title') . ' · ');
}
/**
@@ -281,7 +281,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
Minz_Error::error(403);
}
- Minz_View::prependTitle(_t('index.log.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('index.log.title') . ' · ');
if (Minz_Request::isPost()) {
FreshRSS_LogDAO::truncate();
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index c9a8cdc0c..980f3532d 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -20,7 +20,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
'style-src' => "'self' 'unsafe-inline'",
]);
- Minz_View::prependTitle(_t('admin.stats.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('admin.stats.title') . ' · ');
}
private function convertToSerie($data) {
@@ -57,7 +57,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
*/
public function indexAction() {
$statsDAO = FreshRSS_Factory::createStatsDAO();
- Minz_View::appendScript(Minz_Url::display('/scripts/vendor/chart.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/vendor/chart.min.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/vendor/chart.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/vendor/chart.min.js')));
$this->view->repartition = $statsDAO->calculateEntryRepartition();
@@ -66,6 +66,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->average = round(array_sum(array_values($entryCount)) / count($entryCount), 2);
$feedByCategory_calculated = $statsDAO->calculateFeedByCategory();
+ $feedByCategory = [];
for ($i = 0; $i < count($feedByCategory_calculated); $i++) {
$feedByCategory['label'][$i] = $feedByCategory_calculated[$i]['label'];
$feedByCategory['data'][$i] = $feedByCategory_calculated[$i]['data'];
@@ -73,6 +74,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->feedByCategory = $feedByCategory;
$entryByCategory_calculated = $statsDAO->calculateEntryByCategory();
+ $entryByCategory = [];
for ($i = 0; $i < count($entryByCategory_calculated); $i++) {
$entryByCategory['label'][$i] = $entryByCategory_calculated[$i]['label'];
$entryByCategory['data'][$i] = $entryByCategory_calculated[$i]['data'];
@@ -81,6 +83,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->topFeed = $statsDAO->calculateTopFeed();
+ $last30DaysLabels = [];
for ($i = 0; $i < 30; $i++) {
$last30DaysLabels[$i] = date('d.m.Y', strtotime((-30 + $i) . ' days'));
}
@@ -178,7 +181,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$categoryDAO = FreshRSS_Factory::createCategoryDao();
$feedDAO = FreshRSS_Factory::createFeedDao();
- Minz_View::appendScript(Minz_Url::display('/scripts/vendor/chart.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/vendor/chart.min.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/vendor/chart.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/vendor/chart.min.js')));
$id = Minz_Request::param('id', null);
@@ -198,6 +201,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id);
$this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id);
+ $hours24Labels = [];
for ($i = 0; $i < 24; $i++) {
$hours24Labels[$i] = $i . ':xx';
}
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index 5a89d0e08..c01e01843 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -44,8 +44,8 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
* It displays categories and associated feeds.
*/
public function indexAction() {
- Minz_View::appendScript(Minz_Url::display('/scripts/category.js?' . @filemtime(PUBLIC_PATH . '/scripts/category.js')));
- Minz_View::prependTitle(_t('sub.title') . ' · ');
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/category.js?' . @filemtime(PUBLIC_PATH . '/scripts/category.js')));
+ FreshRSS_View::prependTitle(_t('sub.title') . ' · ');
$this->view->onlyFeedsWithError = Minz_Request::paramTernary('error');
@@ -104,7 +104,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
$feed = $this->view->feeds[$id];
$this->view->feed = $feed;
- Minz_View::prependTitle(_t('sub.title.feed_management') . ' · ' . $feed->name() . ' · ');
+ FreshRSS_View::prependTitle(_t('sub.title.feed_management') . ' · ' . $feed->name() . ' · ');
if (Minz_Request::isPost()) {
$user = trim(Minz_Request::param('http_user_feed' . $id, ''));
@@ -282,13 +282,13 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {
* This action displays the bookmarklet page.
*/
public function bookmarkletAction() {
- Minz_View::prependTitle(_t('sub.title.subscription_tools') . ' . ');
+ FreshRSS_View::prependTitle(_t('sub.title.subscription_tools') . ' . ');
}
/**
* This action displays the page to add a new feed
*/
public function addAction() {
- Minz_View::prependTitle(_t('sub.title.add') . ' . ');
+ FreshRSS_View::prependTitle(_t('sub.title.add') . ' . ');
}
}
diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php
index 0a57c0df2..077be9700 100644
--- a/app/Controllers/tagController.php
+++ b/app/Controllers/tagController.php
@@ -4,6 +4,13 @@
* Controller to handle every tag actions.
*/
class FreshRSS_tag_Controller extends Minz_ActionController {
+
+ /**
+ * JavaScript request or not.
+ * @var bool
+ */
+ private $ajax = false;
+
/**
* 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
@@ -92,10 +99,10 @@ class FreshRSS_tag_Controller extends Minz_ActionController {
$tagDAO = FreshRSS_Factory::createTagDao();
if (strlen($name) > 0 && null === $tagDAO->searchByName($name)) {
$tagDAO->addTag(['name' => $name]);
- Minz_Request::good(_t('feedback.tag.created', $name), ['c' => 'tag', 'a' => 'index'], true);
+ Minz_Request::good(_t('feedback.tag.created', $name), ['c' => 'tag', 'a' => 'index']);
}
- Minz_Request::bad(_t('feedback.tag.name_exists', $name), ['c' => 'tag', 'a' => 'index'], true);
+ Minz_Request::bad(_t('feedback.tag.name_exists', $name), ['c' => 'tag', 'a' => 'index']);
}
public function renameAction() {
@@ -123,7 +130,7 @@ class FreshRSS_tag_Controller extends Minz_ActionController {
$tagDAO->deleteTag($sourceId);
}
- Minz_Request::good(_t('feedback.tag.renamed', $sourceName, $targetName), ['c' => 'tag', 'a' => 'index'], true);
+ Minz_Request::good(_t('feedback.tag.renamed', $sourceName, $targetName), ['c' => 'tag', 'a' => 'index']);
}
public function indexAction() {
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 862fb0cf9..16ab7e427 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -108,7 +108,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
}
public function indexAction() {
- Minz_View::prependTitle(_t('admin.update.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('admin.update.title') . ' · ');
if (file_exists(UPDATE_FILENAME)) {
// There is an update file to apply!
@@ -224,6 +224,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
$res = !self::hasGitUpdate();
} else {
require(UPDATE_FILENAME);
+ // @phpstan-ignore-next-line
$res = do_post_update();
}
@@ -244,9 +245,12 @@ class FreshRSS_update_Controller extends Minz_ActionController {
} else {
require(UPDATE_FILENAME);
if (Minz_Request::isPost()) {
+ // @phpstan-ignore-next-line
save_info_update();
}
+ // @phpstan-ignore-next-line
if (!need_info_update()) {
+ // @phpstan-ignore-next-line
$res = apply_update();
} else {
return;
@@ -269,7 +273,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
* This action displays information about installation.
*/
public function checkInstallAction() {
- Minz_View::prependTitle(_t('admin.check_install.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('admin.check_install.title') . ' · ');
$this->view->status_php = check_install_php();
$this->view->status_files = check_install_files();
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 81f8b20a8..b1f34ce61 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -95,9 +95,9 @@ class FreshRSS_user_Controller extends Minz_ActionController {
$this->view->disable_aside = true;
}
- Minz_View::prependTitle(_t('conf.profile.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('conf.profile.title') . ' · ');
- Minz_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js')));
+ FreshRSS_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js')));
if (Minz_Request::isPost()) {
$system_conf = FreshRSS_Context::$system_conf;
@@ -173,7 +173,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
Minz_Error::error(403);
}
- Minz_View::prependTitle(_t('admin.user.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('admin.user.title') . ' · ');
if (Minz_Request::isPost()) {
$action = Minz_Request::param('action');
@@ -227,6 +227,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
$ok = self::checkUsername($new_user_name);
$homeDir = join_path(DATA_PATH, 'users', $new_user_name);
+ $configPath = '';
if ($ok) {
$languages = Minz_Translate::availableLanguages();
@@ -418,7 +419,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
Minz_Error::error(404);
}
- Minz_View::prependTitle(_t('user.email.validation.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('user.email.validation.title') . ' · ');
$this->view->_layout('simple');
$username = Minz_Request::param('username');
@@ -429,11 +430,11 @@ class FreshRSS_user_Controller extends Minz_ActionController {
} elseif (FreshRSS_Auth::hasAccess()) {
$user_config = FreshRSS_Context::$user_conf;
} else {
- Minz_Error::error(403);
+ return Minz_Error::error(403);
}
if (!FreshRSS_UserDAO::exists($username) || $user_config === null) {
- Minz_Error::error(404);
+ return Minz_Error::error(404);
}
if ($user_config->email_validation_token === '') {
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 54caef3bc..64b8d13ae 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -24,6 +24,8 @@ class FreshRSS extends Minz_FrontController {
Minz_Session::init('FreshRSS');
}
+ Minz_ActionController::$viewType = 'FreshRSS_View';
+
FreshRSS_Context::initSystem();
if (FreshRSS_Context::$system_conf == null) {
$message = 'Error during context system init!';
@@ -105,7 +107,7 @@ class FreshRSS extends Minz_FrontController {
case '.js':
$theme_id = $theme['id'];
$filename = $file;
- Minz_View::prependScript(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename)));
+ FreshRSS_View::prependScript(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename)));
break;
case '.css':
default:
@@ -120,21 +122,21 @@ class FreshRSS extends Minz_FrontController {
$filename = substr($filename, 0, -4);
$filename = $filename . '.rtl.css';
}
- Minz_View::prependStyle(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename)));
+ FreshRSS_View::prependStyle(Minz_Url::display(FreshRSS::getThemeFileUrl($theme_id, $filename)));
}
}
}
//Use prepend to insert before extensions. Added in reverse order.
if (Minz_Request::controllerName() !== 'index') {
- Minz_View::prependScript(Minz_Url::display('/scripts/extra.js?' . @filemtime(PUBLIC_PATH . '/scripts/extra.js')));
+ FreshRSS_View::prependScript(Minz_Url::display('/scripts/extra.js?' . @filemtime(PUBLIC_PATH . '/scripts/extra.js')));
}
- Minz_View::prependScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js')));
+ FreshRSS_View::prependScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js')));
}
private static function loadNotifications() {
$notif = Minz_Request::getNotification();
if ($notif) {
- Minz_View::_param('notification', $notif);
+ FreshRSS_View::_param('notification', $notif);
}
}
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php
index 86f72b14c..b1ce0cca6 100644
--- a/app/Models/DatabaseDAO.php
+++ b/app/Models/DatabaseDAO.php
@@ -24,7 +24,7 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$db = FreshRSS_Context::$system_conf->db;
try {
- $sql = sprintf($SQL_CREATE_DB, empty($db['base']) ? '' : $db['base']);
+ $sql = sprintf($GLOBALS['SQL_CREATE_DB'], empty($db['base']) ? '' : $db['base']);
return $this->pdo->exec($sql) === false ? 'Error during CREATE DATABASE' : '';
} catch (Exception $e) {
syslog(LOG_DEBUG, __method__ . ' notice: ' . $e->getMessage());
@@ -176,7 +176,7 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$ok = false;
try {
- $ok = $this->pdo->exec($SQL_UPDATE_GUID_LATIN1_BIN) !== false; //FreshRSS 1.12
+ $ok = $this->pdo->exec($GLOBALS['SQL_UPDATE_GUID_LATIN1_BIN']) !== false; //FreshRSS 1.12
} catch (Exception $e) {
$ok = false;
Minz_Log::error(__METHOD__ . ' error: ' . $e->getMessage());
@@ -277,6 +277,8 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$entryFrom = $entryDAOSQLite; $entryTo = $entryDAO;
$tagFrom = $tagDAOSQLite; $tagTo = $tagDAO;
break;
+ default:
+ return;
}
$idMaps = [];
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 7c133a2f4..7b7f5f53e 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -32,7 +32,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
try {
require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php');
Minz_Log::warning('SQL CREATE TABLE entrytmp...');
- $ok = $this->pdo->exec($SQL_CREATE_TABLE_ENTRYTMP . $SQL_CREATE_INDEX_ENTRY_1) !== false;
+ $ok = $this->pdo->exec($GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] . $GLOBALS['SQL_CREATE_INDEX_ENTRY_1']) !== false;
} catch (Exception $ex) {
Minz_Log::error(__method__ . ' error: ' . $ex->getMessage());
}
diff --git a/app/Models/Search.php b/app/Models/Search.php
index 47aaa6078..08669f738 100644
--- a/app/Models/Search.php
+++ b/app/Models/Search.php
@@ -570,7 +570,6 @@ class FreshRSS_Search {
* Supported delimiters are single quote (') and double quotes (").
*
* @param string $input
- * @return string
*/
private function parseSearch($input) {
$input = self::cleanSearch($input);
diff --git a/app/Models/TagDAO.php b/app/Models/TagDAO.php
index b5b59afd9..03ef5421b 100644
--- a/app/Models/TagDAO.php
+++ b/app/Models/TagDAO.php
@@ -20,7 +20,7 @@ class FreshRSS_TagDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
$databaseDAO->ensureCaseInsensitiveGuids();
Minz_Log::warning('SQL CREATE TABLE tag...');
- $ok = $this->pdo->exec($SQL_CREATE_TABLE_TAGS) !== false;
+ $ok = $this->pdo->exec($GLOBALS['SQL_CREATE_TABLE_TAGS']) !== false;
} catch (Exception $e) {
Minz_Log::error('FreshRSS_EntryDAO::createTagTable error: ' . $e->getMessage());
}
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php
index 1596fa5cc..c9a3436d8 100644
--- a/app/Models/UserDAO.php
+++ b/app/Models/UserDAO.php
@@ -5,9 +5,10 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php');
try {
- $sql = $SQL_CREATE_TABLES . $SQL_CREATE_TABLE_ENTRYTMP . $SQL_CREATE_TABLE_TAGS;
+ $sql = $GLOBALS['$SQL_CREATE_TABLES'] . $GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] . $GLOBALS['SQL_CREATE_TABLE_TAGS'];
$ok = $this->pdo->exec($sql) !== false; //Note: Only exec() can take multiple statements safely.
} catch (Exception $e) {
+ $ok = false;
Minz_Log::error('Error while creating database for user ' . $this->current_user . ': ' . $e->getMessage());
}
@@ -26,7 +27,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
}
require(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php');
- $ok = $this->pdo->exec($SQL_DROP_TABLES) !== false;
+ $ok = $this->pdo->exec($GLOBALS['SQL_DROP_TABLES']) !== false;
if ($ok) {
return true;
diff --git a/app/Models/View.php b/app/Models/View.php
new file mode 100644
index 000000000..22bc2c49a
--- /dev/null
+++ b/app/Models/View.php
@@ -0,0 +1,119 @@
+<?php
+
+class FreshRSS_View extends Minz_View {
+
+ // Main views
+ public $callbackBeforeEntries;
+ public $callbackBeforePagination;
+ public $categories;
+ public $category;
+ public $entries;
+ public $entry;
+ public $feed;
+ public $feeds;
+ public $nbUnreadTags;
+ public $tags;
+
+ // Substriptions
+ public $default_category;
+ public $displaySlider;
+ public $load_ok;
+ public $onlyFeedsWithError;
+ public $signalError;
+
+ // Manage users
+ public $details;
+ public $disable_aside;
+ public $show_email_field;
+ public $username;
+ public $users;
+
+ // Updates
+ public $last_update_time;
+ public $status_files;
+ public $status_php;
+ public $update_to_apply;
+
+ // Archiving
+ public $nb_total;
+ public $size_total;
+ public $size_user;
+
+ // Display
+ public $themes;
+
+ // Shortcuts
+ public $list_keys;
+
+ // User queries
+ public $queries;
+ public $query;
+
+ // Export / Import
+ public $content;
+ public $entriesRaw;
+ public $entryIdsTagNames;
+ public $list_title;
+ public $queryId;
+ public $type;
+
+ // Form login
+ public $cookie_days;
+ public $nonce;
+ public $salt1;
+
+ // Registration
+ public $can_register;
+ public $preferred_language;
+ public $show_tos_checkbox;
+ public $terms_of_service;
+
+ // Email validation
+ public $site_title;
+ public $validation_url;
+
+ // Logs
+ public $currentPage;
+ public $logsPaginator;
+ public $nbPage;
+
+ // RSS view
+ public $rss_title;
+ public $url;
+
+ // Content preview
+ public $fatalError;
+ public $htmlContent;
+ public $selectorSuccess;
+
+ // Extensions
+ public $ext_details;
+ public $extension_list;
+ public $extension;
+ public $extensions_installed;
+
+ // Errors
+ public $code;
+ public $errorMessage;
+
+ // Statistics
+ public $average;
+ public $averageDayOfWeek;
+ public $averageHour;
+ public $averageMonth;
+ public $days;
+ public $entryByCategory;
+ public $entryCount;
+ public $feedByCategory;
+ public $hours24Labels;
+ public $idleFeeds;
+ public $last30DaysLabel;
+ public $last30DaysLabels;
+ public $months;
+ public $repartition;
+ public $repartitionDayOfWeek;
+ public $repartitionHour;
+ public $repartitionMonth;
+ public $topFeed;
+
+}
diff --git a/app/SQL/install.sql.mysql.php b/app/SQL/install.sql.mysql.php
index f8972b186..1fed64fda 100644
--- a/app/SQL/install.sql.mysql.php
+++ b/app/SQL/install.sql.mysql.php
@@ -1,9 +1,9 @@
<?php
-$SQL_CREATE_DB = <<<'SQL'
+$GLOBALS['SQL_CREATE_DB'] = <<<'SQL'
CREATE DATABASE IF NOT EXISTS `%1$s` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SQL;
-$SQL_CREATE_TABLES = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLES'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `_category` (
`id` SMALLINT NOT NULL AUTO_INCREMENT, -- v0.7
`name` VARCHAR(191) NOT NULL, -- Max index length for Unicode is 191 characters (767 bytes) FreshRSS_DatabaseDAO::LENGTH_INDEX_UNICODE
@@ -64,11 +64,11 @@ ENGINE = INNODB;
INSERT IGNORE INTO `_category` (id, name) VALUES(1, "Uncategorized");
SQL;
-$SQL_CREATE_INDEX_ENTRY_1 = <<<'SQL'
+$GLOBALS['SQL_CREATE_INDEX_ENTRY_1'] = <<<'SQL'
CREATE INDEX `entry_feed_read_index` ON `_entry` (`id_feed`,`is_read`); -- v1.7
SQL;
-$SQL_CREATE_TABLE_ENTRYTMP = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `_entrytmp` ( -- v1.7
`id` BIGINT NOT NULL,
`guid` VARCHAR(760) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
@@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS `_entrytmp` ( -- v1.7
ENGINE = INNODB;
SQL;
-$SQL_CREATE_TABLE_TAGS = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLE_TAGS'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `_tag` ( -- v1.12
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(63) NOT NULL,
@@ -112,11 +112,11 @@ CREATE TABLE IF NOT EXISTS `_entrytag` ( -- v1.12
ENGINE = INNODB;
SQL;
-$SQL_DROP_TABLES = <<<'SQL'
+$GLOBALS['SQL_DROP_TABLES'] = <<<'SQL'
DROP TABLE IF EXISTS `_entrytag`, `_tag`, `_entrytmp`, `_entry`, `_feed`, `_category`;
SQL;
-$SQL_UPDATE_GUID_LATIN1_BIN = <<<'SQL'
+$GLOBALS['SQL_UPDATE_GUID_LATIN1_BIN'] = <<<'SQL'
ALTER TABLE `_entrytmp` MODIFY `guid` VARCHAR(760) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL; -- v1.12
ALTER TABLE `_entry` MODIFY `guid` VARCHAR(760) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL;
SQL;
diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php
index c17a45127..5b810deff 100644
--- a/app/SQL/install.sql.pgsql.php
+++ b/app/SQL/install.sql.pgsql.php
@@ -1,9 +1,9 @@
<?php
-$SQL_CREATE_DB = <<<'SQL'
+$GLOBALS['SQL_CREATE_DB'] = <<<'SQL'
CREATE DATABASE "%1$s" ENCODING 'UTF8';
SQL;
-$SQL_CREATE_TABLES = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLES'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `_category` (
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(255) UNIQUE NOT NULL,
@@ -59,11 +59,11 @@ INSERT INTO `_category` (id, name)
RETURNING nextval('`_category_id_seq`');
SQL;
-$SQL_CREATE_INDEX_ENTRY_1 = <<<'SQL'
+$GLOBALS['SQL_CREATE_INDEX_ENTRY_1'] = <<<'SQL'
CREATE INDEX IF NOT EXISTS `_entry_feed_read_index` ON `_entry` ("id_feed","is_read"); -- v1.7
SQL;
-$SQL_CREATE_TABLE_ENTRYTMP = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `_entrytmp` ( -- v1.7
"id" BIGINT NOT NULL PRIMARY KEY,
"guid" VARCHAR(760) NOT NULL,
@@ -84,7 +84,7 @@ CREATE TABLE IF NOT EXISTS `_entrytmp` ( -- v1.7
CREATE INDEX IF NOT EXISTS `_entrytmp_date_index` ON `_entrytmp` ("date");
SQL;
-$SQL_CREATE_TABLE_TAGS = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLE_TAGS'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `_tag` ( -- v1.12
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(63) UNIQUE NOT NULL,
@@ -100,6 +100,6 @@ CREATE TABLE IF NOT EXISTS `_entrytag` (
CREATE INDEX IF NOT EXISTS `_entrytag_id_entry_index` ON `_entrytag` ("id_entry");
SQL;
-$SQL_DROP_TABLES = <<<'SQL'
+$GLOBALS['SQL_DROP_TABLES'] = <<<'SQL'
DROP TABLE IF EXISTS `_entrytag`, `_tag`, `_entrytmp`, `_entry`, `_feed`, `_category`;
SQL;
diff --git a/app/SQL/install.sql.sqlite.php b/app/SQL/install.sql.sqlite.php
index ff7c03354..74def4d98 100644
--- a/app/SQL/install.sql.sqlite.php
+++ b/app/SQL/install.sql.sqlite.php
@@ -1,9 +1,9 @@
<?php
-$SQL_CREATE_DB = <<<'SQL'
+$GLOBALS['SQL_CREATE_DB'] = <<<'SQL'
SELECT 1; -- Do nothing for SQLite
SQL;
-$SQL_CREATE_TABLES = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLES'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `category` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` VARCHAR(255) NOT NULL,
@@ -59,11 +59,11 @@ CREATE INDEX IF NOT EXISTS entry_feed_read_index ON `entry`(`id_feed`,`is_read`)
INSERT OR IGNORE INTO `category` (id, name) VALUES(1, "Uncategorized");
SQL;
-$SQL_CREATE_INDEX_ENTRY_1 = <<<'SQL'
+$GLOBALS['SQL_CREATE_INDEX_ENTRY_1'] = <<<'SQL'
CREATE INDEX IF NOT EXISTS entry_feed_read_index ON `entry`(`id_feed`,`is_read`); -- v1.7
SQL;
-$SQL_CREATE_TABLE_ENTRYTMP = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLE_ENTRYTMP'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `entrytmp` ( -- v1.7
`id` BIGINT NOT NULL,
`guid` VARCHAR(760) NOT NULL,
@@ -85,7 +85,7 @@ CREATE TABLE IF NOT EXISTS `entrytmp` ( -- v1.7
CREATE INDEX IF NOT EXISTS entrytmp_date_index ON `entrytmp`(`date`);
SQL;
-$SQL_CREATE_TABLE_TAGS = <<<'SQL'
+$GLOBALS['SQL_CREATE_TABLE_TAGS'] = <<<'SQL'
CREATE TABLE IF NOT EXISTS `tag` ( -- v1.12
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` VARCHAR(63) NOT NULL,
@@ -102,7 +102,7 @@ CREATE TABLE IF NOT EXISTS `entrytag` (
CREATE INDEX IF NOT EXISTS entrytag_id_entry_index ON `entrytag` (`id_entry`);
SQL;
-$SQL_DROP_TABLES = <<<'SQL'
+$GLOBALS['SQL_DROP_TABLES'] = <<<'SQL'
DROP TABLE IF EXISTS `entrytag`;
DROP TABLE IF EXISTS `tag`;
DROP TABLE IF EXISTS `entrytmp`;
diff --git a/app/Services/ExportService.php b/app/Services/ExportService.php
index 78ef45c4e..d8db4df71 100644
--- a/app/Services/ExportService.php
+++ b/app/Services/ExportService.php
@@ -41,7 +41,7 @@ class FreshRSS_Export_Service {
public function generateOpml() {
require_once(LIB_PATH . '/lib_opml.php');
- $view = new Minz_View();
+ $view = new FreshRSS_View();
$day = date('Y-m-d');
$categories = [];
@@ -72,7 +72,7 @@ class FreshRSS_Export_Service {
* @return array First item is the filename, second item is the content
*/
public function generateStarredEntries($type) {
- $view = new Minz_View();
+ $view = new FreshRSS_View();
$view->categories = $this->category_dao->listCategories();
$day = date('Y-m-d');
@@ -108,7 +108,7 @@ class FreshRSS_Export_Service {
return null;
}
- $view = new Minz_View();
+ $view = new FreshRSS_View();
$view->categories = $this->category_dao->listCategories();
$view->feed = $feed;
$day = date('Y-m-d');
diff --git a/app/actualize_script.php b/app/actualize_script.php
index 1e3514de7..721376f62 100755
--- a/app/actualize_script.php
+++ b/app/actualize_script.php
@@ -2,20 +2,6 @@
<?php
require(__DIR__ . '/../cli/_cli.php');
-/**
- * Writes to FreshRSS admin log, and if it is not already done by default,
- * writes to syslog (only if simplepie_syslog_enabled in FreshRSS configuration) and to STDOUT
- */
-function notice($message) {
- Minz_Log::notice($message, ADMIN_LOG);
- if (!COPY_LOG_TO_SYSLOG && SIMPLEPIE_SYSLOG_ENABLED) {
- syslog(LOG_NOTICE, $message);
- }
- if (defined('STDOUT') && !COPY_SYSLOG_TO_STDERR) {
- fwrite(STDOUT, $message . "\n"); //Unbuffered
- }
-}
-
session_cache_limiter('');
ob_implicit_flush(false);
ob_start();
@@ -35,6 +21,20 @@ FreshRSS_Context::initSystem();
FreshRSS_Context::$system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!)
define('SIMPLEPIE_SYSLOG_ENABLED', FreshRSS_Context::$system_conf->simplepie_syslog_enabled);
+/**
+ * Writes to FreshRSS admin log, and if it is not already done by default,
+ * writes to syslog (only if simplepie_syslog_enabled in FreshRSS configuration) and to STDOUT
+ */
+function notice($message) {
+ Minz_Log::notice($message, ADMIN_LOG);
+ if (!COPY_LOG_TO_SYSLOG && SIMPLEPIE_SYSLOG_ENABLED) {
+ syslog(LOG_NOTICE, $message);
+ }
+ if (defined('STDOUT') && !COPY_SYSLOG_TO_STDERR) {
+ fwrite(STDOUT, $message . "\n"); //Unbuffered
+ }
+}
+
notice('FreshRSS starting feeds actualization at ' . $begin_date->format('c'));
// make sure the PHP setup of the CLI environment is compatible with FreshRSS as well
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index 63dc28bd1..747f4e05f 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$actual_view = Minz_Request::actionName();
$class = '';
if (FreshRSS_Context::$user_conf->hide_read_feeds &&
diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml
index 5cf3e3ae0..cb9b6c1ba 100644
--- a/app/layout/layout.phtml
+++ b/app/layout/layout.phtml
@@ -1,4 +1,7 @@
-<?php FreshRSS::preLayout(); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ FreshRSS::preLayout();
+?>
<!DOCTYPE html>
<html lang="<?= FreshRSS_Context::$user_conf->language ?>" xml:lang="<?= FreshRSS_Context::$user_conf->language ?>"<?php
if (_t('gen.dir') === 'rtl') {
@@ -8,11 +11,11 @@ if (_t('gen.dir') === 'rtl') {
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1.0" />
- <?= self::headStyle() ?>
+ <?= FreshRSS_View::headStyle() ?>
<script id="jsonVars" type="application/json">
<?php $this->renderHelper('javascript_vars'); ?>
</script>
- <?= self::headScript() ?>
+ <?= FreshRSS_View::headScript() ?>
<link rel="manifest" href="<?= Minz_Url::display('/themes/manifest.json') ?>" />
<link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?= Minz_Url::display('/favicon.ico') ?>" />
<link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?= Minz_Url::display('/themes/icons/favicon-256.png') ?>" />
@@ -25,7 +28,7 @@ if (_t('gen.dir') === 'rtl') {
<?php if (!FreshRSS_Context::$system_conf->allow_referrer) { ?>
<meta name="referrer" content="never" />
<?php } ?>
- <?= self::headTitle() ?>
+ <?= FreshRSS_View::headTitle() ?>
<?php
$url_base = Minz_Request::currentRequest();
if (isset($this->rss_title)) {
diff --git a/app/layout/simple.phtml b/app/layout/simple.phtml
index 4357b6fdf..1858c3fed 100644
--- a/app/layout/simple.phtml
+++ b/app/layout/simple.phtml
@@ -1,14 +1,17 @@
-<?php FreshRSS::preLayout(); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ FreshRSS::preLayout();
+?>
<!DOCTYPE html>
<html lang="<?= FreshRSS_Context::$user_conf->language ?>" xml:lang="<?= FreshRSS_Context::$user_conf->language ?>">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1.0" />
- <?= self::headStyle() ?>
+ <?= FreshRSS_View::headStyle() ?>
<script id="jsonVars" type="application/json">
<?php $this->renderHelper('javascript_vars'); ?>
</script>
- <?= self::headScript() ?>
+ <?= FreshRSS_View::headScript() ?>
<link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?= Minz_Url::display('/favicon.ico') ?>" />
<link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?= Minz_Url::display('/themes/icons/favicon-256.png') ?>" />
<link rel="apple-touch-icon" href="<?= Minz_Url::display('/themes/icons/apple-touch-icon.png') ?>" />
@@ -18,7 +21,7 @@
<meta name="msapplication-TileColor" content="#FFF" />
<meta name="referrer" content="never" />
<meta name="robots" content="noindex,nofollow" />
- <?= self::headTitle() ?>
+ <?= FreshRSS_View::headTitle() ?>
</head>
<body>
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml
index e61aaf922..e218d089d 100644
--- a/app/views/auth/formLogin.phtml
+++ b/app/views/auth/formLogin.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<main class="prompt">
<h1><?= _t('gen.auth.login') ?></h1>
diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml
index 9c9cd1eaa..a18ab49e2 100644
--- a/app/views/auth/index.phtml
+++ b/app/views/auth/index.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/auth/register.phtml b/app/views/auth/register.phtml
index 7eb2af12f..a56eff3ee 100644
--- a/app/views/auth/register.phtml
+++ b/app/views/auth/register.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<main class="prompt">
<h1><?= _t('gen.auth.registration') ?></h1>
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml
index fd56c8dde..47281e2f1 100644
--- a/app/views/configure/archiving.phtml
+++ b/app/views/configure/archiving.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
@@ -7,7 +10,7 @@
<h1><?= _t('conf.archiving') ?></h1>
<p class="help"><?= _i('help') ?> <?= _t('conf.archiving.help') ?></p>
-
+
<form method="post" action="<?= _url('configure', 'archiving') ?>">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index dfb377893..e3e18f5a0 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
@@ -6,7 +9,7 @@
</div>
<h1><?= _t('conf.display') ?></h1>
-
+
<form method="post" action="<?= _url('configure', 'display') ?>">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml
index 9bd7257ee..c8d299f44 100644
--- a/app/views/configure/integration.phtml
+++ b/app/views/configure/integration.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
@@ -24,7 +27,7 @@
<a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="##help##"><?= _i('help') ?></a>
</div></div>' class="draggableList">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
-
+
<?php
foreach (FreshRSS_Context::$user_conf->sharing as $key => $share_options) {
$share = FreshRSS_Share::get($share_options['type']);
diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml
index 6de606639..3f15f299b 100644
--- a/app/views/configure/queries.phtml
+++ b/app/views/configure/queries.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/configure/query.phtml b/app/views/configure/query.phtml
index 6f38d9efb..316583bac 100644
--- a/app/views/configure/query.phtml
+++ b/app/views/configure/query.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
if ($this->query) {
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index da4e104a4..c021132aa 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -1,15 +1,18 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
</div>
-
+
<h1><?= _t('conf.reading') ?></h1>
<form method="post" action="<?= _url('configure', 'reading') ?>">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
-
+
<div class="form-group">
<label class="group-name" for="posts_per_page"><?= _t('conf.reading.articles_per_page') ?></label>
<div class="group-controls">
diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml
index ee671740e..ca4a42c86 100644
--- a/app/views/configure/shortcut.phtml
+++ b/app/views/configure/shortcut.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
@@ -25,7 +28,7 @@
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<noscript><p class="alert alert-error"><?= _t('conf.shortcut.javascript') ?></p></noscript>
-
+
<fieldset>
<legend><?= _t('conf.shortcut.views') ?></legend>
diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml
index fa9e11ce2..7f355d156 100644
--- a/app/views/configure/system.phtml
+++ b/app/views/configure/system.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml
index e842f7465..bab937f6c 100755
--- a/app/views/entry/bookmark.phtml
+++ b/app/views/entry/bookmark.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
header('Content-Type: application/json; charset=UTF-8');
diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml
index 44193da9c..0d87bf583 100755
--- a/app/views/entry/read.phtml
+++ b/app/views/entry/read.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
header('Content-Type: application/json; charset=UTF-8');
diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml
index 98473cc83..abebc8332 100644
--- a/app/views/error/index.phtml
+++ b/app/views/error/index.phtml
@@ -1,11 +1,12 @@
+<?php /** @var FreshRSS_View $this */ ?>
<main class="post">
<div class="alert alert-error">
<h1 class="alert-head"><?= $this->code ?></h1>
<p>
<?= htmlspecialchars($this->errorMessage, ENT_NOQUOTES, 'UTF-8') ?>
</p>
- <p>
- <?php if (FreshRSS_Auth::hasAccess()) {?>
+ <p>
+ <?php if (FreshRSS_Auth::hasAccess()) {?>
<a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
<?php } else { ?>
<a href="<?= _url('auth', 'login') ?>"><?= _t('gen.auth.login') ?></a>
diff --git a/app/views/extension/configure.phtml b/app/views/extension/configure.phtml
index 8933eeae5..27946e202 100644
--- a/app/views/extension/configure.phtml
+++ b/app/views/extension/configure.phtml
@@ -1,3 +1,3 @@
<?php
-
+/** @var FreshRSS_View $this */
$this->renderHelper('extension/configure');
diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml
index b9ae7a92c..ba789bebd 100644
--- a/app/views/extension/index.phtml
+++ b/app/views/extension/index.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml
index 55cfe0845..fb3d89ef5 100644
--- a/app/views/feed/add.phtml
+++ b/app/views/feed/add.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php if ($this->feed) { ?>
<main class="post">
<h1><?= _t('sub.feed.add') ?></h1>
diff --git a/app/views/feed/contentSelectorPreview.phtml b/app/views/feed/contentSelectorPreview.phtml
index 3bb27859a..7ff251e38 100644
--- a/app/views/feed/contentSelectorPreview.phtml
+++ b/app/views/feed/contentSelectorPreview.phtml
@@ -1,8 +1,11 @@
-<?php FreshRSS::preLayout(); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ FreshRSS::preLayout();
+?>
<!DOCTYPE html>
<html class="preview_background" lang="<?= FreshRSS_Context::$user_conf->language ?>" xml:lang="<?= FreshRSS_Context::$user_conf->language ?>">
<head>
- <?= self::headStyle() ?>
+ <?= FreshRSS_View::headStyle() ?>
<script src="<?= Minz_Url::display('/scripts/preview.js?' . @filemtime(PUBLIC_PATH . '/scripts/preview.js')) ?>"></script>
</head>
<body class="preview_background">
diff --git a/app/views/helpers/category/update.phtml b/app/views/helpers/category/update.phtml
index 085b49aa6..291dd7fc4 100644
--- a/app/views/helpers/category/update.phtml
+++ b/app/views/helpers/category/update.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h2><?= $this->category->name() ?></h2>
@@ -30,7 +31,7 @@
<div class="group-controls">
<button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
-
+
</div>
</div>
diff --git a/app/views/helpers/configure/query.phtml b/app/views/helpers/configure/query.phtml
index a9bf4478d..3dc6c2459 100644
--- a/app/views/helpers/configure/query.phtml
+++ b/app/views/helpers/configure/query.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h2><?= $this->query->getName() ?></h2>
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
index 0bbfb86ec..c131b8474 100644
--- a/app/views/helpers/export/articles.phtml
+++ b/app/views/helpers/export/articles.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$username = Minz_Session::param('currentUser', '_');
$options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
index edb4d4eda..971dc1445 100644
--- a/app/views/helpers/export/opml.phtml
+++ b/app/views/helpers/export/opml.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$opml_array = array(
'head' => array(
diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml
index 4f8c521ae..ea68287b1 100644
--- a/app/views/helpers/extension/configure.phtml
+++ b/app/views/helpers/extension/configure.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h2>
<?= $this->extension->getName() ?> (<?= $this->extension->getVersion() ?>) —
diff --git a/app/views/helpers/extension/details.phtml b/app/views/helpers/extension/details.phtml
index ed9674e3d..f6b361c6f 100644
--- a/app/views/helpers/extension/details.phtml
+++ b/app/views/helpers/extension/details.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<ul class="horizontal-list">
<li class="item">
<?php if ($this->ext_details->getType() === 'user' || FreshRSS_Auth::hasAccess('admin')) { ?>
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 703de3202..949c6492f 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<div class="post">
<h1><?= $this->feed->name() ?></h1>
diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml
index bf1dc7b3d..07e68ed92 100644
--- a/app/views/helpers/index/normal/entry_bottom.phtml
+++ b/app/views/helpers/index/normal/entry_bottom.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$sharing = array();
if (FreshRSS_Auth::hasAccess()) {
$sharing = FreshRSS_Context::$user_conf->sharing;
diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml
index 784a440a0..79e6e4215 100644
--- a/app/views/helpers/index/normal/entry_header.phtml
+++ b/app/views/helpers/index/normal/entry_header.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$topline_read = FreshRSS_Context::$user_conf->topline_read;
$topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;
$topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail;
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 256b6bf5f..3860c6204 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$mark = FreshRSS_Context::$user_conf->mark_when;
$s = FreshRSS_Context::$user_conf->shortcuts;
$extData = Minz_ExtensionManager::callHook('js_vars', []);
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml
index fa69d0b44..fe6a71a3a 100755
--- a/app/views/helpers/logs_pagination.phtml
+++ b/app/views/helpers/logs_pagination.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$c = Minz_Request::controllerName();
$a = Minz_Request::actionName();
$params = $_GET;
@@ -6,7 +7,10 @@
<?php if ($this->nbPage > 1) { ?>
<ul class="pagination">
- <?php $params[$getteur] = 1; ?>
+ <?php
+ /** @var int $getteur */
+ $params[$getteur] = 1;
+ ?>
<li class="item pager-first">
<?php if ($this->currentPage > 1) { ?>
<a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('gen.pagination.first') ?></a>
diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml
index cefa835bd..9b249762c 100755
--- a/app/views/helpers/pagination.phtml
+++ b/app/views/helpers/pagination.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$url_next = Minz_Request::currentRequest();
$url_next['params']['next'] = FreshRSS_Context::$next_id;
$url_next['params']['state'] = FreshRSS_Context::$state;
diff --git a/app/views/importExport/export.phtml b/app/views/importExport/export.phtml
index 399e72d00..21ed71b2d 100644
--- a/app/views/importExport/export.phtml
+++ b/app/views/importExport/export.phtml
@@ -1 +1,2 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?= $this->content ?>
diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml
index 69e10ea27..c5bc97446 100644
--- a/app/views/importExport/index.phtml
+++ b/app/views/importExport/index.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post ">
<div class="link-back-wrapper">
diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml
index cd8cfcade..e25e9a119 100644
--- a/app/views/index/about.phtml
+++ b/app/views/index/about.phtml
@@ -1,6 +1,9 @@
-<?php if (FreshRSS_Auth::hasAccess()) {?>
-<?php $this->partial('aside_configure'); ?>
-<?php } ?>
+<?php
+ /** @var FreshRSS_View $this */
+ if (FreshRSS_Auth::hasAccess()) {
+ $this->partial('aside_configure');
+ }
+?>
<main class="post content">
<?php if (FreshRSS_Auth::hasAccess()) {?>
diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml
index ce1132df5..ff5fceaed 100644
--- a/app/views/index/global.phtml
+++ b/app/views/index/global.phtml
@@ -1,4 +1,5 @@
<?php
+ /** @var FreshRSS_View $this */
$this->partial('nav_menu');
$class = '';
diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml
index bcdc5b073..a8e78810c 100644
--- a/app/views/index/logs.phtml
+++ b/app/views/index/logs.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<main class="post content">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index 4adc7047e..eb388fad3 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -1,4 +1,5 @@
<?php
+/** @var FreshRSS_View $this */
$this->partial('aside_feed');
$this->partial('nav_menu');
diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml
index 6b68ea08f..315d7d7aa 100644
--- a/app/views/index/reader.phtml
+++ b/app/views/index/reader.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
$this->partial('aside_feed');
$this->partial('nav_menu');
diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml
index 00be01c28..f0772cc86 100755
--- a/app/views/index/rss.phtml
+++ b/app/views/index/rss.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?= '<?xml version="1.0" encoding="UTF-8" ?>'; ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
diff --git a/app/views/index/tos.phtml b/app/views/index/tos.phtml
index f8240ed29..5e7f8ea58 100644
--- a/app/views/index/tos.phtml
+++ b/app/views/index/tos.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<main class="post content">
<?php if ($this->can_register) { ?>
<a href="<?= _url('auth', 'register') ?>">
diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml
index 3baabf748..c154137f6 100644
--- a/app/views/javascript/actualize.phtml
+++ b/app/views/javascript/actualize.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
$feeds = array();
foreach ($this->feeds as $feed) {
diff --git a/app/views/javascript/nbUnreadsPerFeed.phtml b/app/views/javascript/nbUnreadsPerFeed.phtml
index ce4db37b7..261f2a179 100644
--- a/app/views/javascript/nbUnreadsPerFeed.phtml
+++ b/app/views/javascript/nbUnreadsPerFeed.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
$result = array(
'feeds' => array(),
diff --git a/app/views/javascript/nonce.phtml b/app/views/javascript/nonce.phtml
index 4ac46c8fc..f565baa85 100644
--- a/app/views/javascript/nonce.phtml
+++ b/app/views/javascript/nonce.phtml
@@ -1,2 +1,3 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
echo json_encode(array('salt1' => $this->salt1, 'nonce' => $this->nonce));
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml
index 8efaef5e9..40feb4a03 100644
--- a/app/views/stats/idle.phtml
+++ b/app/views/stats/idle.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml
index 26e3f0dbc..2d7e941b6 100644
--- a/app/views/stats/index.phtml
+++ b/app/views/stats/index.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml
index 86cc1b6bc..803d39b8e 100644
--- a/app/views/stats/repartition.phtml
+++ b/app/views/stats/repartition.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post ">
<div class="link-back-wrapper">
diff --git a/app/views/subscription/add.phtml b/app/views/subscription/add.phtml
index 5eff9c5d1..df74b24f2 100644
--- a/app/views/subscription/add.phtml
+++ b/app/views/subscription/add.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post drop-section">
<div class="link-back-wrapper">
@@ -25,7 +28,7 @@
<h2><?= _t('sub.title.add_feed') ?></h2>
<form id="add_rss" method="post" action="<?= _url('feed', 'add') ?>" autocomplete="off">
-
+
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<div class="form-group">
diff --git a/app/views/subscription/bookmarklet.phtml b/app/views/subscription/bookmarklet.phtml
index 90c349c0b..540bf8e52 100644
--- a/app/views/subscription/bookmarklet.phtml
+++ b/app/views/subscription/bookmarklet.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/subscription/category.phtml b/app/views/subscription/category.phtml
index 38746f23c..90de4e11b 100644
--- a/app/views/subscription/category.phtml
+++ b/app/views/subscription/category.phtml
@@ -1,5 +1,5 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
-
if ($this->category) {
$this->renderHelper('category/update');
}
diff --git a/app/views/subscription/feed.phtml b/app/views/subscription/feed.phtml
index 1a167777f..efe75068d 100644
--- a/app/views/subscription/feed.phtml
+++ b/app/views/subscription/feed.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
if (!Minz_Request::param('ajax')) {
diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml
index a8bc9ae27..e16d6ad95 100644
--- a/app/views/subscription/index.phtml
+++ b/app/views/subscription/index.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post drop-section">
<div class="link-back-wrapper">
@@ -14,7 +17,7 @@
<p class="alert alert-warn">
<?= _t('sub.feed.showing.error') ?>
</p>
-
+
<?php endif; ?>
<?php if (!$this->onlyFeedsWithError && $this->signalError){ ?>
diff --git a/app/views/tag/getTagsForEntry.phtml b/app/views/tag/getTagsForEntry.phtml
index 76b2ada4e..9125ae84b 100644
--- a/app/views/tag/getTagsForEntry.phtml
+++ b/app/views/tag/getTagsForEntry.phtml
@@ -1,2 +1,3 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
echo json_encode($this->tags);
diff --git a/app/views/tag/index.phtml b/app/views/tag/index.phtml
index e538f96e2..c80e0c209 100644
--- a/app/views/tag/index.phtml
+++ b/app/views/tag/index.phtml
@@ -1,10 +1,13 @@
-<?php $this->partial('aside_subscription'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_subscription');
+?>
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
</div>
-
+
<h1><?= _t('sub.menu.label_management') ?></h1>
<h2><?= _t('sub.title.add_label') ?></h2>
diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml
index b96b3f07f..077eb2184 100644
--- a/app/views/update/apply.phtml
+++ b/app/views/update/apply.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
@@ -7,5 +10,8 @@
<h1><?= _t('admin.update') ?></h1>
- <?php ask_info_update(); ?>
+ <?php
+ // @phpstan-ignore-next-line
+ ask_info_update();
+ ?>
</main>
diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml
index 0e324de4a..393a9fdee 100644
--- a/app/views/update/checkInstall.phtml
+++ b/app/views/update/checkInstall.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml
index 359e35bea..d2838a5a5 100644
--- a/app/views/update/index.phtml
+++ b/app/views/update/index.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
diff --git a/app/views/user/details.phtml b/app/views/user/details.phtml
index 6de1a6097..af388c713 100644
--- a/app/views/user/details.phtml
+++ b/app/views/user/details.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<?php $isDefault = $this->details['is_default']; ?>
<?php $isAdmin = $this->details['is_admin']; ?>
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml
index ae66e4b2f..0d01d33d7 100644
--- a/app/views/user/manage.phtml
+++ b/app/views/user/manage.phtml
@@ -1,4 +1,7 @@
-<?php $this->partial('aside_configure'); ?>
+<?php
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
@@ -12,7 +15,7 @@
<input type="hidden" name="originController" value="<?= Minz_Request::controllerName() ?>" />
<input type="hidden" name="originAction" value="<?= Minz_Request::actionName() ?>" />
-
+
<div class="form-group">
<label class="group-name" for="new_user_language"><?= _t('admin.user.language') ?></label>
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml
index 39b138c78..99ebcb326 100644
--- a/app/views/user/profile.phtml
+++ b/app/views/user/profile.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?php
if (!$this->disable_aside) {
$this->partial('aside_configure');
@@ -103,7 +104,7 @@
<form id="crypto-form" method="post" action="<?= _url('user', 'delete') ?>">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
-
+
<p class="alert alert-warn"><span class="alert-head"><?= _t('gen.short.attention') ?></span> <?= _t('conf.profile.delete.warn') ?></p>
<div class="form-group">
diff --git a/app/views/user/validateEmail.phtml b/app/views/user/validateEmail.phtml
index 31c19f738..bd36510dd 100644
--- a/app/views/user/validateEmail.phtml
+++ b/app/views/user/validateEmail.phtml
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<main class="post">
<p>
<?= _t('user.email.validation.need_to', FreshRSS_Context::$system_conf->title) ?>
diff --git a/app/views/user_mailer/email_need_validation.txt.php b/app/views/user_mailer/email_need_validation.txt.php
index c1f4d9911..2785911bf 100644
--- a/app/views/user_mailer/email_need_validation.txt.php
+++ b/app/views/user_mailer/email_need_validation.txt.php
@@ -1,3 +1,4 @@
+<?php /** @var FreshRSS_View $this */ ?>
<?= _t('user.mailer.email_need_validation.welcome', $this->username) ?>
<?= _t('user.mailer.email_need_validation.body', $this->site_title) ?>