PHPackages                             kaiseki/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kaiseki/wp-env

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kaiseki/wp-env
==============

WordPress Environment Helper

1.0.0(1mo ago)21.4k5MITPHPPHP ^8.2CI passing

Since May 31Pushed 3w ago2 watchersCompare

[ Source](https://github.com/kaisekidev/kaiseki-wp-env)[ Packagist](https://packagist.org/packages/kaiseki/wp-env)[ Docs](https://github.com/kaisekidev/kaiseki-wp-env)[ RSS](/packages/kaiseki-wp-env/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (15)Versions (3)Used By (5)

kaiseki/wp-env
==============

[](#kaisekiwp-env)

WordPress environment helper — resolve and check the current environment type.

Reads the environment from the `WP_ENV` constant when it's defined (and a string), otherwise falls back to WordPress's `wp_get_environment_type()`. Provides typed checks (`isProduction()`, `isStaging()`, …) in both an injectable (`Environment`) and a static (`StaticEnvironment`) flavor.

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

[](#installation)

```
composer require kaiseki/wp-env
```

Requires PHP 8.2 or newer.

Usage
-----

[](#usage)

```
use Kaiseki\WordPress\Environment\Environment;

$env = new Environment();

$env->get();                        // e.g. 'production'
$env->isProduction();               // true
$env->is('staging', 'production');  // true if the env is either
```

The recognized values are `development`, `local`, `production`, and `staging` (the `AbstractEnvironment` constants). When you can't inject a dependency, use the static variant:

```
use Kaiseki\WordPress\Environment\StaticEnvironment;

if (StaticEnvironment::isLocal()) {
    // …
}
```

### Container wiring

[](#container-wiring)

`ConfigProvider` registers the interface → implementation aliases for a PSR-11 container (laminas-style config aggregator): `EnvironmentInterface` → `Environment` and `StaticEnvironmentInterface` → `StaticEnvironment`. Type-hint `EnvironmentInterface` in your services and let the container resolve it.

Development
-----------

[](#development)

```
composer install
composer check   # check-deps, cs-check, phpstan
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

34d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c3a6b11aea9668c9e9ca0c0f8515ef114d344acb552c695d715d35d5b388ea4?d=identicon)[woda](/maintainers/woda)

---

Top Contributors

[![davidmondok](https://avatars.githubusercontent.com/u/3883758?v=4)](https://github.com/davidmondok "davidmondok (10 commits)")[![wolfgangschaefer](https://avatars.githubusercontent.com/u/26325205?v=4)](https://github.com/wolfgangschaefer "wolfgangschaefer (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kaiseki-wp-env/health.svg)

```
[![Health](https://phpackages.com/badges/kaiseki-wp-env/health.svg)](https://phpackages.com/packages/kaiseki-wp-env)
```

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k455.6M9.6k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.4k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31182.0M2.4k](/packages/illuminate-container)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[symfony/type-info

Extracts PHP types information.

20069.8M270](/packages/symfony-type-info)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
