Aitoc Extensions Installation

Manual extensions installation

  1. Download the extension's package from the customer account and unzip it.

  2. Go to the app/code/Aitoc directory, and you will see directory named like Aitoc_ModuleName. This is the technical name of the module. Remember it, we will need it later.

  3. Upload all the directories and files to the Magento root directory.

  4. Connect via SSH and from Magento root directory perform the following command:

#!/bin/sh

php bin/magento module:enable Aitoc_ModuleName

  1. And at last perform a few final steps: upgrade database, deploy static content and clear cache:
#!/bin/bash

php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento setup:static-content:deploy

Composer installation

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

OR

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

NOTE

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:

Composer installation via bash script

Extensions installation via composer

  1. Open the terminal and establish an SSH connection to your server:
ssh user@magentohost.tld
  1. Choose the installation directory (default is Magento root):
user@magentohost.tld:~$ cd /path/to/magento/sources/
  1. Connect to the Aitoc Composer Repository:
composer config repositories.aitoc composer <path>

For your option will depend on the extension version (community or enterprise):

Community

https://composer.aitoc.com/community/

Enterprise

https://composer.aitoc.com/enterprise/

  1. Log in to your account.

Go to Access Keys:

Aitoc Composer 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.

NOTE

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.

  1. 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:

Install via composer button

Short composer tips

Extension update

The update process is similar to installation.

  1. 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.

  1. 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.

  1. To update all modules, please run the following command:
composer update

Note that this might update not only Aitoc extensions but other extensions as well if you have them installed and their Keys saved.

Extension removal

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>