Installation

This pages contains instructions on how to install this module on your machine. There are several ways to achieve that. Each method is described below.

Avertissement

You cannot mix the different methods. Especially, you must use the same method to install this module as the one you selected for Erebot itself.

Note

We recommend that you install this module using either its PHAR package or through composer. Installation from sources is reserved for advanced installations (eg. Erebot developers).

Installation using PHAR packages

Installing Module_PingReply from a PHAR package is very easy. However, please note that Erebot must have been installed as a PHAR package for this method to work properly.

Preparations

If you haven’t done so already, create a directory in Erebot’s folder named modules.

Hence, your tree should look like this:

  • Erebot/
    • Erebot-X.Y.Z.phar
    • modules/

Also, make sure your installation fulfills all of the prerequisites for this module.

Downloading the package

First, select the version you want to install. Available versions are listed on Erebot’s package repository.

The PHAR package for a certain version can be downloaded by using a URL such as https://packages.erebot.net/get/Module_PingReply-version.phar (replace version with the actual version you selected).

As a special shortcut, the following link always points to the latest snapshot of Module_PingReply: https://packages.erebot.net/get/Module_PingReply-dev-master.phar.

Avertissement

Using the latest snapshot available means that you may benefit from very recent developments, but it also means that the code may be in an unstable state. Use at your own risk.

The PHAR package must be downloaded to your installation’s modules/ directory.

Downloading the package’s signature

All the packages delivered by Erebot’s developers are cryptographically signed using the “OpenSSL” algorithm in PHP’s Phar extension. This signature is used to detect corrupted packages and packages that have been tampered with.

You must retrieve the signature corresponding to the version of the PHAR package you downloaded and put it alongside the package. The signature can be downloaded by appending .pubkey at the end of the link to the package itself. Therefore, the signature for the latest version can be downloaded from https://packages.erebot.net/get/Module_PingReply-dev-master.phar.pubkey.

Note

PHP automatically checks the integrity of signed PHAR packages when they are loaded. Neither the name of the PHAR package nor the name of the signature file should be altered, as the integrity check would then fail.

Avertissement

Although PHP automatically checks the integrity of cryptographically signed phar archives when they are loaded using the signature file, you may also check an archive manually by using the phar command provided with the phar extension.

For example, the following session shows a passing result.

$ phar info -f Module_PingReply-dev-master.phar
# Alias:              Module_PingReply
# Hash-type:          OpenSSL
# ... (other fields removed for clarity) ...

Note how the “Hash-type” field indicates that the “OpenSSL” algorithm has been used to sign the archive. Any other value should be considered as if the check had failed, unless the package was downloaded from Erebot’s website over a secure (SSL/TLS) connection.

On the other hand, the following example shows a session where the verification failed.

$ phar info -f Module_PingReply-dev-master.phar
# Exception while opening phar 'Module_PingReply-dev-master.phar':
# phar "Module_PingReply-dev-master.phar" openssl signature could not be verified: openssl public key could not be read

Conclusion

Once the PHAR package and its signature have been downloaded, your installation should look somewhat like that:

Erebot/
    Erebot-X.Y.Z.phar
    modules/
        Module_PingReply-latest-0.2.0-32-gf2fc19e.phar
        Module_PingReply-latest-0.2.0-32-gf2fc19e.phar.pubkey

That’s all folks! You may now add configuration options for this module in Erebot’s configuration file.

Installation through Composer

Installation through Composer is very easy. However, please note that Erebot itself must have been installed using Composer for this method to work properly.

To install the new module:

  • Go to the directory where you installed Erebot.

  • Add this module to your installation’s dependencies with:

    $ # Replace latest with whatever version you want to install.
    $ php composer.phar install erebot/module_pingreply=latest
    
  • You may now add configuration options for this module in Erebot’s configuration file.

Installation from source

Please note that Erebot itself must have been installed from source for this method to work.

Avertissement

This method exists only for the sake of running Erebot on the now deprecated PHP 5.2.x. Also, please note that depending on your environment, other actions than the ones described here may be required to make this module work properly.

First, make sure the git client is installed on your machine.

Under Linux, from a root shell, run the command that most closely matches the tools provided for your distribution:

# For apt-based distributions such as Debian or Ubuntu
$ apt-get install git

# For yum-based distributions such as Fedora, RHEL (RedHat) or CentOS
$ yum install git

# For urpmi-based distributions such as SLES (SuSE) or MES (Mandriva)
$ urpmi git

Note

Windows users may be interested in installing Git for Windows to get an equivalent git client. Also, make sure that the path to git.exe is present on your account’s PATH. Otherwise, you’ll have to replace git by the full path to git.exe on every invocation. Eg. :

"C:\Program Files\Git\bin\git.exe" clone ...

Now, clone the module’s repository:

$ cd /path/to/Erebot/vendor/
$ mkdir -p erebot
$ git clone git://github.com/Erebot/Module_PingReply.git erebot/module_pingreply

Last but not least, install the rest of this module’s prerequisites and then run:

$ cd /path/to/Erebot/vendor/erebot/module_pingreply
$ /path/to/phing

You may now add configuration options for this module in Erebot’s configuration file.