wordpress-core-installer icon indicating copy to clipboard operation
wordpress-core-installer copied to clipboard

folder issue if wp-content created by wpackagist in the same time

Open florent-cdl opened this issue 3 years ago • 4 comments

Hi, My composer.json have "johnpbloch/wordpress-core-installer": "^2.0" but also a yoast "yoast/wordpress-seo": "^12.5" installer

So as installation of wordpress take time, yoast create a wp-content folder before wordpress-core-installer finished. So a wp-content folder already exists whan the wordpress install wants to create one. I think johnpbloch install don't make the right choice when a folder already exists because it ended with wp-content/wp-content/theme If I remove the plugins, installatyion is correct and I get wp-content/theme Thank you Florent

florent-cdl avatar Sep 02 '21 09:09 florent-cdl

Are you trying to create a WP install with a nested WP Content folder? You can’t do that with composer.

Instead use a subfolder install where the WP-content folder sits alongside the wordpress folder, not inside it.

tomjn avatar Sep 02 '21 10:09 tomjn

Hi Tom Strange because if I don't include the plugins in composer.json the wp-content is created inside my wordpress folder

florent-cdl avatar Sep 02 '21 11:09 florent-cdl

It’s not strange at all. Composer does not support nested package folders, and it installs and updates packages by deleting their folders and putting a newer version in their place.

As the WP zip contains a WP-content folder this is why you get one. The behaviour you’re seeing is not defective behaviour of this plugin, it’s standard behaviour of composer and most other package managers.

What you want is simply not possible. You should abandon the effort and switch to a subfolder WP install instead, the same way you might if you were to install WP via a git submodule

On Thu, 2 Sep 2021 at 12:23, florent-cdl @.***> wrote:

Hi Tom Strange because if I don't include the plugins in composer.json the wp-content is created inside my wordpress folder

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/johnpbloch/wordpress-core-installer/issues/31#issuecomment-911558801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ5DBWH7EVBNQBU5G6LT75NDFANCNFSM5DITS7BA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tomjn avatar Sep 02 '21 11:09 tomjn

An alternative to switching your folder layout is to stop using composer to manage your WordPress version. WP-CLI is fairly robust and can be used to enforce the WordPress version, and that can even be done using a composer script that runs on install/update.

johnpbloch avatar Sep 02 '21 15:09 johnpbloch