Skip to content

Releases: infocyph/InterMix

7.0

13 Apr 08:03
022e908

Choose a tag to compare

🎯 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, and CacheItem classes
  • 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: DefinitionCachePoolInterface and Psr6DefinitionCachePoolAdapter for seamless PSR-6 integration

2. Memoization Removed

  • Removed: Memoizer class, MemoizeTrait, and global memoize() / 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 fallback sha256) instead of xxh3 for 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: ValueSerializer now supports HMAC-SHA256 signing for untrusted payloads
    ValueSerializer::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 psr12 to per (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 ValueSerializer reference

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 new RectorConfig API with withPhpVersion())

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

  1. DI Container Users: See docs/di/cache.rst for PSR-6 pool integration
  2. Security-Conscious: Check SECURITY.md for payload signing and Psalm integration
  3. Package Maintainers: Review composer.json for updated dependencies and new suggestions
  4. Benchmarking: Use composer benchmark or composer bench:quick for profiling

Recommended Upgrade Path

  1. Update PHP to 8.3+ (if not already)
  2. Remove cache usage from code; replace with PSR-6 or scoped DI
  3. Remove memoization calls; use container registration or direct caching
  4. Update cache enablement:
    // Install a PSR-6 package (e.g., infocyph/cachelayer)
    $pool = /* your PSR-6 pool */;
    $container->definitions()->enableDefinitionCache($pool);
  5. Run tests with new Pest 4.5 + PHPBench
  6. Optionally enable signing for untrusted payloads

Ready for production with enterprise-grade security, testing, and performance profiling. 🚀

6.00

03 Apr 13:48
f573c27

Choose a tag to compare

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 CachingsetResolvedScoped() 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 OptimizationgetIdsByTag() with environment awareness for dynamic tag resolution
  • Enhanced Tracing ControlenableDebugTracing(false) now sets level to TraceLevelEnum::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.xml for Pest CLI compatibility
  • Performance Benchmarking – New benchmark/intermix_benchmark.php with 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 Referencecontainer(), 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

20 Mar 17:34
f3d3d37

Choose a tag to compare

What's Changed

Full Changelog: 5.35...5.35.1

5.35

20 Mar 16:31
1cd971b

Choose a tag to compare

🚀 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, ResolvesParameterAttributes traits
  • 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
  • Lifetime constants renamed to LifetimeEnum (enum-based)
  • TraceLevel renamed to TraceLevelEnum

📋 Full Changelog

See git compare

5.34.02

08 Oct 09:30
cb32c50

Choose a tag to compare

What's Changed

Full Changelog: 5.34.1...5.34.02

5.34.1

22 Sep 16:28
05899eb

Choose a tag to compare

What's Changed

Full Changelog: 5.34...5.34.1

5.34

02 Sep 11:05
c8f396e

Choose a tag to compare

What's Changed

Full Changelog: 5.33.11...5.34

5.33.1

20 Aug 10:44
34473f9

Choose a tag to compare

What's Changed

Full Changelog: 5.33...5.33.1

5.33

30 Jul 07:09
c539b35

Choose a tag to compare

What's Changed

Full Changelog: 5.32.1...5.33

5.32.1

24 Jul 08:18
81f9f6b

Choose a tag to compare

What's Changed

Full Changelog: 5.32...5.32.1