Closed iWantToKeepAnon closed 4 years ago
Unfortunately I've not been able to use namespaces in FeedIron, I believe that would be the ideal way to address the issue. It's not a major issue per-say, it's just the auto-loader going through the registered sequence. It wouldn't show normally in TTRSS as it's only loaded during the article filter process, hence why it appears to interfere with your plugin.
I've added some fixes in defaults-dev that should address this issue
Perfect, thanks for a quick turn around! : ))
Prerequisites
Expected Behavior
Non error/warning integration into tt-rss, playing friendly with other plugins.
Current Behavior
Feediron is placing a warning into tt-rss system log every time {myPlugin} (named redacted) uses "class_exists" due to (AFAICT) "spl_autoload_register".
Steps to Reproduce
I have a personal plugin that I have not yet released, it exectues:
if (class_exists($className)) {…}
and feediron enters a warning into the tt-rss system log:
You can see that execution jumps from {myPlugin} to feediron init.php(14). Can the "spl_autoload_register" function be limited to code in feediron's scope?
Failure Information (for bugs)
Not sure this is a full blown bug, but definitely a feature. I am kind of surprised that the ttrss codebase doesn't trigger these warnings when it uses class_exists. I skipped autoloading code by changing my call to
class_exists($className, false)
and that fixes the warnings, but that shouldn't be necessary. Right?I am not a php expert, am I missing something obvious?
Context