Releases: josbeir/cakephp-attribute-registry
0.5.0
🎉 Major Improvements
Simplified Object Serialization with brick/varexporter
- Replaced native
var_export()with brick/varexporter - Breaking Change: Objects no longer require
__set_state()method - Object arguments now serialize automatically via reflection
Typed Event Classes
- Introduced dedicated event classes with full type safety
- Better IDE autocomplete and static analysis support
- New event classes:
BeforeDiscoverEvent,AfterDiscoverEventBeforeScanEvent,AfterScanEventBeforeCacheClearEvent,AfterCacheClearEvent
- Each event has a
NAMEconstant and typed accessor methods
📦 Dependencies
- Added:
brick/varexporter: ^0.7.0
📝 Migration Guide
For existing users: No action required. The changes are backward compatible. If you have objects with __set_state() methods in attribute arguments, they will continue to work but the method is no longer necessary.
0.4.1
🚀 Performance Improvements
Path Resolution Optimization (3.2-3.4x faster)
Completely refactored the path resolution system to significantly improve scanning performance:
- Unified Iterator Approach: Replaced mixed glob()/RecursiveDirectoryIterator approach with single
RecursiveCallbackFilterIteratorpattern - Filter During Traversal: Exclusion logic now filters paths during directory traversal instead of after, avoiding unnecessary filesystem operations
- Performance Gain: 3.2-3.4x faster path resolution (68.8-70.9% time saved) on typical projects with excluded directories like vendor and tmp
- Early Directory Skipping: Excluded directories are now completely skipped during traversal, not just filtered afterward
0.4.0
New Features
Event System (#7)
- Added event dispatching throughout attribute discovery and caching lifecycle
- 6 new events:
beforeDiscover/afterDiscover- Around complete discovery processbeforeScan/afterScan- Around file scanning (when not cached)beforeCacheClear/afterCacheClear- Around cache clearing operations
Breaking Changes
File Modification Time Instead of Content Hashing
AttributeInfo::$fileHash(string) →AttributeInfo::$fileTime(int)- Removed
HashUtilityclass - no longer using xxh3 hashing - Cache validation now uses
filemtime()instead of hashing file contents
Why This Change?
- Faster: No hash computation overhead
- Simpler: Native PHP
filemtime()vs custom hashing - Sufficient: File modification time detects changes just as reliably
0.3.0
New Features
-
HashUtility: Centralized hashing utility for consistent xxh3 hashing across plugin (#6)
- Single source of truth for hash algorithm
- Cleaner API with
HashUtility::hash()andHashUtility::hashFile() - Full test coverage (10 tests)
-
Cache Validation: New cache integrity validation system (#5)
AttributeCacheValidatorservice validates cached attribute filesAttributeCacheValidationResultvalue object for validation results--validateoption in cache command to verify cache integrity- File existence and hash mismatch detection
Improvements
-
Commands Refactored (#5):
- Renamed to plural forms:
attributes:cache,attributes:inspect,attributes:list - Former
attribute:discoveris nowattributes:cache - Added
--no-clearand--clear-onlyoptions to cache command
- Renamed to plural forms:
-
PathResolver Simplification:
- Now accepts
PluginLocatordirectly instead of Closure callback - Cleaner API, easier to understand
- Lazy loading behavior preserved
- Now accepts
-
Internal Improvements:
- Simplified cache key constant (
CACHE_KEYvsREGISTRY_CACHE_KEY_ALL) - Refactored test helpers to
AttributeRegistryTestTrait - Updated PathResolver test names for clarity
- Improved code coverage across all components
- Simplified cache key constant (
0.2.1
0.2.0
Release 0.2.0
Major Improvements
Zero-Cost Compiled Cache
- Replaced runtime cache with pre-compiled PHP files for OPcache optimization
- Added xxh3 file hash validation for smart cache invalidation
- Cache files are now pure PHP that gets opcached by the server
Smart Cache Validation
- Optional file hash validation detects changes automatically
- Only invalidates modified files (granular invalidation)
- Configure with
'validateFiles' => Configure::read('debug')for dev-only validation - Uses xxh3 algorithm for extremely fast file hashing
Configuration Management
- Plugin config properly merges with user settings (user values take precedence)
- Sequential arrays replace, associative arrays merge recursively
Command Improvements
- Integrated with
cache:clear_allcommand
Bug Fixes
- Plugin configuration no longer overwrites user settings
- Fixed plugin path resolution to include all loaded plugins
- Windows compatibility improvements
- Proper handling of
__set_state()in cached objects
Full Changelog: 0.1.3...0.2.0
0.1.3
Features
Atomic Plugin Discovery
- All enabled plugins (including CLI-only and local plugins) are now scanned regardless of request context (CLI vs web)
- Introduces
PluginPathResolverto retrieve paths for all configured plugins, ensuring consistent attribute discovery across environments
AttributeCollection Query API
- New fluent collection interface for filtering and querying discovered attributes
- Methods:
attribute(),namespace(),targetType(),className(),attributeContains(),classNameContains() - Fully compatible with CakePHP Collection operations (map, filter, groupBy, etc.)
Full Changelog: 0.1.2...0.1.3
0.1.2
New features
- Add support for parameter attributes
- Add support for constant attributes
- Improve docs
Full Changelog: 0.1.1...0.1.2