shlink/config/container.php

25 lines
650 B
PHP
Raw Normal View History

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