acf-pro-installer icon indicating copy to clipboard operation
acf-pro-installer copied to clipboard

Installing using `composer install`

Open davemcnally opened this issue 5 years ago • 1 comments

Not sure if I'm missing something but I cannot get ACF to install to wp-content/plugins/ directory just using composer install (after making sure I have it set to require) yet manually requiring it as per step 3, works fine. Here's an edited example of my composer.json for the relevant parts:

{
  "repositories": [
      {
          "type": "composer",
          "url": "https://wpackagist.org"
      },
      {
        "type": "package",
        "package": {
          "name": "advanced-custom-fields/advanced-custom-fields-pro",
          "version": "5.7.13",
          "type": "wordpress-plugin",
          "dist": {
            "type": "zip",
            "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download"
          },
          "require": {
            "philippbaschke/acf-pro-installer": "^1.0",
            "composer/installers": "^1.0"
          }
        }
      }
  ],
  "config": {
      "vendor-dir": "vendor",
      "secure-http": false
  },
  "require": {
      "johnpbloch/wordpress": ">=5.0",
      "advanced-custom-fields/advanced-custom-fields-pro": "*"
  },
  "extra": {
      "installer-paths": {
          "build/wp-content/plugins/{$name}/": [
              "advanced-custom-fields/advanced-custom-fields-pro",
              "type:wordpress-plugin"
          ],
          "build/wp-content/themes/{$name}/": [
              "type:wordpress-theme"
          ]
      },
      "wordpress-install-dir": "build"
  }
}

Should running composer install not be installing ACF into the plugins directory like this? I'd rather not have to run composer install followed by composer require advanced-custom-fields/advanced-custom-fields-pro:*

davemcnally avatar Mar 06 '19 12:03 davemcnally

Strangely, if I run composer install twice, the second command installs ACF into expected directory but still not sure why it needs running twice 🤔

davemcnally avatar Mar 06 '19 13:03 davemcnally