Recommend this page to a friend! |
Download .zip |
Info | View files (38) | Download .zip | Reputation | Support forum | Blog (1) | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2023-06-27 (2 months ago) | Not yet rated by the users | Total: 45 | All time: 10,610 This week: 128 |
Version | License | PHP version | Categories | |||
envkey-php 1.0 | Custom (specified... | 5 | PHP 5, Web services, Language |
Description | Author | ||||||||||||||
This package can load environment variables from the EnvKey service. Innovation Award |
|
Integrate EnvKey with your PHP projects to keep API keys, credentials, and other configuration securely and automatically in sync for developers and servers.
This repo is mirrored in two locations:
$ composer require envkey/envkey-php
If you haven't already, download and install EnvKey from our website, then create a new org. Next, follow the ~1 minute integration quickstart to init an app with a .envkey
file (for connecting development) or generate a server ENVKEY
(for connecting a server).
At the entry point of your application, be sure you're including the composer autoloader.
require_once 'vendor/autoload.php'; // Include the Composer autoloader
Now all your EnvKey variables will be available with getenv('VARIABLE_NAME')
.
$stripe = new \Stripe\StripeClient(getenv('STRIPE_SECRET_KEY'));
The package will throw an error if an ENVKEY
is missing or invalid.
This package will not overwrite existing environment variables or additional variables set in the .env
file you loaded your ENVKEY
from. This can be convenient for customizing environments that otherwise share the same configuration. You can also use branches or local overrides for this purpose.
Unlike other EnvKey language libraries that expect a long-running server process, this library is designed for PHP's short-lived per-request processes. Instead of loading config from an EnvKey host on every request, which would add 100-500ms of latency (depending on location and connection speed), this library caches your encrypted config in RAM in a background process and keeps it up to date. After the first load of EnvKey on a server, subsequent requests will load config from this cache, with effectively zero latency (less than 1 millisecond).
As mentioned in the previous section, this package caches your encrypted config in RAM. Your config will still be available (though possibly not up-to-date) if you lose your internet connection. When the connection is reestablished, the latest config will be loaded immediately.
Using a language-specific library like this one is the easiest and fastest method of integrating with EnvKey. That said, the envkey-source executable, which this library wraps, provides additional options and functionality when used directly from the command line. If you need additional flexibility and it works for your use case, consider using envkey-source directly.
On a stripped down OS like Alpine Linux, you may get an x509: certificate signed by unknown authority
error when attempting to load your config. You can fix it by ensuring that the ca-certificates
dependency is installed. On Alpine you'll want to run:
apk add --no-cache ca-certificates
For more on EnvKey in general:
Read the docs.
Read the integration quickstart.
Read the security and cryptography overview.
Post an issue, start a discussion, or email us: support@envkey.com.
Files |
File | Role | Description | ||
---|---|---|---|---|
example (2 files, 1 directory) | ||||
ext (8 directories) | ||||
src (4 files) | ||||
tests (1 file) | ||||
06e9ac4b9e0f4f24.version.shasum | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
envkey-php.gif | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
sdkphp-version.txt | Doc. | Documentation |
Files | / | example |
File | Role | Description | ||
---|---|---|---|---|
src (1 file) | ||||
composer.json | Data | Auxiliary data | ||
index.php | Example | Example script |
Files | / | ext |
File | Role | Description | ||
---|---|---|---|---|
envkey-source_2.4.0_darwin_amd64 (3 files) | ||||
envkey-source_2.4.0_darwin_arm64 (3 files) | ||||
envkey-source_2.4.0_freebsd_amd64 (3 files) | ||||
envkey-source_2.4.0_freebsd_arm64 (3 files) | ||||
envkey-source_2.4.0_linux_amd64 (3 files) | ||||
envkey-source_2.4.0_linux_arm64 (3 files) | ||||
envkey-source_2.4.0_windows_amd64 (3 files) | ||||
envkey-source_2.4.0_windows_arm64 (3 files) |
Files | / | ext | / | envkey-source_2.4.0_darwin_amd64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_darwin_arm64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_freebsd_amd64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_freebsd_arm64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_linux_amd64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_linux_arm64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_windows_amd64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | ext | / | envkey-source_2.4.0_windows_arm64 |
File | Role | Description |
---|---|---|
envkeysource-version.txt | Doc. | Documentation |
LICENSE | Lic. | License text |
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description |
---|---|---|
auto.php | Aux. | Auxiliary script |
constants.php | Aux. | Auxiliary script |
Fetcher.php | Class | Class source |
Loader.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.