Skip to content

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Jun 25, 2025

Currently we have ORMSetup::create*Configuration methods with a
$proxyDir argument that is used to configure the proxy directory, but
also as a seed for generating a namespace for cache systems.

Since these methods could be used with named arguments, renaming the
argument is not really an option and we need separate methods.

@greg0ire
Copy link
Member Author

It seems that $proxyDir is used to derive a namespace for some cache implementations:

orm/src/ORMSetup.php

Lines 104 to 119 in 92e2f6d

$namespace = 'dc2_' . md5($proxyDir);
if (extension_loaded('apcu') && apcu_enabled()) {
return new ApcuAdapter($namespace);
}
if (MemcachedAdapter::isSupported()) {
return new MemcachedAdapter(MemcachedAdapter::createConnection('memcached://127.0.0.1'), $namespace);
}
if (extension_loaded('redis')) {
$redis = new Redis();
$redis->connect('127.0.0.1');
return new RedisAdapter($redis, $namespace);
}

Not sure what should become of this 🤔

Should we use the same namespace all the time, or should we rename $proxyDir to $cacheNamespaceSeed? It would seem that $proxyDir was reused for convenience because you want to change both things every time you deploy.

@greg0ire greg0ire marked this pull request as draft June 25, 2025 21:34
@greg0ire
Copy link
Member Author

should we rename $proxyDir to $cacheNamespaceSeed?

I went with this solution.

@greg0ire greg0ire force-pushed the depr-proxy-dir branch 2 times, most recently from c1cd685 to fe9a1de Compare June 25, 2025 22:10
Currently we have ORMSetup::create*Configuration methods with a
$proxyDir argument that is used to configure the proxy directory, but
also as a seed for generating a namespace for cache systems.

Since these methods could be used with named arguments, renaming the
argument is not really an option and we need separate methods.
@greg0ire greg0ire marked this pull request as ready for review June 26, 2025 05:39
@greg0ire greg0ire added this to the 3.5.0 milestone Jun 27, 2025
@greg0ire greg0ire merged commit 60ff966 into doctrine:3.5.x Jun 27, 2025
86 checks passed
@greg0ire greg0ire deleted the depr-proxy-dir branch June 27, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants