Open trolologuy opened 4 years ago
Okey finally after coming across this issue, I noticed that indeed the install order in composer was different between the tests when the composer.lock
was present or not.
What ultimately fixed it was to change the composer.json
files in my templates and plugins to add the johnpbloch/wordpress-core
package as required, to force installation AFTER wordpress is installed.
{
"name": "me/my_custom_plugin",
"description": "Custom Plugin",
"version": "1.0",
"type": "wordpress-plugin",
"require": {
"composer/installers": "~1.0",
"johnpbloch/wordpress-core": "5.4.2"
}
}
Hi @trolologuy,
Thanks for stopping by! I'm glad to hear that you've got it working for now. I personally would be worried about what happens when core updates, though. As I explained in the thread you found in the wordpress-core repository, these packages are not meant to support the standard WordPress installation of keeping wp-content inside ABSPATH.
The only way I know of to reliably use these packages in a standard WP installation setup is to base the install off of johnpbloch/wordpress-core at the beginning using composer create-project
and then using wp-cli instead of composer to keep WordPress core updated.
@trolologuy you might be interested in looking at https://github.com/wecodemore/wpstarter
And as always, keep it trololol.
Hello,
I'm encountering different behaviors with
composer install
andcomposer update
regarding wordpress themes and plugins. I want to import custom themes and plugins into wordpress, so I added them through the composer path directive.I'm not fully sure if this is a composer issue, an issue with your great project, or just me not doing things properly.
Here's the folder structure:
Both my custom theme and plugin use a
composer.json
that has the following structure:However the files are only copied into
wordpress/wp-content/themes
(or/plugins
) when I runcomposer update
orcomposer install
with nocomposer.lock
file present. This behavior can be reproduced locally.Here's what I noticed:
composer.lock
file +wordpress
folder +vendor
folder and runcomposer install
, it works as expected, my plugin and theme are installed.composer.lock
file that I’ve got in step 1., deletewordpress
folder andvendor
folder and runcomposer install
again, my plugins and themes are NOT installed (despite the logs saying otherwise). If I do a diff of thecomposer.lock
files of the lock files generated in step 1 and in step 2 there is absolutely no difference between them (besides the hash).What brings me to the conclusion that somehow the
**commands seem to be ignored.
Is this a known issue? Or expected behavior?**
Here's my main
composer.json
fileHere's an example (with a present lock file):
But when I check if the theme is present: