picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.83k stars 614 forks source link

Error running Pico on Synology Diskstation #538

Closed bwbg closed 4 years ago

bwbg commented 4 years ago

Firing up Pico after a fresh installation on my Synology Diskstation (DS218+) [DS] with DSM and "Web Station" (nginx, latest PHP) resulted in the following error:

Fatal error: Uncaught RuntimeException: Unable to load plugin '@eaDir' from '@eaDir/@eaDir.php': File not found in /volume1/web/vendor/picocms/pico/lib/Pico.php:671 Stack trace: #0 /volume1/web/vendor/picocms/pico/lib/Pico.php(552): Pico->loadLocalPlugins(Array) #1 /volume1/web/vendor/picocms/pico/lib/Pico.php(424): Pico->loadPlugins() #2 /volume1/web/index.php(39): Pico->run() #3 {main} thrown in /volume1/web/vendor/picocms/pico/lib/Pico.php on line 671

It seems the DiskStation makes these ominous @eaDir-directories visible in all sub(directories) of its shares. To prevent searching these quirky directories i'd suggest a "canonical path"-filter for plugins:

https://github.com/bwbg/Pico/commit/14d11fe9baff6ea2176cd1df4363444621e59891

PhrozenByte commented 4 years ago

Unfortunately I'd rather classify this as "expected behaviour" right now :unamused:

Since Pico 2.0 we're very strict about loading plugins via filesystem - since we don't have a admin interface a user might not easily tell whether a plugin is loaded or not, and unexpectedly not loading a plugin might create security issues (just think of a user authentication plugin). Since this is no common problem I don't think it's justifiable to add a specific solution for Synology Diskstations to Pico's core.

However, I'm not very satisfied with Pico's plugin discovery in general - like not being able to move a plugin's class to a PHP namespace is bad. However, requiring composer (or any other plugin installation routine) is no solution either, since being able to run Pico basically everywhere (like Synology DiskStations :smile:) is one of Pico's main goals.

So this situation is kinda frustrating... It's neither a bug nor a situation where I'd say "everything's fine, nothing to do here", so I've added this to the backlog of Pico 3.0 (which is currently under development, see #317 and #535). I'll think about this. My current thinking utilizes iterators that could be overloaded, allowing you to easily add a exception for Synology Diskstation. You shouldn't be required to patch Pico's core... :disappointed:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: