pernod-ricard-brandcos / wpml-installer
A modern maintained install helper for WPML
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: ^7.2
- composer-plugin-api: ^1.1
- ext-json: *
- vlucas/phpdotenv: ^3.0 || ^4.0 || ^5.0
Requires (Dev)
- composer/composer: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.2.0
- phpstan/phpstan: ^0.12.14
- phpunit/phpunit: ^8.0
- rregeer/phpunit-coverage-check: ^0.3.1
- squizlabs/php_codesniffer: ^3.4
- symfony/process: ^5.1
This package is auto-updated.
Last update: 2023-10-24 18:47:51 UTC
README
A composer plugin that makes installing WPML with composer easier.
It reads your WPML subscription info from the environment or a .env file.
Usage
1. Add our WPML Composer Bridge repository to
the [repositories
][composer-repositories] field in composer.json
This repository simply provides a periodically updated packages.json, that redirects composer to the WPML provided downloads. Note that this repository does not provide any WPML packages itself, it only tells Composer where it can find WPML packages. Secondly it is important to note that your subscription info is not submitted to the repository, since the installer downloads the WPML zip files directly from WPML's servers.
Why this repository?
Since it enables you to use wpml/*
packages with version constraints like any normal Packagist package.
You no longer have to update the version manually as you have to do with ad-hoc composer packages.
{
"type": "composer",
"url": "https://pr-wpml-repository.s3-eu-west-1.amazonaws.com/composer/v1/wordpress-plugin/"
}
This installs the package as wordpress-plugin
type, in case you want a different type, use the following URL:
wordpress-muplugin:
https://pr-wpml-repository.s3-eu-west-1.amazonaws.com/composer/v1/wordpress-muplugin/
wpackagist-plugin:
https://pr-wpml-repository.s3-eu-west-1.amazonaws.com/composer/v1/wpackagist-plugin/
library:
https://pr-wpml-repository.s3-eu-west-1.amazonaws.com/composer/v1/library/
2. Make your subscription info available
There are 3 ways to make the WPML_SUBSCRIPTION_KEY and WPML_USER_ID available:
- Using the WPML_SUBSCRIPTION_KEY and WPML_USER_ID environment variable
.env
file- Setting
wpml-subscription-key
andwpml-user-id
in$COMPOSER_HOME/config.json
Select the one that best matches your setup:
2.a Using the environment variables
Set the environment variable WPML_SUBSCRIPTION_KEY and WPML_USER_ID
to your WPML subsription key and user id.
2.b Use a .env file
Alternatively you can add an entry to your .env
file:
# .env (same directory as composer.json)
WPML_SUBSCRIPTION_KEY=Your-Key-Here
WPML_USER_ID=Your-user-id
2.c. Setting the key in $COMPOSER_HOME/config.json
You specify the wpml-subscription-key
in the config
section of your $COMPOSER_HOME/config.json
{
"config": {
"wpml-subscription-key": "Your-key-here",
"wpml-user-id": "Your-user-id-here"
}
}
$COMPOSER_HOME
is a hidden, global (per-user on the machine) directory that is shared between all projects. By default it points toC:\Users\<user>\AppData\Roaming\Composer
on Windows and/Users/\<user\>/.composer
on macOS. On nix systems that follow the XDG Base Directory Specifications, it points to$XDG_CONFIG_HOME/composer
. On other nix systems, it points to/home/\<user\>/.composer
.
3. Require a WPML plugin
composer require wpml/sitepress-multilingual-cms