notplants Posted August 30 Share Posted August 30 (edited) I'm working on finishing AltTextGpt in order to publish it, but I need to figure out how to properly include its dependency on Guzzle. I'm working on figuring out how to officially publish the module, and how to specify that it requires GuzzleHttpClient. Edited August 30 by notplants Link to comment Share on other sites More sharing options...
bernhard Posted August 30 Share Posted August 30 Hi @notplants welcome to the forum and thx for your contribution! There is no standard way of adding requirements. ProcessWire does not use composer or such. It is just a platform to run modules. How you add your dependencies basically is up to you. One option is to include it into your module. So you'd do composer require ... on your dev environment and then you add require vendor autoload to your module and that's it. That means it is super easy to install for anybody else, but that also means that if you (or anybody else) had multiple modules that require guzzle in the best case it would just be some overhead (as every module might ship a separate version of guzzle) and in the worst case you'd get conflicts. Another option would be to create another module solely for adding guzzle to PW. That way several other modules could use the guzzle module and you'd have less overhead, but more to do during installation or maybe also more troubles as you need to keep versions compatible... The third and in this case IMHO best option is to use WireHttp instead of guzzle unless you really need guzzle for the http requests?! WireHttp is part of the core so you get the best of option 1 and option 2. 2 Link to comment Share on other sites More sharing options...
elabx Posted August 30 Share Posted August 30 Link to comment Share on other sites More sharing options...
notplants Posted August 31 Author Share Posted August 31 (edited) @bernhard thanks for the welcome and the comprehensive list of options! makes sense -- and I was not aware of WireHTTP before. I was able to change the module to use WireHTTP instead of Guzzle quite easily, so now no external dependency is needed. The changes have already been pushed to the github repo. Edited August 31 by notplants 4 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now