Skip to content

Commit

Permalink
use cache exception for issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mikespub committed Aug 24, 2024
1 parent 626140e commit 28b1982
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions config/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Cache\Adapter\ApcuAdapter;
use Symfony\Component\Cache\Adapter\ChainAdapter;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Exception\CacheException;

//$container = new Container();
$builder = new \DI\ContainerBuilder();
Expand All @@ -36,10 +36,11 @@
return new \BicBucStriim\Utilities\Logger();
},
CacheItemPoolInterface::class => function (ContainerInterface $c) {
return new ChainAdapter([
new ApcuAdapter('BicBucStriim', 3600),
new FilesystemAdapter('BicBucStriim', 3600),
]);
try {
return new ApcuAdapter('BicBucStriim', 3600);
} catch (CacheException $e) {
return new FilesystemAdapter('BicBucStriim', 3600);
}
},
Session::class => 'depends on request - see login middleware',
Auth::class => 'depends on request - see login middleware',
Expand Down

0 comments on commit 28b1982

Please sign in to comment.