bear/query-repository
AboutResource Query Responsibility Segregation (RQRS) is a caching framework for BEAR.Sunday that optimizes performance by separating query and command responsibilities. It features event-driven cache invalidation, dependency resolution, donut caching, CDN integration, and conditional requests.
1.16.2
618K downloads/mo
#4982 most downloaded on Packagist
bearsunday/BEAR.QueryRepository
What this package is like to depend on
Last release 1 months ago
29 Jun 2026
Release timing varies
gaps range from 9 days to 6 months
Rarely documented
notes for 11 of 84 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
85 releases · first in 2015
7 releases in the last 12 months
see the full history below
Release timeline
84 releases · Feb 2015 to Jun 2026Releases
latest 60 of 85-
1.16.229 Jun 2026Release notes
Open source →Fixed
- Remove unused ETag from invalidation tags: ETag was unnecessarily registered as a cache invalidation tag. No code path invalidates by ETag (only by URI tag and surrogate keys), so each content version produced a new, non-volatile tag Set that was never read or reclaimed. Under
volatile-*eviction policies these Sets leaked memory indefinitely. (#180)
Release notes
Open source →Fixed
- Remove unused ETag from invalidation tags: ETag was unnecessarily registered as a cache invalidation tag. No code path invalidates by ETag (only by URI tag and surrogate keys), so each content version produced a new, non-volatile tag Set that was never read or reclaimed. Under
volatile-*eviction policies these Sets leaked memory indefinitely. (#180)
- Remove unused ETag from invalidation tags: ETag was unnecessarily registered as a cache invalidation tag. No code path invalidates by ETag (only by URI tag and surrogate keys), so each content version produced a new, non-volatile tag Set that was never read or reclaimed. Under
-
1.16.131 May 2026Release notes
Open source →Fixed
- Fix multi-embed cache dependency: a
#[Cacheable]resource embedding more than one child kept only the last child's dependency, so purging an earlier child failed to invalidate the parent (stale cache).CacheDependency::depends()now accumulates child tags instead of overwriting, and the erroneous assertion that a parent had no prior tags has been removed.
Release notes
Open source →Fixed
- Fix multi-embed cache dependency: a
#[Cacheable]resource embedding more than one child kept only the last child's dependency, so purging an earlier child failed to invalidate the parent (stale cache).CacheDependency::depends()now accumulates child tags instead of overwriting, and the erroneous assertion that a parent had no prior tags has been removed.
- Fix multi-embed cache dependency: a
-
1.16.016 May 2026Release notes
Open source →Fixed
- Resolve embed cache dependencies before HAL rendering: child resources' ETag headers are now collected before
HalRendererstripsRequestinstances from the body, so the parent'sSurrogate-Keyreliably includes all embedded children (#174) - Include async embed children in dependency resolution: walk by
AbstractRequestinstead of the concreteRequest, soAsyncRequest(and otherAbstractRequestsubclasses) are no longer silently skipped
Changed
- Cache dependency resolution moved from
EtagSetter/DevEtagSetterintoQueryRepository::put()(runs on HTTP 200 only, before persistence) QueryRepository::__construct()now requiresCacheDependencyInterfaceEtagSetter::__construct()andDevEtagSetter::__construct()no longer acceptCacheDependencyInterface- DI users via
QueryRepositoryModuleare unaffected; only callers that directlynewthese classes need to update their constructor calls
Added
- HAL embed cache dependency test (
tests/CacheDependencyTest.php) - Non-Cacheable embed child test fixtures and
continuepath coverage
Release notes
Open source →Fixed
- Resolve embed cache dependencies before HAL rendering: child resources' ETag headers are now collected before
HalRendererstripsRequestinstances from the body, so the parent'sSurrogate-Keyreliably includes all embedded children (#174) - Include async embed children in dependency resolution: walk by
AbstractRequestinstead of the concreteRequest, soAsyncRequest(and otherAbstractRequestsubclasses) are no longer silently skipped
Changed
- Cache dependency resolution moved from
EtagSetter/DevEtagSetterintoQueryRepository::put()(runs on HTTP 200 only, before persistence) QueryRepository::__construct()now requiresCacheDependencyInterfaceEtagSetter::__construct()andDevEtagSetter::__construct()no longer acceptCacheDependencyInterface- DI users via
QueryRepositoryModuleare unaffected; only callers that directlynewthese classes need to update their constructor calls
Added
- HAL embed cache dependency test (
tests/CacheDependencyTest.php) - Non-Cacheable embed child test fixtures and
continuepath coverage
- Resolve embed cache dependencies before HAL rendering: child resources' ETag headers are now collected before
-
1.15.107 Feb 2026Release notes
Open source →What's Changed
Fixed
- Replace deprecated
DateTimeInterface::RFC7231withHeader::RFC7231constant for PHP 8.5 compatibility (#173) - Centralize RFC 7231 date format in
Header::RFC7231used by all EtagSetter implementations
Full Changelog: 1.15.0...1.15.1
- Replace deprecated
-
1.15.002 Feb 2026Release notes
Open source →What's Changed
Added
- Add
ServerContextInterfacefor coroutine-safe request handling in Swoole/RoadRunner environments - Add
GlobalServerContextas default implementation using$_SERVERsuperglobal - Add
RepositoryLoggerInterfacewithreset()method for long-running process support
Changed
- Bind
ServerContextInterfacetoGlobalServerContextinQueryRepositoryModule - Use
ServerContextInterfaceinResourceStorageinstead of direct$_SERVERaccess
Full Changelog: 1.14.0...1.15.0
Release notes
Open source →Added
- Add
ServerContextInterfacefor coroutine-safe request handling in Swoole/RoadRunner environments - Add
GlobalServerContextas default implementation using$_SERVERsuperglobal - Add
RepositoryLoggerInterfacewithreset()method for long-running process support
Changed
- Bind
ServerContextInterfacetoGlobalServerContextinQueryRepositoryModule - Use
ServerContextInterfaceinResourceStorageinstead of direct$_SERVERaccess
- Add
-
1.14.024 Jan 2026Release notes
Open source →Added
- LLM documentation (
docs/llms.txt,docs/llms-full.txt) for AI-assisted development - JSON schema for RepositoryLogger output (
docs/schemas/repository-log.json) - Cache dependency demos for AI log analysis
- Cache dependency test coverage documentation
Changed
- RepositoryLogger output changed to JSON format for structured logging
- Updated
.gitattributesto exclude development files from release - Require
ray/aop^2.19.1 andray/di^2.20 for PHP 8.5 compatibility - Updated copyright year to 2026
Fixed
- UriTagTest typo in documentation
Release notes
Open source →Added
- Add LLM documentation (
docs/llms.txt,docs/llms-full.txt) for AI-assisted development - Add JSON schema for RepositoryLogger output (
docs/schemas/repository-log.json) - Add cache dependency demos for AI log analysis (
demo/run-dependency.php,demo/run-donut.php) - Add cache dependency test coverage documentation (
tests/CACHE_DEPENDENCY_TESTS.md) - Add test resources for cache dependency patterns (ParentA, ParentB, ChildC)
Changed
- Change RepositoryLogger output to JSON format for structured logging
- Update
.gitattributesto exclude development files from release - Require
ray/aop^2.19.1 andray/di^2.20 for PHP 8.5 compatibility - Update copyright year to 2026
Fixed
- Fix UriTagTest typo in documentation
- LLM documentation (
-
1.13.010 Nov 2025Release notes
Open source →Changes
Changed
- PHP 8 Attributes Migration: Removed
doctrine/annotationsanddoctrine/cachedependencies, migrated to native PHP 8 attributes - Minimum PHP Version: Updated requirement from PHP 8.1 to PHP 8.2
- Development Tools: Updated PHP_CodeSniffer to 4.0, Doctrine Coding Standard to 14.0, Slevomat Coding Standard to 8.24, PHPUnit to 11.5
- Performance Improvements: Set
ResourceStorageto singleton scope, optimized readonly class declarations for PHP 8.2 - Enhanced Redis: Improved marshaller configuration with deflate compression support
- Cross-Platform: Normalized URI separators and path handling for Windows/macOS/Linux
- Documentation: Improved cache attribute and interceptor documentation with usage examples
- Dependencies: Updated Symfony Cache to ^7.3, ray/aop to ^2.16, ray/di to ^2.17.2, vimeo/psalm to 6.12
Added
- Migration Tools: Added
rector-migrate.phpfor automated annotation-to-attribute migration - Migration Guide: Added
ANNOTATION_TO_ATTRIBUTE.mdwith comprehensive migration instructions - PHP 8.4 & 8.5 Support: Added PHP 8.4 and 8.5 support in CI workflow
- Documentation: Added
CLAUDE.mdwith complete codebase architecture guide - Japanese Docs: Added
README.ja.md
Removed
doctrine/annotations(abandoned package)doctrine/cache(abandoned package)- Sodium marshaller related code
⚠️ Migration Required
Applications using annotations must migrate to PHP 8 attributes:
# Preview changes vendor/bin/rector process src --config=vendor/bear/query-repository/rector-migrate.php --dry-run # Apply migration vendor/bin/rector process src --config=vendor/bear/query-repository/rector-migrate.php
See
ANNOTATION_TO_ATTRIBUTE.mdfor detailed migration guide.Why This Change?
The
doctrine/annotationspackage has been officially abandoned by its maintainers and will no longer receive updates or security patches. This change:- Eliminates security and compatibility risks from the abandoned package
- Adopts native PHP 8 attributes as the modern standard
- Improves performance (no runtime annotation parsing overhead)
- Provides migration tooling for users to update their applications
Why Not a Major Version Update?
While this release removes doctrine/annotations, we consider it a minor version (1.13.0) rather than a major version (2.0.0) for the following reasons:
No Public API Changes
- All public interfaces, classes, and methods remain identical
- The annotation-to-attribute migration is purely a syntax change
- Existing code continues to work after applying the automated migration
Automated Migration Available
- We provide Rector configuration for one-command migration
- The migration process is safe, tested, and reversible
- Migration Guide includes comprehensive documentation and troubleshooting
Semantic Versioning Perspective
- Per semver, breaking changes are defined as incompatible API changes
- While dependencies changed, the API contract remains stable
- This follows the principle that if your code works on PHP 8.1+ with attributes, the upgrade path is clear and automated
Version Strategy
- Version 1.12.x continues to support annotations (requires doctrine/annotations)
- Version 1.13.0+ uses native PHP 8 attributes only
- Users can choose the appropriate version for their needs
Release notes
Open source →Added
- Migration Tools: Added
rector-migrate.phpfor automated annotation-to-attribute migration - Migration Guide: Added
ANNOTATION_TO_ATTRIBUTE.mdwith comprehensive migration instructions - Add CLAUDE.md with comprehensive codebase architecture and development guide
- Add marshaller configuration support for Redis with compression options (deflate)
- Add
MarshallerTypeenum for type-safe marshaller selection - Add support for
RelayClusterinRedisDsnProvider - Add Japanese README (README.ja.md)
- Add
#[Override]PHP attribute across all applicable methods and classes - Add Memcached EtagPool module with TagAwareAdapter support
- Add Redis DSN module (
StorageRedisDsnModule) with provider implementation - Add TagsPool annotation and binding to QueryRepositoryModule
- Add validation to ensure FastlyPurgeModule is installed when used
- Add Dependabot configuration
- Add PHP 8.4 support to CI workflow
- Add PHP 8.5 support to CI workflow
Changed
- PHP 8 Attributes Migration: Removed
doctrine/annotationsanddoctrine/cachedependencies, migrated to native PHP 8 attributes - Minimum PHP Version: Updated requirement from PHP 8.1 to PHP 8.2
- Update development tools: PHP_CodeSniffer to 4.0, Doctrine Coding Standard to 14.0, Slevomat Coding Standard to 8.24, PHPUnit to 11.5
- Optimize readonly class declarations for PHP 8.2 (class-level modifier)
- Improve cache attribute and interceptor documentation with usage examples
- Improve
rector-migrate.phpto support vendor installation by removing hardcoded paths - Update
ANNOTATION_TO_ATTRIBUTE.mdmigration guide following Ray.AuraSqlModule pattern - Improve marshaller provider error handling with better exception messages
- Enhance Memcached module with TagAwareAdapter support
- Update Symfony Cache to support version ^7.3
- Update
symfony/polyfill-php83dependency to^v1.32.0 - Update
mobiledetect/mobiledetectlibto support version ^4.8 - Update composer dependencies (
madapaja/twig-module,phpunit/phpunit,predis/predis,twig/twig,symfony/process) - Update
vimeo/psalmto version 6.12 - Update
ray/aopdependency to ^2.16 - Update
ray/didependency to ^2.17.2 - Set
ResourceStorageto singleton scope for better performance - Refactor
ResourceStoragewithProviderInterfacefor serialization support - Improve UriTag test coverage for consistent key generation across parameter order
- Normalize URI separators in generated cache keys for cross-platform compatibility
- Simplify ETag and surrogate key generation logic
- Handle both forward slashes and backslashes in surrogate key generation
- Sanitize ETags to replace reserved characters
- Replace symlink with actual file for cross-platform compatibility
- Enable package sorting in composer.json
- Refactor CI workflow for expanded PHP version and OS coverage
- Update copyright year to 2025
Removed
- Remove Sodium marshaller related code
- Remove
bear/fastly-modulefrom production dependencies (moved to dev dependencies) - Remove unnecessary singleton scopes from bindings
- Remove unused PSR cache annotations and RedisAdapter binding
- Remove unused MemcachedAdapter bindings
- Remove redundant
assertstatements from codebase - Remove unused dependencies from composer.json
Deprecated
- Deprecate
StorageApcModuleTest - Deprecate
StorageRedisModuleTest(useStorageRedisDsnModuleinstead) - Deprecate
StorageRedisMemcachedModule - Deprecate
BcModule - Deprecate
NamespacedCacheProviderclass - Deprecate
ResourceStorageCacheableTrait
Fixed
- Fix type casting in headers
- Fix path separator replacement for cross-platform compatibility (Windows/macOS/Linux)
- Fix typo in deprecated notice
- Fix README file extension issue
- PHP 8 Attributes Migration: Removed
-
1.12.120 Jun 2025Release notes
Open source →What's Changed
- Fix: Correct README file extension by @suzumaze in #162
- Optimize for better Windows compatibility by @koriym in #161
New Contributors
Full Changelog: 1.12.0...1.12.1
-
1.12.011 Jan 2025Release notes
Open source →What's Changed
- Fix type casting and update dependencies by @koriym in #159
- Windows: Normalize URI separators in cache key generation by @koriym in #160
Full Changelog: 1.11.1...1.12.0
-
1.11.106 Jan 2025Release notes
Open source →Bug Fix
The error that occurred when serializing the root object is fixed by making the singleton object that cannot be serialized.
シリアライズできないオブジェクトをシングルトンにしていたことで、ルートオブジェクトのシリアライズでエラーが発生していたのを修正します。
What's Changed
- Update license copyright year(s) by @github-actions in #156
- Remove unnecessary singleton scopes and update bindings by @koriym in #157
- Update dependencies and enhance compatibility by @koriym in #158
Full Changelog: 1.11.0...1.11.1
-
1.11.026 Nov 2024Nothing published for this version
-
1.10.101 Nov 2024Nothing published for this version
-
1.10.017 May 2024Nothing published for this version
-
1.9.9no date -
1.9.827 Mar 2024Nothing published for this version
-
1.9.726 Mar 2024Nothing published for this version
-
1.9.603 Sep 2023Nothing published for this version
-
1.9.518 Aug 2023Nothing published for this version
-
1.9.431 May 2023Nothing published for this version
-
1.9.309 Feb 2023Nothing published for this version
-
1.9.205 Feb 2023Nothing published for this version
-
1.9.106 Dec 2022Nothing published for this version
-
1.9.021 Nov 2022Nothing published for this version
-
1.8.613 Jul 2022Nothing published for this version
-
1.8.505 Jul 2022Nothing published for this version
-
1.8.405 Apr 2022Nothing published for this version
-
1.8.4-patch.116 Nov 2024 pre-releaseNothing published for this version
-
1.8.326 Mar 2022Nothing published for this version
-
1.8.211 Nov 2021Nothing published for this version
-
1.8.110 Nov 2021Nothing published for this version
-
1.8.006 Nov 2021Nothing published for this version
-
1.7.117 Jul 2021Nothing published for this version
-
1.7.015 Jul 2021Nothing published for this version
-
1.6.1302 May 2021Nothing published for this version
-
1.6.1202 May 2021Nothing published for this version
-
1.6.1131 Mar 2021Nothing published for this version
-
1.6.1019 Jan 2021Nothing published for this version
-
1.6.928 Sep 2020Nothing published for this version
-
1.6.802 Jun 2020Nothing published for this version
-
1.6.715 May 2020Nothing published for this version
-
1.6.604 May 2020Nothing published for this version
-
1.6.527 Mar 2020Nothing published for this version
-
1.6.408 Aug 2019Nothing published for this version
-
1.6.331 Jan 2019Nothing published for this version
-
1.6.207 Nov 2018Nothing published for this version
-
1.6.123 Oct 2018Nothing published for this version
-
1.6.023 Oct 2018Nothing published for this version
-
1.5.630 Sep 2018Nothing published for this version
-
1.5.526 May 2018Nothing published for this version
-
1.5.426 May 2018Nothing published for this version
-
1.5.325 May 2018Nothing published for this version
-
1.5.224 May 2018Nothing published for this version
-
1.5.123 May 2018Nothing published for this version
-
1.5.015 May 2018Nothing published for this version
-
1.4.712 May 2018Nothing published for this version
-
1.4.612 May 2018Nothing published for this version
-
1.4.527 Mar 2018Nothing published for this version
-
1.4.419 Mar 2018Nothing published for this version
-
1.4.306 Feb 2018Nothing published for this version
-
1.4.213 Aug 2017Nothing published for this version