1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | use Laminas\ServiceManager\ServiceManager; |
||
6 | use Symfony\Component\Lock; |
||
7 | |||
8 | use const Shlinkio\Shlink\Core\LOCAL_LOCK_FACTORY; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
9 | |||
10 | chdir(dirname(__DIR__)); |
||
11 | |||
12 | require 'vendor/autoload.php'; |
||
13 | |||
14 | // This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name |
||
15 | // It needs to be placed here as individual config files will not be loaded once config is cached |
||
16 | if (! class_exists(LOCAL_LOCK_FACTORY)) { |
||
17 | class_alias(Lock\LockFactory::class, LOCAL_LOCK_FACTORY); |
||
18 | } |
||
19 | |||
20 | // Build container |
||
21 | return (function () { |
||
22 | $config = require __DIR__ . '/config.php'; |
||
23 | $container = new ServiceManager($config['dependencies']); |
||
24 | $container->setService('config', $config); |
||
25 | |||
26 | return $container; |
||
27 | })(); |
||
28 |