From 865ecc87963dc3b26e66296616eef2a1cc41ac3f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 25 Oct 2023 12:55:09 +0300 Subject: [PATCH] move to psr-4 autoloader --- backend.php | 2 +- classes/{api.php => API.php} | 0 classes/{article.php => Article.php} | 0 classes/{auth/base.php => Auth_Base.php} | 0 .../{cache/adapter.php => Cache_Adapter.php} | 0 classes/{cache/local.php => Cache_Local.php} | 0 classes/{config.php => Config.php} | 0 classes/{counters.php => Counters.php} | 0 classes/{db.php => Db.php} | 0 .../{db/migrations.php => Db_Migrations.php} | 0 classes/{db/prefs.php => Db_Prefs.php} | 0 classes/{debug.php => Debug.php} | 0 classes/{digest.php => Digest.php} | 0 classes/{diskcache.php => DiskCache.php} | 0 classes/{errors.php => Errors.php} | 0 .../{feedenclosure.php => FeedEnclosure.php} | 0 classes/{feeditem.php => FeedItem.php} | 0 .../{feeditem/atom.php => FeedItem_Atom.php} | 0 .../common.php => FeedItem_Common.php} | 0 .../{feeditem/rss.php => FeedItem_RSS.php} | 0 classes/{feedparser.php => FeedParser.php} | 0 classes/{feeds.php => Feeds.php} | 0 classes/{handler.php => Handler.php} | 0 ...trative.php => Handler_Administrative.php} | 0 .../protected.php => Handler_Protected.php} | 0 .../public.php => Handler_Public.php} | 0 classes/{iauthmodule.php => IAuthModule.php} | 0 classes/{icatchall.php => ICatchall.php} | 0 classes/{ihandler.php => IHandler.php} | 0 .../{ivirtualfeed.php => IVirtualFeed.php} | 0 classes/{labels.php => Labels.php} | 0 classes/{logger.php => Logger.php} | 0 .../adapter.php => Logger_Adapter.php} | 0 classes/{logger/sql.php => Logger_SQL.php} | 0 .../{logger/stdout.php => Logger_Stdout.php} | 0 .../{logger/syslog.php => Logger_Syslog.php} | 0 classes/{mailer.php => Mailer.php} | 0 classes/{opml.php => OPML.php} | 0 classes/{plugin.php => Plugin.php} | 0 .../{pluginhandler.php => PluginHandler.php} | 0 classes/{pluginhost.php => PluginHost.php} | 0 classes/{pref/feeds.php => Pref_Feeds.php} | 6 +-- .../{pref/filters.php => Pref_Filters.php} | 2 +- classes/{pref/labels.php => Pref_Labels.php} | 2 +- classes/{pref/prefs.php => Pref_Prefs.php} | 14 +++--- classes/{pref/system.php => Pref_System.php} | 4 +- classes/{pref/users.php => Pref_Users.php} | 0 classes/{prefs.php => Prefs.php} | 0 classes/{rpc.php => RPC.php} | 0 classes/{rssutils.php => RSSUtils.php} | 0 classes/{sanitizer.php => Sanitizer.php} | 0 classes/{templator.php => Templator.php} | 0 classes/{timehelper.php => TimeHelper.php} | 0 classes/{tracer.php => Tracer.php} | 0 classes/{urlhelper.php => UrlHelper.php} | 0 classes/{userhelper.php => UserHelper.php} | 0 composer.json | 5 ++ include/autoload.php | 15 ------ js/App.js | 28 +++++------ js/Article.js | 8 ++-- js/CommonDialogs.js | 24 +++++----- js/CommonFilters.js | 16 +++---- js/FeedTree.js | 4 +- js/Feeds.js | 16 +++---- js/Headlines.js | 20 ++++---- js/PrefFeedStore.js | 2 +- js/PrefFeedTree.js | 30 ++++++------ js/PrefFilterStore.js | 2 +- js/PrefFilterTree.js | 8 ++-- js/PrefHelpers.js | 46 +++++++++---------- js/PrefLabelTree.js | 12 ++--- js/PrefUsers.js | 14 +++--- prefs.php | 12 ++--- vendor/composer/autoload_psr4.php | 1 + vendor/composer/autoload_static.php | 5 ++ 75 files changed, 147 insertions(+), 151 deletions(-) rename classes/{api.php => API.php} (100%) mode change 100755 => 100644 rename classes/{article.php => Article.php} (100%) mode change 100755 => 100644 rename classes/{auth/base.php => Auth_Base.php} (100%) rename classes/{cache/adapter.php => Cache_Adapter.php} (100%) rename classes/{cache/local.php => Cache_Local.php} (100%) rename classes/{config.php => Config.php} (100%) rename classes/{counters.php => Counters.php} (100%) rename classes/{db.php => Db.php} (100%) mode change 100755 => 100644 rename classes/{db/migrations.php => Db_Migrations.php} (100%) rename classes/{db/prefs.php => Db_Prefs.php} (100%) rename classes/{debug.php => Debug.php} (100%) rename classes/{digest.php => Digest.php} (100%) rename classes/{diskcache.php => DiskCache.php} (100%) rename classes/{errors.php => Errors.php} (100%) rename classes/{feedenclosure.php => FeedEnclosure.php} (100%) rename classes/{feeditem.php => FeedItem.php} (100%) rename classes/{feeditem/atom.php => FeedItem_Atom.php} (100%) mode change 100755 => 100644 rename classes/{feeditem/common.php => FeedItem_Common.php} (100%) mode change 100755 => 100644 rename classes/{feeditem/rss.php => FeedItem_RSS.php} (100%) mode change 100755 => 100644 rename classes/{feedparser.php => FeedParser.php} (100%) rename classes/{feeds.php => Feeds.php} (100%) mode change 100755 => 100644 rename classes/{handler.php => Handler.php} (100%) rename classes/{handler/administrative.php => Handler_Administrative.php} (100%) rename classes/{handler/protected.php => Handler_Protected.php} (100%) rename classes/{handler/public.php => Handler_Public.php} (100%) mode change 100755 => 100644 rename classes/{iauthmodule.php => IAuthModule.php} (100%) rename classes/{icatchall.php => ICatchall.php} (100%) rename classes/{ihandler.php => IHandler.php} (100%) rename classes/{ivirtualfeed.php => IVirtualFeed.php} (100%) rename classes/{labels.php => Labels.php} (100%) rename classes/{logger.php => Logger.php} (100%) mode change 100755 => 100644 rename classes/{logger/adapter.php => Logger_Adapter.php} (100%) rename classes/{logger/sql.php => Logger_SQL.php} (100%) mode change 100755 => 100644 rename classes/{logger/stdout.php => Logger_Stdout.php} (100%) rename classes/{logger/syslog.php => Logger_Syslog.php} (100%) rename classes/{mailer.php => Mailer.php} (100%) rename classes/{opml.php => OPML.php} (100%) rename classes/{plugin.php => Plugin.php} (100%) rename classes/{pluginhandler.php => PluginHandler.php} (100%) rename classes/{pluginhost.php => PluginHost.php} (100%) mode change 100755 => 100644 rename classes/{pref/feeds.php => Pref_Feeds.php} (99%) mode change 100755 => 100644 rename classes/{pref/filters.php => Pref_Filters.php} (99%) mode change 100755 => 100644 rename classes/{pref/labels.php => Pref_Labels.php} (99%) rename classes/{pref/prefs.php => Pref_Prefs.php} (99%) rename classes/{pref/system.php => Pref_System.php} (98%) rename classes/{pref/users.php => Pref_Users.php} (100%) rename classes/{prefs.php => Prefs.php} (100%) rename classes/{rpc.php => RPC.php} (100%) mode change 100755 => 100644 rename classes/{rssutils.php => RSSUtils.php} (100%) mode change 100755 => 100644 rename classes/{sanitizer.php => Sanitizer.php} (100%) rename classes/{templator.php => Templator.php} (100%) rename classes/{timehelper.php => TimeHelper.php} (100%) rename classes/{tracer.php => Tracer.php} (100%) rename classes/{urlhelper.php => UrlHelper.php} (100%) rename classes/{userhelper.php => UserHelper.php} (100%) diff --git a/backend.php b/backend.php index c316bcc44..44d4284c3 100644 --- a/backend.php +++ b/backend.php @@ -112,7 +112,7 @@ $op = "pluginhandler"; } */ - $op = str_replace("-", "_", $op); + // $op = str_replace(, "_", $op); $override = PluginHost::getInstance()->lookup_handler($op, $method); diff --git a/classes/api.php b/classes/API.php old mode 100755 new mode 100644 similarity index 100% rename from classes/api.php rename to classes/API.php diff --git a/classes/article.php b/classes/Article.php old mode 100755 new mode 100644 similarity index 100% rename from classes/article.php rename to classes/Article.php diff --git a/classes/auth/base.php b/classes/Auth_Base.php similarity index 100% rename from classes/auth/base.php rename to classes/Auth_Base.php diff --git a/classes/cache/adapter.php b/classes/Cache_Adapter.php similarity index 100% rename from classes/cache/adapter.php rename to classes/Cache_Adapter.php diff --git a/classes/cache/local.php b/classes/Cache_Local.php similarity index 100% rename from classes/cache/local.php rename to classes/Cache_Local.php diff --git a/classes/config.php b/classes/Config.php similarity index 100% rename from classes/config.php rename to classes/Config.php diff --git a/classes/counters.php b/classes/Counters.php similarity index 100% rename from classes/counters.php rename to classes/Counters.php diff --git a/classes/db.php b/classes/Db.php old mode 100755 new mode 100644 similarity index 100% rename from classes/db.php rename to classes/Db.php diff --git a/classes/db/migrations.php b/classes/Db_Migrations.php similarity index 100% rename from classes/db/migrations.php rename to classes/Db_Migrations.php diff --git a/classes/db/prefs.php b/classes/Db_Prefs.php similarity index 100% rename from classes/db/prefs.php rename to classes/Db_Prefs.php diff --git a/classes/debug.php b/classes/Debug.php similarity index 100% rename from classes/debug.php rename to classes/Debug.php diff --git a/classes/digest.php b/classes/Digest.php similarity index 100% rename from classes/digest.php rename to classes/Digest.php diff --git a/classes/diskcache.php b/classes/DiskCache.php similarity index 100% rename from classes/diskcache.php rename to classes/DiskCache.php diff --git a/classes/errors.php b/classes/Errors.php similarity index 100% rename from classes/errors.php rename to classes/Errors.php diff --git a/classes/feedenclosure.php b/classes/FeedEnclosure.php similarity index 100% rename from classes/feedenclosure.php rename to classes/FeedEnclosure.php diff --git a/classes/feeditem.php b/classes/FeedItem.php similarity index 100% rename from classes/feeditem.php rename to classes/FeedItem.php diff --git a/classes/feeditem/atom.php b/classes/FeedItem_Atom.php old mode 100755 new mode 100644 similarity index 100% rename from classes/feeditem/atom.php rename to classes/FeedItem_Atom.php diff --git a/classes/feeditem/common.php b/classes/FeedItem_Common.php old mode 100755 new mode 100644 similarity index 100% rename from classes/feeditem/common.php rename to classes/FeedItem_Common.php diff --git a/classes/feeditem/rss.php b/classes/FeedItem_RSS.php old mode 100755 new mode 100644 similarity index 100% rename from classes/feeditem/rss.php rename to classes/FeedItem_RSS.php diff --git a/classes/feedparser.php b/classes/FeedParser.php similarity index 100% rename from classes/feedparser.php rename to classes/FeedParser.php diff --git a/classes/feeds.php b/classes/Feeds.php old mode 100755 new mode 100644 similarity index 100% rename from classes/feeds.php rename to classes/Feeds.php diff --git a/classes/handler.php b/classes/Handler.php similarity index 100% rename from classes/handler.php rename to classes/Handler.php diff --git a/classes/handler/administrative.php b/classes/Handler_Administrative.php similarity index 100% rename from classes/handler/administrative.php rename to classes/Handler_Administrative.php diff --git a/classes/handler/protected.php b/classes/Handler_Protected.php similarity index 100% rename from classes/handler/protected.php rename to classes/Handler_Protected.php diff --git a/classes/handler/public.php b/classes/Handler_Public.php old mode 100755 new mode 100644 similarity index 100% rename from classes/handler/public.php rename to classes/Handler_Public.php diff --git a/classes/iauthmodule.php b/classes/IAuthModule.php similarity index 100% rename from classes/iauthmodule.php rename to classes/IAuthModule.php diff --git a/classes/icatchall.php b/classes/ICatchall.php similarity index 100% rename from classes/icatchall.php rename to classes/ICatchall.php diff --git a/classes/ihandler.php b/classes/IHandler.php similarity index 100% rename from classes/ihandler.php rename to classes/IHandler.php diff --git a/classes/ivirtualfeed.php b/classes/IVirtualFeed.php similarity index 100% rename from classes/ivirtualfeed.php rename to classes/IVirtualFeed.php diff --git a/classes/labels.php b/classes/Labels.php similarity index 100% rename from classes/labels.php rename to classes/Labels.php diff --git a/classes/logger.php b/classes/Logger.php old mode 100755 new mode 100644 similarity index 100% rename from classes/logger.php rename to classes/Logger.php diff --git a/classes/logger/adapter.php b/classes/Logger_Adapter.php similarity index 100% rename from classes/logger/adapter.php rename to classes/Logger_Adapter.php diff --git a/classes/logger/sql.php b/classes/Logger_SQL.php old mode 100755 new mode 100644 similarity index 100% rename from classes/logger/sql.php rename to classes/Logger_SQL.php diff --git a/classes/logger/stdout.php b/classes/Logger_Stdout.php similarity index 100% rename from classes/logger/stdout.php rename to classes/Logger_Stdout.php diff --git a/classes/logger/syslog.php b/classes/Logger_Syslog.php similarity index 100% rename from classes/logger/syslog.php rename to classes/Logger_Syslog.php diff --git a/classes/mailer.php b/classes/Mailer.php similarity index 100% rename from classes/mailer.php rename to classes/Mailer.php diff --git a/classes/opml.php b/classes/OPML.php similarity index 100% rename from classes/opml.php rename to classes/OPML.php diff --git a/classes/plugin.php b/classes/Plugin.php similarity index 100% rename from classes/plugin.php rename to classes/Plugin.php diff --git a/classes/pluginhandler.php b/classes/PluginHandler.php similarity index 100% rename from classes/pluginhandler.php rename to classes/PluginHandler.php diff --git a/classes/pluginhost.php b/classes/PluginHost.php old mode 100755 new mode 100644 similarity index 100% rename from classes/pluginhost.php rename to classes/PluginHost.php diff --git a/classes/pref/feeds.php b/classes/Pref_Feeds.php old mode 100755 new mode 100644 similarity index 99% rename from classes/pref/feeds.php rename to classes/Pref_Feeds.php index fa56f6d1a..60da4f18c --- a/classes/pref/feeds.php +++ b/classes/Pref_Feeds.php @@ -620,7 +620,7 @@ class Pref_Feeds extends Handler_Protected { ?> - +
@@ -959,7 +959,7 @@ class Pref_Feeds extends Handler_Protected {
+ url="backend.php?op=Pref_Feeds&method=getfeedtree">
- +
+ url="backend.php?op=Pref_Filters&method=getfiltertree">
+ url='backend.php?op=Pref_Labels&method=getlabeltree'>
- + - +
@@ -210,7 +210,7 @@ class Pref_System extends Handler_Administrative { @@ -242,7 +242,7 @@ const Helpers = { if (confirm(__("Activate selected profile?"))) { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-prefs", method: "activateprofile", id: sel_rows.toString()}, () => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "activateprofile", id: sel_rows.toString()}, () => { window.location.reload(); }); } @@ -312,7 +312,7 @@ const Helpers = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhr.json("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "customizeCSS"}, (reply) => { const editor = dijit.getEnclosingWidget(dialog.domNode.querySelector(".user-css-editor")); @@ -327,14 +327,14 @@ const Helpers = { }, confirmReset: function() { if (confirm(__("Reset to defaults?"))) { - xhr.post("backend.php", {op: "pref-prefs", method: "resetconfig"}, (reply) => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "resetconfig"}, (reply) => { Helpers.Prefs.refresh(); Notify.info(reply); }); } }, refresh: function() { - xhr.post("backend.php", { op: "pref-prefs" }, (reply) => { + xhr.post("backend.php", { op: "Pref_Prefs" }, (reply) => { dijit.byId('prefsTab').attr('content', reply); Notify.close(); }); @@ -360,7 +360,7 @@ const Helpers = { this.render_contents(); }, reload: function() { - xhr.json("backend.php", {op: "pref-prefs", method: "getPluginsList"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "getPluginsList"}, (reply) => { this._list_of_plugins = reply; this.render_contents(); }, (e) => { @@ -444,7 +444,7 @@ const Helpers = { if (confirm(__("Clear stored data for %s?").replace("%s", name))) { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-prefs", method: "clearPluginData", name: name}, () => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "clearPluginData", name: name}, () => { Helpers.Prefs.refresh(); }); } @@ -455,7 +455,7 @@ const Helpers = { if (confirm(msg)) { Notify.progress("Loading, please wait..."); - xhr.json("backend.php", {op: "pref-prefs", method: "uninstallPlugin", plugin: plugin}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "uninstallPlugin", plugin: plugin}, (reply) => { if (reply && reply.status == 1) Helpers.Plugins.reload(); else { @@ -504,7 +504,7 @@ const Helpers = { const container = install_dialog.domNode.querySelector(".contents"); - xhr.json("backend.php", {op: "pref-prefs", method: "installPlugin", plugin: plugin}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "installPlugin", plugin: plugin}, (reply) => { if (!reply) { container.innerHTML = `
  • ${__("Operation failed: check event log.")}
  • `; } else { @@ -603,7 +603,7 @@ const Helpers = { const container = dialog.domNode.querySelector(".contents"); container.innerHTML = `
  • ${__("Looking for plugins...")}
  • `; - xhr.json("backend.php", {op: "pref-prefs", method: "getAvailablePlugins"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "getAvailablePlugins"}, (reply) => { dialog.entries = reply; dialog.render_contents(); }); @@ -656,7 +656,7 @@ const Helpers = { container.innerHTML = `
  • ${__("Updating, please wait...")}
  • `; let enable_update_btn = false; - xhr.json("backend.php", {op: "pref-prefs", method: "updateLocalPlugins", plugins: dialog.plugins_to_update.join(",")}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "updateLocalPlugins", plugins: dialog.plugins_to_update.join(",")}, (reply) => { if (!reply) { container.innerHTML = `
  • ${__("Operation failed: check event log.")}
  • `; @@ -717,7 +717,7 @@ const Helpers = { //container.innerHTML = `
  • ${__("Checking: %s...").replace("%s", name)}
  • `; - xhr.json("backend.php", {op: "pref-prefs", method: "checkForPluginUpdates", name: name}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "checkForPluginUpdates", name: name}, (reply) => { if (!reply) { container.innerHTML += `
  • ${__("%s: Operation failed: check event log.").replace("%s", name)}
  • `; @@ -834,7 +834,7 @@ const Helpers = { }, export: function() { console.log("export"); - window.open("backend.php?op=opml&method=export&" + dojo.formToQuery("opmlExportForm")); + window.open("backend.php?op=OPML&method=export&" + dojo.formToQuery("opmlExportForm")); }, } }; diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 39e3f8315..582e5a9b9 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -55,13 +55,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f return rv; }, reload: function() { - xhr.post("backend.php", { op: "pref-labels" }, (reply) => { + xhr.post("backend.php", { op: "Pref_Labels" }, (reply) => { dijit.byId('labelsTab').attr('content', reply); Notify.close(); }); }, editLabel: function(id) { - xhr.json("backend.php", {op: "pref-labels", method: "edit", id: id}, (reply) => { + xhr.json("backend.php", {op: "Pref_Labels", method: "edit", id: id}, (reply) => { const fg_color = reply['fg_color']; const bg_color = reply['bg_color'] ? reply['bg_color'] : '#fff7d5'; @@ -91,7 +91,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f } const query = { - op: "pref-labels", method: "colorset", kind: kind, + op: "Pref_Labels", method: "colorset", kind: kind, ids: id, fg: fg, bg: bg, color: color }; @@ -131,7 +131,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f ${App.FormFields.hidden_tag('id', id)} - ${App.FormFields.hidden_tag('op', 'pref-labels')} + ${App.FormFields.hidden_tag('op', 'Pref_Labels')} ${App.FormFields.hidden_tag('method', 'save')} ${App.FormFields.hidden_tag('fg_color', fg_color, {}, 'labelEdit_fgColor')} @@ -189,7 +189,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f if (confirm(__("Reset selected labels to default colors?"))) { const query = { - op: "pref-labels", method: "colorreset", + op: "Pref_Labels", method: "colorreset", ids: labels.toString() }; @@ -210,7 +210,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f Notify.progress("Removing selected labels..."); const query = { - op: "pref-labels", method: "remove", + op: "Pref_Labels", method: "remove", ids: sel_rows.toString() }; diff --git a/js/PrefUsers.js b/js/PrefUsers.js index a6081f35f..e8f4a7489 100644 --- a/js/PrefUsers.js +++ b/js/PrefUsers.js @@ -8,7 +8,7 @@ const Users = { const user_search = App.byId("user_search"); const search = user_search ? user_search.value : ""; - xhr.post("backend.php", { op: "pref-users", sort: sort, search: search }, (reply) => { + xhr.post("backend.php", { op: "Pref_Users", sort: sort, search: search }, (reply) => { dijit.byId('usersTab').attr('content', reply); Notify.close(); resolve(); @@ -21,7 +21,7 @@ const Users = { if (login) { Notify.progress("Adding user..."); - xhr.post("backend.php", {op: "pref-users", method: "add", login: login}, (reply) => { + xhr.post("backend.php", {op: "Pref_Users", method: "add", login: login}, (reply) => { Users.reload().then(() => { Notify.info(reply); }) @@ -30,7 +30,7 @@ const Users = { } }, edit: function(id) { - xhr.json('backend.php', {op: 'pref-users', method: 'edit', id: id}, (reply) => { + xhr.json('backend.php', {op: 'Pref_Users', method: 'edit', id: id}, (reply) => { const user = reply.user; const admin_disabled = (user.id == 1); @@ -53,7 +53,7 @@ const Users = { ${App.FormFields.hidden_tag('id', user.id.toString())} - ${App.FormFields.hidden_tag('op', 'pref-users')} + ${App.FormFields.hidden_tag('op', 'Pref_Users')} ${App.FormFields.hidden_tag('method', 'editSave')}
    @@ -104,7 +104,7 @@ const Users = {