* client init factory fixed
This commit is contained in:
parent
06a3f22f59
commit
1a5bc26ba6
@ -4,6 +4,7 @@ namespace App;
|
|||||||
|
|
||||||
use Interop\Container\ContainerInterface;
|
use Interop\Container\ContainerInterface;
|
||||||
use Zend\Cache\Storage\Adapter\Filesystem as FilesytemCache;
|
use Zend\Cache\Storage\Adapter\Filesystem as FilesytemCache;
|
||||||
|
use Zend\Cache\Storage\StorageInterface;
|
||||||
use Zend\Config\Config;
|
use Zend\Config\Config;
|
||||||
use Zend\Http\Client;
|
use Zend\Http\Client;
|
||||||
|
|
||||||
@ -49,7 +50,7 @@ class ConfigProvider
|
|||||||
Service\AvatarService::class => Service\AvatarServiceFactory::class,
|
Service\AvatarService::class => Service\AvatarServiceFactory::class,
|
||||||
Service\DataCollectorService::class => Service\DataCollectorServiceFactory::class,
|
Service\DataCollectorService::class => Service\DataCollectorServiceFactory::class,
|
||||||
|
|
||||||
'service.avatarCache' => function(ContainerInterface $container) {
|
'service.avatarCache' => function(ContainerInterface $container): StorageInterface {
|
||||||
$cache = new FilesytemCache();
|
$cache = new FilesytemCache();
|
||||||
$cache->getOptions()
|
$cache->getOptions()
|
||||||
->setFromArray([
|
->setFromArray([
|
||||||
@ -58,7 +59,7 @@ class ConfigProvider
|
|||||||
]);
|
]);
|
||||||
return $cache;
|
return $cache;
|
||||||
},
|
},
|
||||||
Client::class => function(ContainerInterface $container) {
|
Client::class => function(ContainerInterface $container): Client {
|
||||||
$configArray = $container->get('config');
|
$configArray = $container->get('config');
|
||||||
$config = new Config($configArray['app.config']);
|
$config = new Config($configArray['app.config']);
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ class ConfigProvider
|
|||||||
->setCurlOption(CURLOPT_PROXYTYPE, $config->get('http.proxy.type'))
|
->setCurlOption(CURLOPT_PROXYTYPE, $config->get('http.proxy.type'))
|
||||||
->setCurlOption(CURLOPT_PROXY, $config->get('http.proxy.url'));
|
->setCurlOption(CURLOPT_PROXY, $config->get('http.proxy.url'));
|
||||||
}
|
}
|
||||||
|
return $httpClient;
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user