Download the PHP package waffle-commons/config without Composer

On this page you can find all versions of the php package waffle-commons/config. 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 config

Discord PHP Version Require PHP CI codecov Latest Stable Version Latest Unstable Version Total Downloads Packagist License

Waffle Config Component

Release: 0.1.0-beta6  |  CHANGELOG.md  |  Beta-1 hardening retained: no process-env mutation PHP extension required: ext-yaml (the native PECL YAML extension β€” not Symfony/yaml userland)

A strict, typed-getter configuration loader. Reads YAML via the native ext-yaml extension with yaml.decode_php = 0, eliminating the PHP-deserialisation gadget surface that comes with userland parsers. Environment-specific overlays are applied via array_replace_recursive, and %env(VAR)% placeholders are resolved at load time against a read-only env registry injected through the constructor β€” never against getenv() or $_ENV directly (Beta 1 hardening for FrankenPHP worker-mode safety).

πŸ“¦ Installation

ext-yaml must be available in the PHP runtime. The waffle-dev Docker image ships with it pre-installed.

🧱 Surface

Class Role
Waffle\Commons\Config\Config final implementation of ConfigInterface. Typed getters: getInt, getString, getArray, getBool. Accepts a constructor array $env = [] registry consulted for %env(VAR)% resolution.
Waffle\Commons\Config\YamlParser final parser wrapper around yaml_parse_file() with safe defaults.
Waffle\Commons\Config\DotEnv Beta 1: pure .env / .env.local parser. load(): array<string,string> returns the parsed map; no longer mutates putenv(), $_ENV, or $_SERVER.
Waffle\Commons\Config\Trait\ParserTrait Shared parse helpers.
Waffle\Commons\Config\Exception\InvalidConfigurationException Thrown when a key resolves to a value of the wrong type.

πŸš€ Usage

The constructor signature, verbatim from src/Config.php:

πŸ“ File layout

The base file is loaded first. Then app_{environment}.yaml is loaded if it exists, and merged on top of the base via array_replace_recursive. %env(VAR_NAME)% placeholders anywhere in the resolved tree are expanded against the constructor-injected $env registry (see Environment registry below).

🌱 Environment registry (Beta 1)

Beta 1 removes all process-env mutation from this component. The contract is now:

  1. DotEnv::load(): array<string,string> β€” pure file parser. Reads .env and .env.local (first file wins on conflict) and returns the parsed map. Boolean-typed keys (APP_DEBUG, DEBUG) are validated + normalized to '1'/'0'; anything else for those keys throws InvalidArgumentException. No globals are mutated.
  2. Config(..., array $env = []) β€” the caller builds the env registry and injects it. %env(VAR)% resolution reads from $this->env[$name] ?? null β€” never from getenv(), $_ENV, or $_SERVER.

Canonical wiring

array_merge is rightmost-wins on string keys, so the process environment beats .env on collision. This matches the Twelve-Factor convention and the implicit precedence of the legacy DotEnv (which silently skipped any key already in $_ENV / $_SERVER). Flip the order to make .env win.

Type-normalization asymmetry. DotEnv normalizes APP_DEBUG/DEBUG booleans; getenv() does not. So APP_DEBUG=yes in .env becomes '1', but the same value exported by the OS becomes 'yes' β€” which then fails Config::getBool('app.debug') if the YAML uses '%env(APP_DEBUG)%'. Either export canonical true/false values, or normalize $processEnv before merging, or use YAML boolean literals instead of %env()% for bool keys.

See the reference doc for the full discussion.

πŸ›Ÿ Failsafe mode

When Failsafe::ENABLED is passed, Config skips file loading and seeds a minimal default tree (waffle.security.level = 1). This is used by the ErrorHandlerMiddleware boot path so that even a totally broken config still allows the error renderer to run.

🐘 PHP 8.5 features used

🧭 Architectural boundary (mago guard)

An active dependency perimeter is enforced on every CI run by vendor/bin/mago guard (bundled into composer mago; zero baselines). The rules live in mago.toml under [guard.perimeter] β€” a forbidden use statement fails the build, not a reviewer.

Production code under Waffle\Commons\Config may depend only on:

Test code under WaffleTests\Commons\Config is unrestricted (@all). Structural rules are guarded too: interfaces must be named *Interface, Exception\** classes must end in *Exception, and any Enum\** namespace may hold only enum declarations.

Contract-first, component-agnostic by construction: components compose through waffle-commons/contracts, never directly through one another.

πŸ§ͺ Testing

πŸ“š Documentation

Full guides live in the central DiΓ‘taxis documentation tree:

πŸ“„ License

MIT β€” see LICENSE.md.


All versions of config with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ext-yaml Version *
waffle-commons/contracts Version self.version
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 waffle-commons/config contains the following files

Loading the files please wait ...