junaidbhura / composer-wp-pro-plugins

Composer installer for Pro WordPress plugins.
https://packagist.org/packages/junaidbhura/composer-wp-pro-plugins
MIT License
92 stars 28 forks source link

Support "auth.json" file, add EDD helper, and introduce SearchWP support #9

Closed chrisvanpatten closed 5 years ago

chrisvanpatten commented 5 years ago

This PR accomplishes a few things:

  1. It fixes #8 by adding support for Composer's native auth.json (with a fallback to .env to preserve backward compatibility) through a getConfigValue helper in a new Plugin base class. The auth.json file (which can be located in a project's root directory, globally in your COMPOSER_HOME directory, or passed as a COMPOSER_AUTH env variable) should be formatted as such:
    {
    "composer-wp-pro-plugins": {
    "polylang-pro-key": "abcdefg1234567",
    "polylang-pro-url": "myauthorisedsite.com"
    },
    "additional-auth-mechanisms": {
    ...
    }
    }
  2. Introduces a helper to facilitate easier downloads from Easy Digital Downloads-based sites and refactors existing EDD-based plugins to use this helper.
  3. Adds a PluginInterface class to enforce the getDownloadUrl function on all plugin implementations.
  4. Adds support for SearchWP, via the EDD helper.
junaidbhura commented 5 years ago

Thanks for your pull request @chrisvanpatten . I really appreciate it!

Could you please clarify the following:

  1. How does $this->getConfigValue support environment variables?
  2. How would this fit into the Roots architecture https://github.com/roots/bedrock?
junaidbhura commented 5 years ago

Closing this based on #8