expose icon indicating copy to clipboard operation
expose copied to clipboard

Correctly load plugins, even in sub-directories.

Open felabrecque opened this issue 9 months ago • 3 comments

Previously, any files in ~/.expose/plugins directory was loaded as a plugin.

Now, README.md files are excluded.

Also, the plugin can be in a sub-folder. This means we can do something like:

git clone custom-expose-plugin.git

in the plugins folder and it will work

felabrecque avatar Feb 25 '25 18:02 felabrecque

Anything missing for this PR to be merged ?

felabrecque avatar Mar 05 '25 12:03 felabrecque

While I like the idea - especially with cloning custom plugins with git, a few thoughts on this:

  1. The changes break backward compatibility for existing plugin setups. Specifically, custom plugins in ~/.expose/plugins are no longer detected, e.g. created by expose make:plugin.

  2. For a fundamental change to the plugin system, we need:

    • Unit tests to verify both new and existing functionality
    • Updated documentation explaining the new plugin requirements and structure
    • Preservation of backward compatibility for existing plugin setups

I can work on that next week. Once the code is completed. I will add the tests and documentation. Didn't want to spend time on that if the PR would have been rejected.

felabrecque avatar Apr 04 '25 15:04 felabrecque

@mechelon I don't see how plugins in the ~/.expose/plugins are no longer detected.

I didn't changed which folders are scanned. I only added some additional checkup:

  • must be a php file
  • php class must extend the plugin class Expose\Client\Logger\Plugins\BasePlugin

this shouldn't have any impact on existing plugins. And expose make:plugin should still work since it should create plugins correctly in the folder.

Can you explain to me what I did wrong so I can fix it ?

felabrecque avatar Apr 04 '25 15:04 felabrecque