Where do I run composer require
commands?
#42
-
It wasn't initially obvious that I needed to run And now that I'm through that hurdle, I still cannot figure out where to run the individual loaders like To increase the adoption rate of underpin, it would seem that providing a clear walkthrough of each use case would help. In this walkthrough it would be good to see what the suggested file structure should be. Thanks so much. I'm looking for a rapid development framework to make Wordpress a bit more bearable. I'm hoping that this is it, but struggling to reverse engineer the assumptions made. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey! Thanks for writing in! You're right - Underpin would benefit from having some example plugins. I'm actually working on a series of plugins for WP Dev Academy now that will provide some open-source examples, but really Underpin itself should have a basic example. For now, the only example I have is the example used to set up BerlinDB and some custom tables here: https://github.com/Underpin-WP/berlindb-example That should help you a-lot. 100% not required, but I also built a course that walks through building a plugin using underpin here. Finally, if you haven't already, check out the plugin boilerplate. You could potentially fork it and make your own version that embeds Underpin inside your plugin. By design, Underpin can be used as a package inside a WordPress plugin, or as a mu-plugin. The default behavior is to make it a mu-plugin because this framework is often used on custom WordPress websites, and multiple plugins and themes will want to utilize Underpin directly.
Yep, that's because it's set up as a mu-plugin. You can override where this is installed from though. If you want it to work directly inside of a WordPress plugin you need to add this to your "extra": {
"installer-paths": {
"vendor/{$vendor}/{$name}": [
"type:wordpress-muplugin"
]
}
}, This will tell composer to install any mu plugins as a regular ol' package inside the I think a good PR for this issue would be to update the |
Beta Was this translation helpful? Give feedback.
-
Another issue that has crossed my mind - all of the loaders and extensions for Underpin should probably be labeled as a |
Beta Was this translation helpful? Give feedback.
-
@jonathonbyrdziak I created a new boilerplate to make setting up Undeprin as a mu-plugin easier. Check this out This should give you the guidance needed to get moving. |
Beta Was this translation helpful? Give feedback.
Hey! Thanks for writing in! You're right - Underpin would benefit from having some example plugins. I'm actually working on a series of plugins for WP Dev Academy now that will provide some open-source examples, but really Underpin itself should have a basic example.
For now, the only example I have is the example used to set up BerlinDB and some custom tables here: https://github.com/Underpin-WP/berlindb-example
That should help you a-lot.
100% not required, but I also built a course that walks through building a plugin using underpin here.
Finally, if you haven't already, check out the plugin boilerplate. You could potentially fork it and make your own version that embeds Underpin insid…