First cut of item-with-feed and list impl
- Add strict types to all files - Convert many queries to document commands
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Home Page
|
||||
*
|
||||
@@ -8,15 +9,15 @@
|
||||
use BitBadger\Documents\SQLite\Configuration;
|
||||
use FeedReaderCentral\Feed;
|
||||
use FeedReaderCentral\ItemList;
|
||||
use FeedReaderCentral\Security;
|
||||
|
||||
include '../start.php';
|
||||
|
||||
Security::verifyUser();
|
||||
FeedReaderCentral\Security::verifyUser();
|
||||
|
||||
$db = Configuration::dbConn();
|
||||
if (key_exists('refresh', $_GET)) {
|
||||
$db = Configuration::dbConn();
|
||||
$refreshResult = Feed::refreshAll($db);
|
||||
$db->close();
|
||||
if (key_exists('ok', $refreshResult)) {
|
||||
add_info('All feeds refreshed successfully');
|
||||
} else {
|
||||
@@ -25,8 +26,8 @@ if (key_exists('refresh', $_GET)) {
|
||||
}
|
||||
|
||||
$list = match (true) {
|
||||
key_exists('bookmarked', $_GET) => ItemList::allBookmarked($db),
|
||||
default => ItemList::allUnread($db)
|
||||
key_exists('bookmarked', $_GET) => ItemList::allBookmarked(),
|
||||
default => ItemList::allUnread()
|
||||
};
|
||||
$title = "Your $list->itemType Items";
|
||||
|
||||
@@ -39,4 +40,3 @@ if ($list->itemType == 'Unread') {
|
||||
echo '</h1>';
|
||||
$list->render();
|
||||
page_foot();
|
||||
$db->close();
|
||||
|
||||
Reference in New Issue
Block a user