Skip to content

Allow ability to load modules from another path more efficiently (in *addition* to /site/modules/) #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jlahijani opened this issue Dec 24, 2024 · 0 comments

Comments

@jlahijani
Copy link

I'd like to have modules in both of these places:

  • /site/modules/ (the default location)
  • /site/modules-2/ (an additional location, with a path I decide)

While this is technically possible already, it requires a $modules->refresh(); for it to stick which seems inefficient.

// /site/init.php
wire('modules')->addPath(__DIR__ . '/modules-2/');
wire('modules')->refresh();

Can a hook or some other approach be added so refreshing the modules is not required?

Original discussion here:
https://processwire.com/talk/topic/30822-how-do-i-load-modules-from-both-sitemodules-and-sitemodules-2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant