Download the PHP package re2bit/yii2-secrets without Composer

On this page you can find all versions of the php package re2bit/yii2-secrets. 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 yii2-secrets

PHP 7.0 Compatible Secrets Management Library Yii Module

This Module offers a secure way to manage sensitive information, inspired by the Symfony Secrets feature. It's designed for PHP 7.0 compatibility, leveraging modern cryptography with the Sodium extension or paragonie/sodium_compat.

Requirements

Setting Up

  1. Install Dependencies: Make sure the Sodium extension is enabled in your PHP environment, or install paragonie/sodium_compat if it isn't already.

  2. Configure Yii2 Application: Modify your Yii2 application configuration to include the Secrets module. Here’s how you can set it up:

    • Update Composer: Ensure your composer.json file includes the necessary libraries and update your project dependencies:

      This will install the library required for compatibility with PHP 7.0 if you do not have the Sodium PHP extension.

    • Modify Config Files: In your Yii2 application config file (usually config/main.php or config/web.php for web applications), add the following configurations to integrate the Vault component which manages the secrets:

    • Adjust Entry Points: In the entry point of your application, such as index.php for web applications or yii script for console applications, initialize the Vault and ConfigDecryptAdapter:

This setup ensures that your Yii2 application securely manages secrets, leveraging modern cryptography standards, even if running under PHP 7.0.

Using Secrets in Configuration

To include secrets in your configuration, use the %vault(secretName)% format. When the configuration is parsed, these placeholders will be replaced with their decrypted values.

Example:

In this example, %vault(DB_USERNAME)% and %vault(DB_PASSWORD)% will be replaced by their respective decrypted values during the configuration parsing process.

License

This package is available under MIT.

Acknowledgments

This library is based and inspired by the work of:

from the Symfony framework. It has been adapted for PHP 7.0 with a focus on using Sodium for encryption.


All versions of yii2-secrets with dependencies

PHP Build Version
Package Version
Requires php Version ^7|^8
re2bit/secrets Version 1.0.0-alpha.1.1
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 re2bit/yii2-secrets contains the following files

Loading the files please wait ...