Download the PHP package rasuvaeff/yii3-feature-flags without Composer
On this page you can find all versions of the php package rasuvaeff/yii3-feature-flags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rasuvaeff/yii3-feature-flags
More information about rasuvaeff/yii3-feature-flags
Files in rasuvaeff/yii3-feature-flags
Package yii3-feature-flags
Short Description Feature flags, kill switches and percentage rollout for Yii3 applications
License BSD-3-Clause
Homepage https://github.com/rasuvaeff/yii3-feature-flags
Informations about the package yii3-feature-flags
rasuvaeff/yii3-feature-flags
Feature flags, kill switches and percentage rollout for Yii3 applications.
Stateless core — storage backends are separate packages. Deterministic rollout via SHA-256 hash. Works with Yii3 config-plugin or standalone.
Using an AI coding assistant? llms.txt has a compact API reference you can give to the LLM to help it work with this package. Projects using the llm/skills Composer plugin also get this package's agent skill synced into
.agents/skills/automatically on install.
Requirements
- PHP 8.3+
Installation
Usage
Basic flag check
Configuration
In your application config (config/params.php):
Configuration options
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
bool |
true |
Master switch for the flag |
salt |
string |
flag name | Hash salt for deterministic rollout |
rollout |
int |
100 |
Percentage of subjects to include (0..100) |
killSwitch |
bool |
false |
Immediately disable the flag, overrides all rules |
environments |
list<string> |
[] |
Restrict to specific environments (empty = all) |
FlagContext
Forced values
Use forced values for QA/debug overrides on existing flags:
A forced value never re-enables a flag that has its kill switch active — the kill switch wins.
Strict mode
Unknown flags return false by default. Enable strict mode to throw instead:
Evaluation result
Get detailed information about why a flag is enabled or disabled:
EvaluationReason carries a single machine-readable reason instead of a set of
overlapping booleans:
| Case | enabled |
When |
|---|---|---|
Enabled |
true |
Flag on, no targeting/rollout exclusion |
Disabled |
false |
enabled: false on the flag |
KillSwitch |
false |
killSwitch: true overrides everything |
RolloutExcluded |
false |
Subject outside the rollout bucket |
EnvironmentExcluded |
false |
Context environment not in the flag's allowlist |
Forced |
caller-set | FlagContext::withForcedFlag() overrode the result |
Unknown |
false |
Flag not registered (non-strict mode) |
bash composer require rasuvaeff/yii3-feature-flags-db bash make install # composer install make build # full gate: validate + cs + psalm + test make cs-fix # fix code style make psalm # static analysis make test # run tests make test-coverage # run coverage make mutation # mutation testing make release-check # build + rector + bc-check + mutation
`make test-coverage` and `make mutation` bootstrap `pcov` inside the
`composer:2` container because the base image has no coverage driver.
## License
BSD-3-Clause. See [LICENSE.md](LICENSE.md).