Releases: rasuvaeff/yii3-feature-flags-db
Releases · rasuvaeff/yii3-feature-flags-db
Release list
v2.0.1
- Docs: the documented
setSourceNamespaces()migration registration does not
find the bundled migration and never has —yiisoft/db-migrationmatches the
PSR-4 map by string prefix and resolves into the core package, so
./yii migrate:upexits 0 having created nothing. Both READMEs now say so and
give a workingInjector-based recipe until the upstream fix ships.
v2.0.0
Breaking. See UPGRADE.md — an installation that already
applied the migration must rewrite one row in the migration table.
- The bundled migration moved to
Rasuvaeff\Yii3FeatureFlagsDb\Migration\M260605000000CreateFeatureFlagsTable
(src/Migration/, PSR-4 autoloaded) from a global class inmigrations/.
Register it withsetSourceNamespaces()instead of avendor/path. Being
autoloadable is what makes it safe to reference in DI at all: with the old
global class, adding any container definition for it made
Yiisoft\Di\Containerfatal at build time in every request, because
new ReflectionClass()ran before the migration runner had required the file. - The documented way to rename the table never worked.
M...::class => ['__construct()' => ['table' => ...]]is ignored:
yiisoft/db-migrationbuilds migrations throughInjector::make(), which
resolves arguments by name or type from the container and does not read
definitions keyed by the migration's class — and a scalarstring $tablehas
no type to resolve. Users following the README silently got the default name. - The table name is now a typed value object that
Injectorcan resolve,
built byconfig/di.phpfrom params. One source of truth: the migration and
DbFlagProvidercannot disagree any more (in 1.x the runtime read params while the
migration used its own default, so configuring params pointed the runtime at a
table the migration had never created). - New
table_prefixparam, prepended totable— a single place to keep
package tables out of the way of an application's own. DbFlagProvidervalidates the table name (through the same value object) —
in 1.x it interpolated whatever string it was given straight into the query
builder, with no identifier check at all.- The row mapper's integer check is anchored with
\zinstead of$: PCRE's
$also matches before a trailing newline. - Bump
rasuvaeff/property-testingto^2.6.
v1.0.1
- Add
/benchmarksand/Makefileto.gitattributesexport-ignore.
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
- Migrate test suite from PHPUnit to Testo. Internal change, no public API impact.
v1.0.0
- Initial stable release.
DbFlagProviderandCachedFlagProvidernow implement
Rasuvaeff\Yii3FeatureFlags\WritableFlagProvider(new in core 1.0.0):save(Flag)— upsert keyed by flagname.remove(string)— idempotent delete.CachedFlagProvideris write-through: after delegating to a writable inner
provider it clears its cache; on a read-only inner it is a silent no-op.
FlagRowMapper::encodeEnvironments()(new public static method) is the
inverse ofextractEnvironments()and is used byDbFlagProvider::save().
The two are round-trip compatible.DbFlagProvider::toRow()normalisessaltto''when it equals the flag
nameto preserve theemptySaltFallsBackToNameinvariant on read-back.config/di.phpnow bindsWritableFlagProvider::classto the same instance
asFlagProvider::classviaYiisoft\Definitions\Reference. One key, one
vendor — noDuplicate keyconflict with the core.- Requires
rasuvaeff/yii3-feature-flags^1.0 and addsyiisoft/definitions^3.0. FlagRowMappernow wraps\InvalidArgumentExceptionfrom core (both
InvalidFlagNameExceptionfor name and plainInvalidArgumentException
for rollout range) intoInvalidFlagRowException.