From 9f55454f63b11ad8d2b2e0a8264a0f0dae919f6b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Feb 2021 16:51:35 +0300 Subject: [PATCH] remove the rest of db.php; rename some leftover methods in feeds --- api/index.php | 1 - backend.php | 1 - classes/feeds.php | 12 ++++++------ include/db-prefs.php | 2 -- include/sessions.php | 1 - js/App.js | 3 +-- js/FeedTree.js | 2 +- opml.php | 1 - public.php | 1 - update.php | 1 - update_daemon2.php | 1 - 11 files changed, 8 insertions(+), 18 deletions(-) diff --git a/api/index.php b/api/index.php index 9e998df84..664e92abe 100644 --- a/api/index.php +++ b/api/index.php @@ -14,7 +14,6 @@ define('NO_SESSION_AUTOSTART', true); require_once "autoload.php"; - require_once "db.php"; require_once "db-prefs.php"; require_once "functions.php"; require_once "sessions.php"; diff --git a/backend.php b/backend.php index e72d97ca4..89b06b7eb 100644 --- a/backend.php +++ b/backend.php @@ -27,7 +27,6 @@ require_once "sessions.php"; require_once "functions.php"; require_once "config.php"; - require_once "db.php"; require_once "db-prefs.php"; $op = (string)clean($op); diff --git a/classes/feeds.php b/classes/feeds.php index 07e3aa455..2a3efdb92 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -438,7 +438,7 @@ class Feeds extends Handler_Protected { * when there's nothing to load - e.g. no stuff in fresh feed */ if ($feed == -5) { - print json_encode($this->generate_dashboard_feed()); + print json_encode($this->_generate_dashboard_feed()); return; } @@ -466,7 +466,7 @@ class Feeds extends Handler_Protected { } if ($sth && !$sth->fetch()) { - print json_encode($this->generate_error_feed(__("Feed not found."))); + print json_encode($this->_generate_error_feed(__("Feed not found."))); return; } @@ -523,7 +523,7 @@ class Feeds extends Handler_Protected { } - private function generate_dashboard_feed() { + private function _generate_dashboard_feed() { $reply = array(); $reply['headlines']['id'] = -5; @@ -565,7 +565,7 @@ class Feeds extends Handler_Protected { return $reply; } - private function generate_error_feed($error) { + private function _generate_error_feed($error) { $reply = array(); $reply['headlines']['id'] = -7; @@ -630,7 +630,7 @@ class Feeds extends Handler_Protected { print ""; } - function update_debugger() { + function updatedebugger() { header("Content-type: text/html"); $xdebug = isset($_REQUEST["xdebug"]) ? (int)$_REQUEST["xdebug"] : 1; @@ -690,7 +690,7 @@ class Feeds extends Handler_Protected {
- + diff --git a/include/db-prefs.php b/include/db-prefs.php index 91235b479..ce5753638 100644 --- a/include/db-prefs.php +++ b/include/db-prefs.php @@ -1,6 +1,4 @@ read($pref_name, $user_id, $die_on_error); } diff --git a/include/sessions.php b/include/sessions.php index 3119a4e07..4de894c95 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -2,7 +2,6 @@ // Original from http://www.daniweb.com/code/snippet43.html require_once "config.php"; - require_once "classes/db.php"; require_once "autoload.php"; require_once "errorhandler.php"; require_once "lib/gettext/gettext.inc.php"; diff --git a/js/App.js b/js/App.js index 5c2d7726c..4b2adc388 100644 --- a/js/App.js +++ b/js/App.js @@ -998,10 +998,9 @@ const App = { }; this.hotkey_actions["feed_debug_update"] = () => { if (!Feeds.activeIsCat() && parseInt(Feeds.getActive()) > 0) { - //window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + Feeds.getActive()); /* global __csrf_token */ - App.postOpenWindow("backend.php", {op: "feeds", method: "update_debugger", + App.postOpenWindow("backend.php", {op: "feeds", method: "updatedebugger", feed_id: Feeds.getActive(), csrf_token: __csrf_token}); } else { diff --git a/js/FeedTree.js b/js/FeedTree.js index 26c1c916c..694cf8332 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -102,7 +102,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co label: __("Debug feed"), onClick: function() { /* global __csrf_token */ - App.postOpenWindow("backend.php", {op: "feeds", method: "update_debugger", + App.postOpenWindow("backend.php", {op: "feeds", method: "updatedebugger", feed_id: this.getParent().row_id, csrf_token: __csrf_token}); }})); } diff --git a/opml.php b/opml.php index 9b7809e0e..6f13a6f3c 100644 --- a/opml.php +++ b/opml.php @@ -7,7 +7,6 @@ require_once "sessions.php"; require_once "sanity_check.php"; require_once "config.php"; - require_once "db.php"; require_once "db-prefs.php"; if (!init_plugins()) return; diff --git a/public.php b/public.php index dcfc4056e..59b5a499c 100644 --- a/public.php +++ b/public.php @@ -7,7 +7,6 @@ require_once "functions.php"; require_once "sanity_check.php"; require_once "config.php"; - require_once "db.php"; require_once "db-prefs.php"; startup_gettext(); diff --git a/update.php b/update.php index cb927e49a..1f79dccf0 100755 --- a/update.php +++ b/update.php @@ -11,7 +11,6 @@ require_once "functions.php"; require_once "config.php"; require_once "sanity_check.php"; - require_once "db.php"; require_once "db-prefs.php"; function make_stampfile($filename) { diff --git a/update_daemon2.php b/update_daemon2.php index 61cc85617..2a016df48 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -19,7 +19,6 @@ define_default('SPAWN_INTERVAL', DAEMON_SLEEP_INTERVAL); // seconds require_once "sanity_check.php"; - require_once "db.php"; require_once "db-prefs.php"; if (!function_exists('pcntl_fork')) {