add the server roots and version info hash to apcu prefix

fixes collissions when more than one instance is running on the same
system

For the memcaches we use a more complex prefix, where version and
instance ID are incorporated. We do not have this data at hand at this
point of time. But we can get the mtime of the version.php file
relatively cheap.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2023-04-20 23:10:34 +02:00 committed by Julius Härtl
parent 256f48a48c
commit bc6f7af091
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -598,7 +598,7 @@ class OC {
// Add default composer PSR-4 autoloader
self::$composerAutoloader = require_once OC::$SERVERROOT . '/lib/composer/autoload.php';
self::$composerAutoloader->setApcuPrefix('composer_autoload');
self::$composerAutoloader->setApcuPrefix('composer_autoload_' . md5(OC::$SERVERROOT . '_' . filemtime(OC::$SERVERROOT . '/version.php')));
try {
self::initPaths();