Is there a way to micro-manage/edit dependencies at installation? #9814
Replies: 1 comment 4 replies
-
I can point you to https://roots.io/docs/bedrock/master/composer/#plugins as I know they have a good WP/Composer integration. The rest of what you are asking.. running composer programmatically should definitely be doable (you can include the phar files and run it like https://github.com/composer/composer/blob/master/bin/composer#L63 does from CLI, except passing a StringInput for example). Modifying what gets updated not so much, you should rather run a composer update with the list of packages you want to update, then you can skip the others which are not listed, but if the plugins have new dependencies in a new version then you need to also update the plugin's version otherwise this won't work. Overall this sounds like a mess frankly to have a mix of WP updates and composer ones. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've tried to find the answer to this in various searches, I've read the docs throughly, and I've gone over various StackExchange threads - but could not find anything that was cogent (to me, anyway). So I hope this is the correct place to post this question.
When running composer update or install, is there a way to programatically edit the install/update list in PHP, after Composer has resolved all the dependencies but before installation/update/write-to-disk?
To be more specific about my use-case.
I manage a few WordPress installations that I write custom plugins for. These custom WordPress plugins auto-update from GitHub repositories. The plugins (some of them) have regularly changing/updating composer dependencies.
The dependencies are all kept/managed in a single vendor dir used by the WordPress installation (which also has a composer.json file)
I'm looking for a way to
a. run Composer automatically/programatically on plugin update/auto-update. Preferrably from a PHP process and not through shell.
b. Have Composer update all of a plugin's dependencies but not the plugin itself. ie. I'd like to access the solved dependency list right before install and tweak it to remove any plugin managed by WordPress core - but still install all of its composer dependency libraries.
Beta Was this translation helpful? Give feedback.
All reactions