How to set the same plugin folder/copy to all applications


#1

Hi Guys!
I have some cake3 apps in our apache24/htdocs and I would like to have just one “myplugin” copy to all apps.
Is it possible? How to do that?

edit: It is a custom plugin.

Thanks in advance,
Celso


#2

Yes you can!

Put the plugin(s) in a common folder and then add path to that common folder to “App.paths.plugins” config array in app.php of every app.


#3

Thanks @ADmad

My final code (using bootstrap):

Plugin::load('Pge', [
    'autoload' => true,
    'routes' => true,
    'path' => str_replace('/', '\\', $_SERVER['DOCUMENT_ROOT']) . DS . 'plugins' . DS . 'Pge' . DS
]);

I will try the same with ‘App’[‘paths’]