PHPackages                             wp-spaghetti/wp-env - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. wp-spaghetti/wp-env

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

wp-spaghetti/wp-env
===================

A comprehensive WordPress environment management utility with Docker detection, typed getters, and secure configuration handling

v2.2.3(8mo ago)0804[1 PRs](https://github.com/wp-spaghetti/wp-env/pulls)2GPL-3.0-or-laterPHPPHP &gt;=8.0CI passing

Since Aug 31Pushed 1mo agoCompare

[ Source](https://github.com/wp-spaghetti/wp-env)[ Packagist](https://packagist.org/packages/wp-spaghetti/wp-env)[ Docs](https://github.com/wp-spaghetti/wp-env)[ Fund](https://buymeacoff.ee/frugan)[ RSS](/packages/wp-spaghetti-wp-env/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (10)Used By (2)

[![PHP Version](https://camo.githubusercontent.com/396b58ebb2ba6d79160e6bd6d61c836c1bdc43f40e0b4866806faf276a9410e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/396b58ebb2ba6d79160e6bd6d61c836c1bdc43f40e0b4866806faf276a9410e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f77702d7370616768657474692f77702d656e76)[![Packagist Downloads](https://camo.githubusercontent.com/ff7625cb713dca5051eee5137b198143aaff75f9e04ea321461f29c2a0f5d5ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/ff7625cb713dca5051eee5137b198143aaff75f9e04ea321461f29c2a0f5d5ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77702d7370616768657474692f77702d656e76)[![Packagist Stars](https://camo.githubusercontent.com/bab82b93079804f28f0a422526db8a74f15b0e6b5f6e9aded72d840d9541a431/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/bab82b93079804f28f0a422526db8a74f15b0e6b5f6e9aded72d840d9541a431/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f77702d7370616768657474692f77702d656e76)[![GitHub Actions Workflow Status](https://github.com/wp-spaghetti/wp-env/actions/workflows/main.yml/badge.svg)](https://github.com/wp-spaghetti/wp-env/actions/workflows/main.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/953f7d83c0ad734a42a145104f0829e27bc73137da747325285e8eccbb9848de/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/953f7d83c0ad734a42a145104f0829e27bc73137da747325285e8eccbb9848de/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f77702d7370616768657474692f77702d656e76)[![Known Vulnerabilities](https://camo.githubusercontent.com/82740ab1adef0fdd77810372ab8d3bc07770a452e3172508f8ea9c9ac46ad404/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f77702d7370616768657474692f77702d656e762f62616467652e737667)](https://camo.githubusercontent.com/82740ab1adef0fdd77810372ab8d3bc07770a452e3172508f8ea9c9ac46ad404/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f77702d7370616768657474692f77702d656e762f62616467652e737667)[![GitHub Issues](https://camo.githubusercontent.com/f8a4cfcbfe6a3537ee590d8b32912ceef088615ff192b536b979697d308d0cc3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/f8a4cfcbfe6a3537ee590d8b32912ceef088615ff192b536b979697d308d0cc3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f77702d7370616768657474692f77702d656e76)

[![GitHub Release](https://camo.githubusercontent.com/e5d5e7550de4930de99954d8129e13651937e42ca72a0567f9a9bdb62b0f70cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/e5d5e7550de4930de99954d8129e13651937e42ca72a0567f9a9bdb62b0f70cb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f77702d7370616768657474692f77702d656e76)[![License](https://camo.githubusercontent.com/1d2bc08e454dbb774726bbdc2abeb40859d0c8419f8b34b9ab59837936802b2a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f77702d656e76)](https://camo.githubusercontent.com/1d2bc08e454dbb774726bbdc2abeb40859d0c8419f8b34b9ab59837936802b2a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77702d7370616768657474692f77702d656e76)

WP Env
======

[](#wp-env)

A comprehensive WordPress environment management utility with typed getters, system detection and secure configuration handling.

Features
--------

[](#features)

- **Multi-Source Configuration**: WordPress constants, .env files, and getenv() with intelligent priority
- **Typed Getters**: Type-safe methods for bool, int, float, and array values
- **Environment Detection**: Automatic development, staging, and production environment detection
- **Container Detection**: Docker, Kubernetes, Podman, and other containerization detection
- **Performance Caching**: Smart caching system with sensitive data protection
- **Security-Focused**: Built-in protection for sensitive configuration values
- **WordPress Integration**: Native WordPress hooks and filters for customization
- **Zero Dependencies**: Works with or without external environment libraries
- **Bedrock Compatible**: Seamless integration with modern WordPress setups

Installation
------------

[](#installation)

Install via Composer:

```
composer require wp-spaghetti/wp-env
```

Quick Start
-----------

[](#quick-start)

### 1. Basic Usage

[](#1-basic-usage)

```
