Optimize cache storage layout for PSR-4/PSR-0 compatibility#574
Merged
Conversation
Remove the _proxies subdirectory and flatten the cache layout so proxy files reside at their PSR-4-compliant path (derived from the original file location) directly in the cache root. Transformed source files (containing __AopProxied traits) now use a filename that matches the entity name, enabling the cache directory to be registered as a Composer PSR-4/PSR-0 autoload root. Cache path formulas: - Proxy: <cacheDir>/<relativePath> (standard, same as original) - Trait: <cacheDir>/<relativePath>__AopProxied.php (suffix applied when transformed source contains AOP_PROXIED_SUFFIX) - Reverse: strip __AopProxied suffix, remap cacheDir→appDir Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_proxiessubdirectory from the cache — proxy class files now reside at their standard PSR-4-compliant path directly in the cache root__AopProxiedtraits are named after the entity they contain (e.g.Foo__AopProxied.php), enabling the cache directory to be registered as a Composer PSR-4/PSR-0 autoload rootMagicConstantTransformer::resolveFileName()by replacing the old_proxies-stripping logic with a directcacheDir→appDirremap plus__AopProxiedsuffix removalCachingTransformerdetects woven sources viaAOP_PROXIED_SUFFIXpresence and adjusts the write path formulaically_functions/subdirectory is left untouched for a future task__AopProxiedsibling)Test plan
src/ortests/bin/goaop cache:warmupand verify no_proxiesdirectory created🤖 Generated with Claude Code