{"id":18369246,"url":"https://github.com/envkey/envkey-php","last_synced_at":"2025-04-06T17:32:07.309Z","repository":{"id":166218350,"uuid":"641552428","full_name":"envkey/envkey-php","owner":"envkey","description":"Mirror repo for EnvKey's official PHP client library","archived":false,"fork":false,"pushed_at":"2023-10-20T16:21:50.000Z","size":38422,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T04:03:27.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/envkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-16T17:57:44.000Z","updated_at":"2024-05-11T03:18:06.000Z","dependencies_parsed_at":"2023-10-20T17:45:50.366Z","dependency_job_id":null,"html_url":"https://github.com/envkey/envkey-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envkey","download_url":"https://codeload.github.com/envkey/envkey-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522475,"owners_count":20952558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:28:52.043Z","updated_at":"2025-04-06T17:32:02.300Z","avatar_url":"https://github.com/envkey.png","language":"PHP","readme":"# envkey-php\n\nIntegrate [EnvKey](https://www.envkey.com) with your PHP projects to keep API keys, credentials, and other configuration securely and automatically in sync for developers and servers.\n\n![envkey-php integration example](envkey-php.gif)\n\nThis repo is mirrored in two locations:\n\n- [A subdirectory of EnvKey's v2 monorepo](https://github.com/envkey/envkey/tree/main/public/sdks/languages-and-frameworks/php).\n- [envkey-php package repo](https://github.com/envkey/envkey-php)\n\n## Installation\n\n```bash\n$ composer require envkey/envkey-php\n```\n\n## Usage\n\nIf you haven't already, download and install EnvKey from our [website](https://envkey.com), then create a new org. Next, follow the ~1 minute [integration quickstart](https://docs-v2.envkey.com/docs/integration-quickstart) to init an app with a `.envkey` file (for connecting development) or generate a server `ENVKEY` (for connecting a server).\n\nAt the entry point of your application, be sure you're including the composer autoloader.\n\n```php\nrequire_once 'vendor/autoload.php'; // Include the Composer autoloader\n```\n\nNow all your EnvKey variables will be available with `getenv('VARIABLE_NAME')`.\n\n```php\n$stripe = new \\Stripe\\StripeClient(getenv('STRIPE_SECRET_KEY'));\n```\n\n### Errors\n\nThe package will throw an error if an `ENVKEY` is missing or invalid.\n\n### Overriding Vars\n\nThis 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](https://docs-v2.envkey.com/docs/branches-and-local-overrides) for this purpose.\n\n### PHP Request Model / Latency\n\nUnlike 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).\n\n### Working Offline\n\nAs 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.\n\n## envkey-source\n\nUsing a language-specific library like this one is the easiest and fastest method of integrating with EnvKey. That said, the [envkey-source](https://docs-v2.envkey.com/docs/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.\n\n## x509 error / ca-certificates\n\nOn 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:\n\n```\napk add --no-cache ca-certificates\n```\n\n## Further Reading\n\nFor more on EnvKey in general:\n\nRead the [docs](https://docs-v2.envkey.com).\n\nRead the [integration quickstart](https://docs-v2.envkey.com/docs/integration-quickstart.html).\n\nRead the [security and cryptography overview](https://docs-v2.envkey.com/docs/security).\n\n## Need help? Have questions, feedback, or ideas?\n\nPost an [issue](https://github.com/envkey/envkey/issues), start a [discussion](https://github.com/envkey/envkey/dicussions), or email us: [support@envkey.com](mailto:support@envkey.com).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvkey%2Fenvkey-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvkey%2Fenvkey-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvkey%2Fenvkey-php/lists"}