PhilippBaschke / acf-pro-installer

A composer install helper for Advanced Custom Fields PRO
MIT License
282 stars 70 forks source link

installation conflict with "vlucas/phpdotenv":"^3.0.0" #38

Open boodcode opened 5 years ago

boodcode commented 5 years ago

if you have "vlucas/phpdotenv":"^3.0.0", there is conflict Problem : philippbaschke/acf-pro-installer v1.0.2 requires vlucas/phpdotenv ^2.2 -> satisfiable by vlucas/phpdotenv[2.2.x-dev, 2.3.x-dev, 2.4.x-dev, 2.5.x-dev, 2.6.x-dev, v2.2.0, v2.2.1, v2.3.0, v2.4.0, v2.5.0, v2.5.1, v2.5.2, v2.6.0, v2.6.1] but these conflict with your requirements or minimum-stability. How to avoid that ?

schliflo commented 5 years ago

There is a PR to fix this exact issue: https://github.com/PhilippBaschke/acf-pro-installer/pull/35 @PhilippBaschke just needs to merge it...

ffraenz commented 5 years ago

This package seems to be abandoned since the last code change occurred mid 2017.

I maintain an alternative package ffraenz/private-composer-installer that can be used to install arbitrary private packages including commercial WordPress plugins like ACF Pro and WPML. From version ^2.0.0 it can be used in conjunction with vlucas/phpdotenv ^3.0.0 (https://github.com/ffraenz/private-composer-installer/issues/4).

siriusnottin commented 5 years ago

I found your repo yesterday @ffraenz! Thanks to you you saved my life x)

Qrious commented 5 years ago

For anyone interested, we've decided to open source our solution:

Tl;dr;

I'm interested in hearing your opinion, or any concerns you have with our approach (see below).

Solution explanation

Unfortunately, due to a composer issue (see https://github.com/composer/composer/pull/3082), we could not solve this entirely in a composer plugin. As a workaround we created an open-source composer repository that fetches all available package versions from ACF periodically. As with this installer, you still need to provide your own ACF_PRO_KEY, because we do only provide an index that tells composer where it can download the zips. I'd like to stress that your ACF license key is never submitted to the composer repository (we already have a developer license :-) ).

The flow when you require advanced-custom-fields/advanced-custom-fields-pro after adding our repository:

  1. Composer connects to the repository and fetches the index with all available packages.
  2. Composer determines which package to download based on your version constraints.
  3. Composer installs our installer as this is required for every advanced-custom-fields package provided.
  4. Our installer detects that you want to download an advanced-custom-fields package directly from ACF's servers, and appends the license key you've provided in the ACF_PRO_KEY environment variable to the URL.
  5. Enjoy!
imstanleyyeo commented 5 years ago

Thanks @ffraenz for this installer. Works on all my new install site.

Problem arise when I'm trying to upgrade ACP PRO moving from philippbaschke/acf-pro-installer to yours. Did a composer update by changing the value of "vlucas/phpdotenv": "^2.0.1", to "vlucas/phpdotenv": "^3.0.0", and got a white screen of death.

"require": { "php": ">=5.6", "composer/installers": "^1.4", "vlucas/phpdotenv": "^3.0.0", "johnpbloch/wordpress": "4.9.8", "oscarotero/env": "^1.1.0", "roots/wp-password-bcrypt": "1.0.0", "advanced-custom-fields/advanced-custom-fields-pro": "*" }

Any idea why is it so? Thanks

ffraenz commented 5 years ago

@imstanleyyeo Please open a new issue over at https://github.com/ffraenz/private-composer-installer/issues to discuss your problem as it is not related to this repository. Thank you!

imstanleyyeo commented 5 years ago

Sorry. Opened a new issue.