mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
update
This commit is contained in:
parent
0ee286ce27
commit
646a626019
@ -10,24 +10,20 @@ declare(strict_types=1);
|
||||
namespace Chill\WopiBundle\Controller;
|
||||
|
||||
use Chill\WopiBundle\Service\OpenStack\OpenStackClientInterface;
|
||||
use OpenStack\OpenStack;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class Test
|
||||
{
|
||||
private OpenStackClientInterface $client;
|
||||
|
||||
private OpenStack $osClient;
|
||||
|
||||
public function __construct(OpenStackClientInterface $client, OpenStack $osClient)
|
||||
public function __construct(OpenStackClientInterface $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->osClient = $osClient;
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
dump($this->osClient);
|
||||
dump($this->client);
|
||||
|
||||
return new Response('fobar');
|
||||
}
|
||||
|
@ -23,17 +23,7 @@ final class ChillWopiExtension extends Extension
|
||||
$container
|
||||
->setParameter(
|
||||
'chill_wopi',
|
||||
$this->processConfiguration(new Configuration(), $configs)
|
||||
);
|
||||
|
||||
|
||||
var_dump($config);
|
||||
|
||||
|
||||
$container
|
||||
->setParameter(
|
||||
'chill_wopi.openstack_client',
|
||||
$config['openstack']
|
||||
$config
|
||||
);
|
||||
|
||||
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
|
||||
|
@ -21,14 +21,9 @@ return static function (ContainerConfigurator $container) {
|
||||
->autoconfigure();
|
||||
|
||||
$services
|
||||
->load('ChampsLibres\\WopiTestBundle\\Service\\', __DIR__ . '/../../Service');
|
||||
->load('Chill\\WopiBundle\\Service\\', __DIR__ . '/../../Service');
|
||||
|
||||
$services
|
||||
->load('Chill\\WopiBundle\\Controller\\', __DIR__ . '/../../Controller')
|
||||
->tag('controller.service_arguments');
|
||||
|
||||
$services
|
||||
->set('chill_wopi.openstack_client')
|
||||
->class(OpenStack::class)
|
||||
->arg('$options', '%chill_wopi.openstack_client%');
|
||||
};
|
||||
|
@ -1,10 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\WopiBundle\Service\OpenStack;
|
||||
|
||||
use OpenStack\OpenStack;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
|
||||
final class Client extends OpenStack implements OpenStackClientInterface
|
||||
{
|
||||
private ParameterBagInterface $parameterBag;
|
||||
|
||||
public function __construct(ParameterBagInterface $parameterBag)
|
||||
{
|
||||
$configuration = $parameterBag->get('chill_wopi');
|
||||
|
||||
parent::__construct($configuration['openstack']);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\WopiBundle\Service\OpenStack;
|
||||
|
||||
interface OpenStackClientInterface
|
||||
|
Loading…
x
Reference in New Issue
Block a user