⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
shopware
/
vendor
/
enqueue
/
enqueue
/
Doctrine
/
View File Name :
DoctrineConnectionFactoryFactory.php
<?php namespace Enqueue\Doctrine; use Doctrine\Persistence\ManagerRegistry; use Enqueue\ConnectionFactoryFactoryInterface; use Enqueue\Dbal\ManagerRegistryConnectionFactory; use Enqueue\Dsn\Dsn; use Interop\Queue\ConnectionFactory; class DoctrineConnectionFactoryFactory implements ConnectionFactoryFactoryInterface { /** * @var ManagerRegistry */ private $doctrine; /** * @var ConnectionFactoryFactoryInterface */ private $fallbackFactory; public function __construct(ManagerRegistry $doctrine, ConnectionFactoryFactoryInterface $fallbackFactory) { $this->doctrine = $doctrine; $this->fallbackFactory = $fallbackFactory; } public function create($config): ConnectionFactory { if (is_string($config)) { $config = ['dsn' => $config]; } if (false == is_array($config)) { throw new \InvalidArgumentException('The config must be either array or DSN string.'); } if (false == array_key_exists('dsn', $config)) { throw new \InvalidArgumentException('The config must have dsn key set.'); } $dsn = Dsn::parseFirst($config['dsn']); if ('doctrine' === $dsn->getScheme()) { $config = $dsn->getQuery(); $config['connection_name'] = $dsn->getHost(); return new ManagerRegistryConnectionFactory($this->doctrine, $config); } return $this->fallbackFactory->create($config); } }