shlink/config/container.php

20 lines
538 B
PHP
Raw Normal View History

2016-04-10 02:52:44 -05:00
<?php
2019-10-05 10:26:10 -05:00
2017-10-12 03:13:20 -05:00
declare(strict_types=1);
use Symfony\Component\Lock;
2016-04-10 02:52:44 -05:00
use Zend\ServiceManager\ServiceManager;
2016-04-10 05:06:28 -05:00
chdir(dirname(__DIR__));
2016-04-17 13:27:24 -05:00
require 'vendor/autoload.php';
2016-04-10 02:52:44 -05:00
2019-12-23 04:00:38 -06:00
// This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name
2019-12-23 04:13:32 -06:00
class_alias(Lock\LockFactory::class, 'Shlinkio\Shlink\LocalLockFactory');
2019-12-23 04:00:38 -06:00
2016-04-10 02:52:44 -05:00
// Build container
$config = require __DIR__ . '/config.php';
$container = new ServiceManager($config['dependencies']);
2016-04-10 02:52:44 -05:00
$container->setService('config', $config);
2016-04-17 13:27:24 -05:00
return $container;