openpgp-php/examples
Meitar M f8e0e997fc
Provide more guidance for understanding examples, update .travis.yml.
This commit adds an `example/README.md` file with a little bit of
guidance for running the examples themselves. This is helpful because
the examples all rely on the presence of a `phpseclib` installation
available to the PHP interpreter, and while there is a `composer.json`
file to this effect, none of the examples included the Composer
`autoload.php` file.

This commit makes no modifications to the example code itself, but does
`include_once()` the Composer autoload script so that `phpseclib` loads
and avoids causing a fatal error when a new user attempts to run the
examples to learn how to use the library.

This commit also updates the Travis `before_script` build script, dropping
the `--dev` argument to the `composer install` command. Current versions
of Composer emit a deprecation notice when `--dev` is passed.
2018-12-20 13:42:15 -07:00
..
clearsign.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
deASCIIdeCrypt.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
encryptDecrypt.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
keygen.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
README.md Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
sign.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00
verify.php Provide more guidance for understanding examples, update .travis.yml. 2018-12-20 13:42:15 -07:00

OpenPGP.php Examples

The scripts in this folder show how to use this library to perform various tasks such as generating a new key, signing a message, and verifying a message that has been signed.

To use these examples, make sure phpseclib is available. You can install it using Composer:

git clone https://github.com/singpolyma/openpgp-php.git # Clone the repository.
cd openpgp-php
composer install # Use Composer to install the requirements.

Once Composer has installed the requirements, run the examples using PHP:

# Generate a new OpenPGP key; see the `keygen.php` file for parameters.
php ./examples/keygen.php > mykey.gpg