Releases: infocyph/InterMix
Releases · infocyph/InterMix
7.0
🎯 Major Overhaul – Simplified Architecture
InterMix 7.0 represents a significant refinement, removing built-in cache and memoization modules while strengthening the DI container and adding production-grade security & testing infrastructure.
✨ Key Changes
1. Cache Layer Removed (Delegation Model)
- Removed: All
Cache,CacheAdapter, andCacheItemclasses - Why: Better separation of concerns; external PSR-6 implementations (e.g.,
infocyph/cachelayer) are now recommended - Migration: Use any PSR-6 pool directly via
enableDefinitionCache($pool)on the definition manager - New Interface:
DefinitionCachePoolInterfaceandPsr6DefinitionCachePoolAdapterfor seamless PSR-6 integration
2. Memoization Removed
- Removed:
Memoizerclass,MemoizeTrait, and globalmemoize()/remember()functions - Why: In-process memoization is less critical with modern cache solutions and adds unnecessary complexity
- Migration: Use container scopes, PSR-6 caches, or implement object-level caching as needed
3. Global Function Removals
- Removed:
once(),sanitize_cache_ns()functions - Reason: Limited use; DI container resolution covers most once-patterns more robustly
4. DI Container – Improved Definition Caching
- Now PSR-6 Native: Definition cache is assigned via an external PSR-6 pool
- Better Hash Stability: Uses
xxh128(or fallbacksha256) instead ofxxh3for portable cache keys - Syntax Change:
// Old (6.0): $c->definitions()->enableDefinitionCache('intermix'); // New (7.0): $c->definitions()->enableDefinitionCache($pool); // PSR-6 pool
5. Security & Signing
- Payload Signing:
ValueSerializernow supports HMAC-SHA256 signing for untrusted payloadsValueSerializer::setPayloadSigningKey($_ENV['INTERMIX_SIGNING_KEY']);
- CI/CD Integration: Composer audit guard, Psalm deep taint analysis, SARIF upload to GitHub CodeQL
6. Testing & Quality
- Pest 4.5 + Drift plugin for flaky test detection
- PHPStan 2.1 with cognitive complexity rules
- Psalm 6.16 with security analysis and taint tracking
- PHPBench 1.6: Modern benchmarking with attribute-based setup
composer benchmark # Modern PHPBench suite - PHP CodeSniffer 4.0: Semantic code quality checks
7. Dev Tool Updates
- Pint: Changed preset from
psr12toper(Psr12 Extended Rules) - Rector 2.4: Updated for PHP 8.3+ compatibility
- Squiz PHP CodeSniffer: Forbids debug functions (
dd(),dump(),var_dump()) in committed code
8. Documentation Restructure
- Removed: Entire cache adapters documentation (APCu, File, Memcached, Redis, SQLite)
- Removed: Memoization guide
- Updated: DI definition cache now references PSR-6 instead of file-based cache
- New: Payload signing documentation in
ValueSerializerreference
9. Benchmark Refresh
- Old:
benchmark/intermix_benchmark.php(script-based) - New:
benchmarks/IntermixBench.php(attribute-based with PHPBench) - More scenarios covered: method wiring, property injection, scoped resolution, tagged lookup, service providers
10. Configuration Files
- Added:
phpstan.neon.dist,phpcs.xml.dist,phpbench.json - Updated:
pest.xml(now full PHPUnit config format compatible with Pest CLI) - Updated:
rector.php(uses newRectorConfigAPI withwithPhpVersion())
11. License Update
- Copyright changed from "A. B. M. Mahmudul Hasan" to "Infocyph"
🔄 Breaking Changes Summary
| Item | 6.0 | 7.0 | Migration |
|---|---|---|---|
| Cache classes | Built-in | Removed | Use PSR-6 package |
| Memoizer | Memoizer::instance() |
Removed | Use DI scopes/PSR-6 |
once() function |
Available | Removed | Implement custom or use DI |
enableDefinitionCache() |
Takes namespace string | Takes PSR-6 pool | Pass CacheItemPoolInterface |
| Payload signing | N/A | setPayloadSigningKey() |
Optional; recommended for untrusted input |
| PHP minimum | 8.2 | 8.3 | Upgrade PHP to 8.3+ |
📊 Performance & Production Readiness
- Enhanced Reflection Caching: Parameter resolution plans now cached and bounded by memory limits
- Faster Singleton Path: Optimized hot-path for
get()operations - Scope-Aware Cleanup: Better memory management with scoped lifetime tracking
- Security Scanning: Integrated Psalm taint analysis + SARIF upload for GitHub CodeQL
🛠️ Composer Scripts
New/updated commands:
composer test:syntax # PHP syntax check
composer test:code # Pest (unit/integration tests)
composer test:lint # Pint formatting check
composer test:sniff # PHP CodeSniffer semantic checks
composer test:static # PHPStan static analysis
composer test:security # Psalm deep security analysis
composer test:refactor # Rector dry-run
composer test:all # Run all checks in parallel
composer release:audit # Enhanced CVE check (non-blocking for abandoned)
composer benchmark # PHPBench suite📖 What to Read First
- DI Container Users: See
docs/di/cache.rstfor PSR-6 pool integration - Security-Conscious: Check
SECURITY.mdfor payload signing and Psalm integration - Package Maintainers: Review
composer.jsonfor updated dependencies and new suggestions - Benchmarking: Use
composer benchmarkorcomposer bench:quickfor profiling
✅ Recommended Upgrade Path
- Update PHP to 8.3+ (if not already)
- Remove cache usage from code; replace with PSR-6 or scoped DI
- Remove memoization calls; use container registration or direct caching
- Update cache enablement:
// Install a PSR-6 package (e.g., infocyph/cachelayer) $pool = /* your PSR-6 pool */; $container->definitions()->enableDefinitionCache($pool);
- Run tests with new Pest 4.5 + PHPBench
- Optionally enable signing for untrusted payloads
Ready for production with enterprise-grade security, testing, and performance profiling. 🚀
6.00
New & Enhanced Features
1. Performance Optimizations
- Parameter Resolution Planning Cache – Caches resolution plans for constructor/method/property paths to reduce reflection overhead
- Improved Singleton Resolution – Fast-path optimizations for singleton
get()operations - Scope-Aware Caching –
setResolvedScoped()tracks resolved entries per scope for efficient cleanup - Bounded Memoization – Resolution and attribute plan caches respect memory limits
2. Advanced Container Features
- Environment-Aware Tag Indexing – Tags can be overridden per environment via
setDefinitionMetaForEnv() - Tag Query Optimization –
getIdsByTag()with environment awareness for dynamic tag resolution - Enhanced Tracing Control –
enableDebugTracing(false)now sets level toTraceLevelEnum::Off(fully disabled) - Repository API Improvements – New accessor methods:
getDefinitionLifetime(),getFunctionDefinition(),getResolvedEntry(),getClassResourceFor()
3. Security & Analysis
- Psalm Integration – Deep security analysis with taint tracking for SQL, shells, HTML, XPath, and eval injection
- SARIF Upload Support – Automatic upload of security scan results to GitHub CodeQL
- Enhanced Composer Audit – CVE checking as part of CI/CD pipeline
4. Testing & Quality
- Pest Framework 4.4 – Modern PHP testing with parallel execution
- Pest Drift Plugin – Detects flaky tests with
pest/pest-plugin-drift - Improved Test Configuration – Dedicated
pest.xmlfor Pest CLI compatibility - Performance Benchmarking – New
benchmark/intermix_benchmark.phpwith progress tracking
5. Documentation Expansion
- "Why I Built InterMix" Page – Historical context and design philosophy
- Benchmarking Guide – Container performance metrics and environment tuning
- Global Functions Reference –
container(),resolve(),direct(),tap(),when(), and more - Updated Feature Set – Cache, Serializer, Remix, Memoizer, Fence, MacroMix modules
Breaking Changes
- PHP 8.3+ Required – Minimum version upgraded from 8.2
- Parameter Value Caching – Now limited to constructor paths only; method calls maintain fresh behavior
- Scoped Lifetime Tracking – Resolved entries tracked per scope for better memory management
- Repository Accessor API – New safety methods (
getResolvedEntry(),hasResolved(),getDefinitionLifetime())
Ready for production with enhanced performance, security scanning, and modern testing infrastructure.
5.35.1
What's Changed
- docs update by @abmmhasan in #100
- docs by @abmmhasan in #101
Full Changelog: 5.35...5.35.1
5.35
🚀 Major Features
Cache Enhancement Suite
- Cache Stampede Protection - Compute-once semantics with host-local file locking and jittered TTL to prevent thundering herd
- Tag-Based Invalidation - Associate multiple keys with tags and invalidate them together
- Remember Pattern -
remember(key, resolver, ttl, tags)for optimized cache-aside with stampede protection
Container Scope Management
- Named Scopes -
enterScope(),leaveScope(),withinScope()for request/fiber isolation - Dependency Graph Export -
exportGraph()for visualization and debugging - Environment-Specific Metadata - Override lifetime and tags per environment
Refactored Resolvers
- Abstracted Cache Adapters - Common base class for all adapter implementations
- Parameter Resolution Concerns - Separated into
ResolvesAssociativeParameters,ResolvesNumericAndVariadicParameters,ResolvesParameterAttributestraits - Enhanced Tracing - Dependency graph recording with
recordDependency()
🔧 Technical Improvements
- PHP 8.3+ minimum requirement (upgraded from 8.2)
- Bounded memoization caches to prevent memory exhaustion
- Better cache payload codec for transparent serialization
- Improved property resolution with skip-logic optimization
- Enhanced fence with requirement checking refactor
📦 Dependencies Updated
- Pest 4.4 (was 3.7)
- Pint 1.29 (was 1.20)
- Rector 2.3 (was 2.0)
- Opis Closure 4.5 (was 4.3)
- Added symfony/polyfill-mbstring 1.33 for better output formatting
🎯 Breaking Changes
- Minimum PHP version is now 8.3 (was 8.2)
- Cache adapters now extend
AbstractCacheAdapter Lifetimeconstants renamed toLifetimeEnum(enum-based)TraceLevelrenamed toTraceLevelEnum
📋 Full Changelog
5.34.02
What's Changed
- feat(rtd): updated by @abmmhasan in #90
- feat(rtd): updated by @abmmhasan in #91
- feat(rtd): updated by @abmmhasan in #92
- feat(rtd): updated docs by @abmmhasan in #93
- Feature/di update by @abmmhasan in #94
Full Changelog: 5.34.1...5.34.02
5.34.1
5.34
What's Changed
- feat(di-less): added additional functions by @abmmhasan in #88
Full Changelog: 5.33.11...5.34
5.33.1
5.33
What's Changed
- feat(optimization): debugger by @abmmhasan in #83
- feat(optimization): container getter by @abmmhasan in #84
- Feature/di update by @abmmhasan in #85
Full Changelog: 5.32.1...5.33