Skip to content

Commit

Permalink
Force query cache to not persist between requests
Browse files Browse the repository at this point in the history
(fix #1534)
  • Loading branch information
zerocrates committed Apr 21, 2020
1 parent b85b9aa commit d9e26e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/src/Service/EntityManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ public function __invoke(ContainerInterface $serviceLocator, $requestedName, arr
$isDevMode = self::IS_DEV_MODE;
}

$arrayCache = new ArrayCache();
if (extension_loaded('apcu') && !$isDevMode) {
$cache = new ApcuCache();
} else {
$cache = new ArrayCache();
$cache = $arrayCache;
}

// Set up the entity manager configuration.
Expand All @@ -64,6 +65,10 @@ public function __invoke(ContainerInterface $serviceLocator, $requestedName, arr
);
$emConfig->setProxyDir(OMEKA_PATH . '/application/data/doctrine-proxies');

// Force non-persistent query cache, workaround for issue with SQL filters
// that vary by user, permission level
$emConfig->setQueryCacheImpl($arrayCache);

// Use the underscore naming strategy to preempt potential compatibility
// issues with the case sensitivity of various operating systems.
// @see http://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html
Expand Down

0 comments on commit d9e26e4

Please sign in to comment.