GitXplorerGitXplorer
s

composer-envato

public
34 stars
4 forks
1 issues

Commits

List of commits on branch master.
Unverified
1434bed56e02631de38e9e34c65ca0e1a1510b68

Fix exports

sszepeviktor committed 2 years ago
Unverified
25267b2486cce0fe9925565e02e003daae1511bb

Remove a TODO

sszepeviktor committed 2 years ago
Unverified
453e0100a1b4d0276b7153081b55c76ba5654c3e

Merge branch 'master' of github.com:szepeviktor/composer-envato

sszepeviktor committed 2 years ago
Verified
abea32ddb712f2bc8d3c5922d3504563aec9f50b

Add LICENSE

sszepeviktor committed 2 years ago
Unverified
d3d1448e518e6be0a0b565afaff6d0a6524263fe

Add export-ignore and other improvements

sszepeviktor committed 2 years ago
Verified
43e810744c57e1070fd558c105ffd68b7674075d

Fix config validation for subscribed event (#17)

mmcaskill committed 2 years ago

README

The README file for this repository.

Composer plugin for Envato

Packagist Packagist stats PHPStan

A Composer plugin to load WordPress themes and plugins from Envato.

💡 Always the latest version is installed, as Envato does not make other versions available. Package version locking can only be achieved by local persistent cache, not across hosts or users.

Installation

This Composer plugin adds a virtual package repository.

It is recommended to install it globally:

composer global require --update-no-dev szepeviktor/composer-envato

It can also be installed per-project:

composer require --update-no-dev szepeviktor/composer-envato

Configuration

Add all your Envato products as "packages" in either the local composer.json file or the global config.json file (located in $COMPOSER_HOME).

You can find the item-id at the end of product URL-s. e.g. https://themeforest.net/item/avada-responsive-multipurpose-theme/2833226

{
    "config": {
        "envato": {
            "token": "YOUR ENVATO PERSONAL TOKEN FROM https://build.envato.com/create-token",
            "packages": {
                "envato/avada-theme": {
                    "item-id": 2833226,
                    "type": "wordpress-theme"
                },
                "envato/layerslider-plugin": {
                    "item-id": 1362246,
                    "type": "wordpress-plugin"
                }
            }
        }
    }
}

💡 Please use the vendor name envato for consistency.

The personal token can also be read from an environment variable or a .env file. Create a .env file, where the composer.json file lives, and add the following:

ENVATO_TOKEN="<YOUR ENVATO PERSONAL TOKEN FROM https://build.envato.com/create-token>"

Usage

Once the plugin is installed and configured, you can simply install any of the listed products as Composer packages.

💡 Envato API has dynamic rate limiting

Behind the scenes

  1. This package is a Composer plugin
  2. In the activate method it creates an ArrayRepository with package data from config.json
  3. Package version is queried from Envato API
  4. When installing a package its URL is also queried from Envato API
  • Pretty package version is e.g. v1.2
  • Normalized package version is e.g. 1.2.0.0