-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProxyGenerator: do not generate long file names #1005
base: 3.4.x
Are you sure you want to change the base?
Conversation
We're currently sunsetting the Common library including the proxy implementation. This is why I'm a bit reluctant to introduce this kind of change into the codebase at this point. Furthermore, this is not a bugfix but rather a workaround for a very arbitrary limitation of the filesystem that you are using. Can you elaborate what you use proxies for? Have you tried to work around the issue without changing doctrine/common? |
I'm using proxies as part of doctrine/orm.
Yes, but there is no easy way to use custom logic for naming proxies, because |
@JanTvrdik on PHP 8.1 and newer, the ORM has a new proxy implementation (currently opt-in) that is based on the trait provided by symfony/var-exporter. However, I think the new code in Doctrine\ORM\Proxy\ProxyFactory in doctrine/orm 2.17.x uses the same naming convention for files and so would suffer from the same issue. |
@derrabus IMO, we should still do a bugfix in doctrine to avoid generating file names of arbitrary lengh. All filesystems have such limitations (it is just that eCryptfs has a max file name length that is but shorter than ext4 so it is easier to reach it). See https://bugs.launchpad.net/ecryptfs/+bug/344878/comments/10 for a comment in the ecryptfs explaining that. The current file name generating takes the FQCN of the entity and uses that as part of the file name as is. This could even reach the ext4 limit if the FQCN is long enough. However, I'm not sure spreading generated proxies in subfolder is the right approach to fix this. |
Then let's start with the ORM please. ORM 2.17 with recommended settings will bypass whatever we change in doctrine/common anyway. |
414ccd0
to
8136e31
Compare
The maximum file name length when using eCryptfs is 143 bytes. This causes issues with Doctrine proxies where with current implementation this limit can be exceeded.
This PR changes how proxy file name is generated to avoid hitting this limit.