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