Download the PHP package wp-spaghetti/wp-env without Composer

On this page you can find all versions of the php package wp-spaghetti/wp-env. 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 wp-env

PHP Version Packagist Downloads Packagist Stars GitHub Actions Workflow Status Coverage Status Known Vulnerabilities GitHub Issues

GitHub Release License

WP Env

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

Features

Installation

Install via Composer:

Quick Start

1. Basic Usage

2. Configuration Priority

WP Env uses the following priority order:

  1. WordPress Constants (define() in wp-config.php)
  2. .env files (via oscarotero/env if available)
  3. System environment (getenv())
  4. Default values

3. WordPress Integration

API Reference

Core Methods

Environment::get(string $key, mixed $default = null): mixed

Get environment variable with fallback to default value.

Environment::getBool(string $key, bool $default = false): bool

Get environment variable as boolean. Recognizes: 1, true, on, yes, enabled.

Environment::getInt(string $key, int $default = 0): int

Get environment variable as integer with type conversion.

Environment::getFloat(string $key, float $default = 0.0): float

Get environment variable as float with type conversion.

Environment::getArray(string $key, array $default = []): array

Get environment variable as array (comma-separated values).

Environment::getRequired(string $key): mixed

Get required environment variable (throws exception if missing).

Validation Methods

Environment::validateRequired(array $keys): void

Validate that all required environment variables are set.

Environment::load(array $keys): array

Load multiple environment variables at once.

Environment Detection

Environment::getEnvironment(): string

Get current environment type: development, staging, or production.

Environment::isDevelopment(): bool

Check if running in development environment.

Environment::isStaging(): bool

Check if running in staging environment.

Environment::isProduction(): bool

Check if running in production environment.

Container Detection

Environment::isDocker(): bool

Check if running inside a Docker container.

Environment::isContainer(): bool

Check if running in any containerized environment (Docker, Podman, etc.).

WordPress-Specific Methods

Environment::isDebug(): bool

Check if WordPress debug mode is enabled (WP_DEBUG).

Environment::isMultisite(): bool

Check if WordPress is running in multisite mode.

Environment::isCli(): bool

Check if running via CLI (WP-CLI or PHP CLI).

Environment::isWeb(): bool

Check if running via web request.

System Information

Environment::getServerSoftware(): string

Get server software (nginx, apache, litespeed, iis).

Environment::getPhpSapi(): string

Get PHP SAPI information.

Utility Methods

Environment::getDebugInfo(): array

Get comprehensive environment information for debugging.

Environment::clearCache(): void

Clear internal caches (useful for testing).

Environment::addSensitiveKey(string $key): void

Add key to sensitive list (prevents caching/logging).

Configuration Examples

WordPress Constants (wp-config.php)

Environment File (.env)

Docker Compose Integration

Hook System

WP Env provides several WordPress hooks for customization:

Filter Environment Values

Custom Environment Detection

Container Detection Override

Sensitive Key Protection

Cache Events

Advanced Usage Examples

Plugin Configuration Management

Environment-Specific Service Registration

Multi-Environment Configuration

Troubleshooting

Debug Information

Common Issues

Environment not detected correctly:

Values not loading:

Container detection issues:

Requirements

Changelog

Please see CHANGELOG for a detailed list of changes for each release.

We follow Semantic Versioning and use Conventional Commits to automatically generate our changelog.

Release Process

All releases are automatically created when changes are pushed to the main branch, based on commit message conventions.

Contributing

For your contributions please use:

See CONTRIBUTING for detailed guidelines.

Sponsor

Buy Me A Coffee

License

(ɔ) Copyleft 2026 Frugan.
GNU GPLv3, see LICENSE file.


All versions of wp-env with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 wp-spaghetti/wp-env contains the following files

Loading the files please wait ...