This is a quick trick I learned from master baker gwoo. If by chance you have multiple projects, and those projects share multiple plugins. You are in a bit of a pickle. You either need to copy the plugins into each app and then update both when you make changes, or use something like svn:externals or git submodules. These all work quite well, however what if you don’t want to include debugKit or ApiGenerator in your repository? Well, there is another approach and it is the one that the venerable gwoo showed me.
First create a directory to hold all your plugins. Mine is
~/Sites/cake_plugins. Next put all your common plugins in there. So in mine I have only the best plugins like DebugKit and ApiGenerator. So my directory structure looks something like
And so on. Next in each app you want to use your plugins in add the following to
- $pluginPaths = array(
And there you have it, obviously unless you also have a
/Users/markstory/ you might want to change the path you use to one that actually exists. Cake should automatically find your plugins in their new home. I find this setup ideal for development, as I can keep all my repositories separate, and include my global plugins quite easily. Thanks gwoo :)