@@ -115,6 +115,7 @@ public function __construct(
115115 protected function getGlobalPrefix (): string {
116116 if ($ this ->globalPrefix === null ) {
117117 $ config = Server::get (SystemConfig::class);
118+ $ customprefix = $ config ->getValue ('memcache_customprefix ' , '' );
118119 $ maintenanceMode = $ config ->getValue ('maintenance ' , false );
119120 $ versions = [];
120121 if ($ config ->getValue ('installed ' , false ) && !$ maintenanceMode ) {
@@ -131,7 +132,7 @@ protected function getGlobalPrefix(): string {
131132 // Include instanceid in the prefix, in case multiple instances use the same cache (e.g. same FPM pool)
132133 $ instanceid = $ config ->getValue ('instanceid ' );
133134 $ installedApps = implode (', ' , array_keys ($ versions )) . implode (', ' , array_values ($ versions ));
134- $ this ->globalPrefix = hash ('xxh128 ' , $ instanceid . $ installedApps );
135+ $ this ->globalPrefix = $ customprefix . hash ('xxh128 ' , $ instanceid . $ installedApps );
135136 }
136137 return $ this ->globalPrefix ;
137138 }
@@ -145,9 +146,11 @@ protected function getGlobalPrefix(): string {
145146 public function withServerVersionPrefix (\Closure $ closure ): void {
146147 $ backupPrefix = $ this ->globalPrefix ;
147148
149+ $ config = Server::get (SystemConfig::class);
150+ $ customprefix = $ config ->getValue ('memcache_customprefix ' , '' );
148151 // Include instanceid in the prefix, in case multiple instances use the same cache (e.g. same FPM pool)
149- $ instanceid = Server:: get (SystemConfig::class) ->getValue ('instanceid ' );
150- $ this ->globalPrefix = hash ('xxh128 ' , $ instanceid . implode ('. ' , $ this ->serverVersion ->getVersion ()));
152+ $ instanceid = $ config ->getValue ('instanceid ' );
153+ $ this ->globalPrefix = $ customprefix . hash ('xxh128 ' , $ instanceid . implode ('. ' , $ this ->serverVersion ->getVersion ()));
151154 $ closure ($ this );
152155 $ this ->globalPrefix = $ backupPrefix ;
153156 }
0 commit comments