Download the PHP package ixnode/php-vault without Composer

On this page you can find all versions of the php package ixnode/php-vault. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-vault

PHPVault

CI workflow PHP PHPStan LICENSE

PHPVault is a PHP library that can create, read, encrypt and decrypt environment files (so-called dotenv files). For example is .env a plain file, .env.enc an encrypted file, etc. Within your project you can automatically load these encrypted environment variables from .env.enc into getenv(), $_ENV and $_SERVER. The corresponding key-value pairs within these dotenv files are encrypted and decrypted using an asymmetric encryption method (Public-key cryptography). Private keys are only available on productive systems for decrypting dotenv values. The public key, on the other hand, can be safely checked into the repository and is used everywhere to encrypt new values.

The strict separation of configuration and code is a fundamental principle of software development and is based on the The Twelve-Factor App methodology. One way to do this is to store these data into separate configuration files such as the dotenv files mentioned above. These are mostly unencrypted, but usually contain very sensitive data such as database access and API keys. They must therefore never be checked into the code repository! Since these are usually files within the project, there is still a risk that this could happen by mistake.

The PHPVault approach preserves the principle of separation and goes one step further: It encrypts plain dotenv files and allows them to be checked into the code repository. To decrypt and use the data on a productive system, simply exchange the private key. This approach is great for providing secure and automated deployment processes (CI/CD, etc.).

To start simply run:

This requires Composer, a dependency manager for PHP.

Command line command vendor/bin/php-vault

The basis of all operations is the command line tool vendor/bin/php-vault. Help can be displayed at any time:

On development system

Usually, you need the public key in this environment. Examples can be found below. There are several ways to pass the public key to the php-vault interpreter. In the following, the key is loaded from the .keys directory (--public-key).

Generate keys

Create environment file

Display the environment file

On production system

Usually, you need the private key in this environment. Examples can be found below. There are several ways to pass the private key to the php-vault interpreter. In the following, the key is loaded from the .keys directory (--private-key).

Display an encrypted file

Decrypt an encrypted file

Display the decrypted file without encryption

Using the PHPVault class

Load the private key from a given file

Load the private key from the server environment variable PRIVATE_KEY

For options to set the environment variable, see here.

Run tests

The part is only available if the project is checked out directly for development:

PHPUnit tests

Static code analysis (PHPStan)

Continuous integration

Runs @analyse and @tests:

Security

If you discover a security vulnerability within this package, please send an email to Björn Hempel at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

PHPVault is licensed under MIT.


All versions of php-vault with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
adhocore/cli Version ^0.9.0
ext-sodium Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ixnode/php-vault contains the following files

Loading the files please wait ....