mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Moved class alias to container.php to avoid it from being lost after configuration is cached
This commit is contained in:
parent
3479bbbb36
commit
35f5f4851e
2 changed files with 2 additions and 1 deletions
|
@ -10,7 +10,6 @@ use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|||
|
||||
// This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name
|
||||
$localLockFactory = 'Shlinkio\Shlink\LocalLockFactory';
|
||||
class_alias(Lock\Factory::class, $localLockFactory);
|
||||
|
||||
return [
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
use Symfony\Component\Lock;
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
|
||||
chdir(dirname(__DIR__));
|
||||
|
@ -18,6 +19,7 @@ if (class_exists(Dotenv::class)) {
|
|||
}
|
||||
|
||||
// Build container
|
||||
class_alias(Lock\Factory::class, 'Shlinkio\Shlink\LocalLockFactory');
|
||||
$config = require __DIR__ . '/config.php';
|
||||
$container = new ServiceManager($config['dependencies']);
|
||||
$container->setService('config', $config);
|
||||
|
|
Loading…
Add table
Reference in a new issue