elriseio/doctrine-shard-manager-bundle
There are no earlier versions; this is the initial public release of elriseio/doctrine-shard-manager-bundle.
const declaration, #[\Override] attribute on every override method, get_resource_id() audit). The minimum runtime is already PHP 8.3 in 1.0.0; this wave adopts the language features per ADR-0005.Issues/open/developer/DE-018_* (per ADR-0005). No public-API contract change; existing ShardStrategyInterface, ShardContextInterface, etc. remain unchanged in shape..github/workflows/itests-smoke.yml as a quality-gates job that gates the itests-smoke job. Tracked under Issues/open/developer/DE-019_quality_gates.md. Non-breaking change (dev-only); may ship as a minor (2.0.1 or 2.1.0) per operator's call.Full direction-setting rationale:
docs/adr/0005-php-83-migration.md(Wave 5) anddocs/adr/0006-quality-gates.md(Wave 6).
ShardContextInterface, ShardResolverInterface, ShardStrategyInterface, ShardConnectionManagerInterface, EntityManagerProxyInterface, ShardedRepositoryInterface — the six public contracts consumers depend on. All concrete implementations are un-tagged internal; consumers MUST type-hint against the interfaces.HashShardStrategy (SHA-256 modulo total_shards), RangeShardStrategy (binary-search over a range_table partition with overlap detection at construction), UuidShardStrategy (UUIDv7 with embedded shard index in clock_seq_low, bit-mask configurable). Each strategy accepts an optional Psr\Cache\CacheItemPoolInterface for PSR-6 memoization and an optional Psr\Log\LoggerInterface for structured resolution logs; cache failures degrade gracefully (logged + bypassed).ShardResolver resolves a shard ID from an entity, an ID, or a criteria array; merges YAML sharding_configs and PHP #[Sharding] attribute with DI configs winning over the attribute. CachedShardResolver wraps the resolver with a PSR-6 layer to amortize reflection cost on hot paths.ShardContext::withShard($shardId, fn) and withEntity($entity, fn) route the active Connection and EntityManager for the duration of the callback. ShardedRepository exposes findOneById, findBy, findOneBy, persistToShard, removeFromShard, flushShard so business code stays unchanged.ShardedFinder::find(callable $query, array $shardIds) fans out a query to multiple shards lazily via \Generator. Sequential v1; bypasses the write-path ShardContext (consistent with ADR-0004); throws on the first shard failure with the per-shard context framed in the exception message.#[Sharding] attribute on entity class OR YAML under doctrine_shard.sharding_configs.<FQCN>. Resolution precedence is YAML > attribute, documented in docs/architecture.md::I-RES1.bin/console shard:add <id> provisions a new shard's schema from filtered entity metadata (#[Sharding] entities only, drop-and-recreate via SchemaTool::updateSchema with saveMode: true — greenfield only, see docs/components/command-add-shard.md::Safety Warning). bin/console shard:migrate <id> runs Doctrine Migrations on a single named shard and is additive (Wave 2 / ADR-0003).doctrine_shard.shard.{hash,range,uuid} strategy configs, doctrine_shard.sharding_configs.<FQCN> per-entity configs, doctrine_shard.resolver.cache.{enabled,pool_service_id} cache wiring, doctrine_shard.cache_ttl global TTL (default 86400s). All public services are public-facing — overriding a strategy is a single services.yaml alias away.app.shard_strategy extensibility contract (ADR-0002), shard:add vs shard:migrate semantics (ADR-0003), ShardedFinder cross-shard read coordinator (ADR-0004), PHP 8.3 minimum (ADR-0005). Full index at docs/architecture/STATUS.md::Architectural Decisions.src/, 23 component docs in docs/components/, 7 contract docs in docs/contracts/, architecture map in docs/architecture.md, meta-document in docs/architecture/STATUS.md, runbook in docs/RUNBOOK.md, roadmap in docs/ROADMAP.md. Docs↔code invariant is enforced — every component and contract has a corresponding file.Verification:
composer validate --strictpasses;vendor/bin/phpunitruns the existing 69+ mock-based unit tests on the PHP 8.3 baseline (10 tests opt-in skipped viaRequiresDatabase);vendor/bin/php-cs-fixer fix --dry-runis green on the current ruleset.php -lclean on every PHP file undersrc/,tests/,bench/,itests/.
How can I help you explore Laravel packages today?