2018-11-17 16:10:38 +03:00
|
|
|
<?php
|
2019-10-05 18:26:10 +03:00
|
|
|
|
2018-11-17 16:10:38 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-08-07 15:17:15 +03:00
|
|
|
use Shlinkio\Shlink\Common\Cache\RedisFactory;
|
2019-08-07 18:37:24 +03:00
|
|
|
use Shlinkio\Shlink\Common\Lock\RetryLockStoreDelegatorFactory;
|
2019-08-08 14:42:14 +03:00
|
|
|
use Shlinkio\Shlink\Common\Logger\LoggerAwareDelegatorFactory;
|
2018-11-17 16:10:38 +03:00
|
|
|
use Symfony\Component\Lock;
|
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'locks' => [
|
|
|
|
'locks_dir' => __DIR__ . '/../../data/locks',
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'factories' => [
|
|
|
|
Lock\Store\FlockStore::class => ConfigAbstractFactory::class,
|
2019-08-07 15:17:15 +03:00
|
|
|
Lock\Store\RedisStore::class => ConfigAbstractFactory::class,
|
2018-11-17 16:10:38 +03:00
|
|
|
Lock\Factory::class => ConfigAbstractFactory::class,
|
|
|
|
],
|
2019-08-07 15:17:15 +03:00
|
|
|
'aliases' => [
|
|
|
|
// With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default
|
|
|
|
'lock_store' => Lock\Store\FlockStore::class,
|
|
|
|
'redis_lock_store' => Lock\Store\RedisStore::class,
|
|
|
|
],
|
2019-08-07 18:37:24 +03:00
|
|
|
'delegators' => [
|
|
|
|
Lock\Store\RedisStore::class => [
|
|
|
|
RetryLockStoreDelegatorFactory::class,
|
|
|
|
],
|
2019-08-08 14:42:14 +03:00
|
|
|
Lock\Factory::class => [
|
|
|
|
LoggerAwareDelegatorFactory::class,
|
|
|
|
],
|
2019-08-07 18:37:24 +03:00
|
|
|
],
|
2018-11-17 16:10:38 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
|
|
|
Lock\Store\FlockStore::class => ['config.locks.locks_dir'],
|
2019-08-07 15:17:15 +03:00
|
|
|
Lock\Store\RedisStore::class => [RedisFactory::SERVICE_NAME],
|
|
|
|
Lock\Factory::class => ['lock_store'],
|
2018-11-17 16:10:38 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|