Installation / Update via Composer
Composer is a dependency management tool for PHP projects. It allows you to declare the libraries your project requires and installs/updates them for you.
View the following links to learn how to install Composer:
How to install composer on Linux/MacOS
How to install composer on Windows
Simply use this bash script for installation:
#!/bin/sh EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] then >&2 echo 'ERROR: Invalid installer signature' rm composer-setup.php exit 1 fi php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer RESULT=$? rm composer-setup.php exit $RESULT
You need to put this script to composerinstall.sh file on the magento host, add permissions for execution and then start script.
Installation process might look like this:
Aitoc Extensions installation via composer
- Open the terminal and establish an SSH connection to your server:
- Choose the installation directory (default is Magento root):
firstname.lastname@example.org:~$ cd /path/to/magento/sources/
- Connect to the Aitoc Composer Repository:
composer config repositories.aitoc composer <path>
Go to Access Keys:
Click on "Create a New Access Key" button to generate your new extension keys. Choose any name that will help you distinguish this extension from any other. Public Key will serve as your login while Private Key is your password during the extension installation via composer.
You can save your Public and Private Keys in the repository for further use so you won't need to enter them again.
Go to your Magento docroot directory and add this code:
composer config --auth http-basic.composer.aitoc.com $COMPOSER_AITOC_USERNAME $COMPOSER_AITOC_PASSWORD
where $COMPOSER_AITOC_USERNAME is your Public Key and $COMPOSER_AITOC_PASSWORD is your Private Key.
- Open your terminal and run the code:
composer require aitoc/advanced-permissions php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy
where "aitoc/advanced-permissions" is the extension composer name which you can find on page Downloads:
The update process is similar to installation.
- Open your terminal and run the following command (use extension composer name for <composer_name>):
composer update <composer_name>
Note that this command updates extensions within one build only. It will update 1.x.x. to 1.y.y but it will not update 1.x.x. to 2.y.y since such major updates usually involve a newer build altogether.
- To update your extension from 1.x.x. to 2.y.y please use the following command ("x" is the build version, "2" in our case):
composer require <composer_name> ^x.0.0 --update-with-dependencies
For extension version 3.x.x the "x" would be "3", etc.
- To update all modules, please run the following command:
Note that this might update not only Aitoc extensions but other extensions as well if you have them installed and their Keys saved.
To remove an extension from your server, open the terminal and run the following command (use extension composer name for <composer_name>):
composer remove <composer_name>