registered Nilemin\Virtualmin\Http\HttpClientInterface in the dependency injection container
This commit is contained in:
parent
e43be86156
commit
bf453ce944
|
@ -11,7 +11,7 @@ use Nilemin\Virtualmin\Managers\DNS\DNSManager;
|
||||||
use Nilemin\Virtualmin\Managers\SSL\SSLManager;
|
use Nilemin\Virtualmin\Managers\SSL\SSLManager;
|
||||||
use Nilemin\Virtualmin\Managers\Scripts\ScriptsManager;
|
use Nilemin\Virtualmin\Managers\Scripts\ScriptsManager;
|
||||||
use Nilemin\Virtualmin\Managers\Cron\CronManager;
|
use Nilemin\Virtualmin\Managers\Cron\CronManager;
|
||||||
use Nilemin\Virtualmin\Http\HttpClient;
|
use Nilemin\Virtualmin\Http\HttpClientInterface;
|
||||||
use Nilet\Components\Configuration\Config;
|
use Nilet\Components\Configuration\Config;
|
||||||
use Nilet\Components\Container\DependencyContainer;
|
use Nilet\Components\Container\DependencyContainer;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class Virtualmin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Http client.
|
* Http client.
|
||||||
* @var HttpClient
|
* @var Nilemin\Virtualmin\Http\HttpClientInterface
|
||||||
*/
|
*/
|
||||||
private $httpClient = null;
|
private $httpClient = null;
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ class Virtualmin {
|
||||||
$this->httpClient = new HttpClient($url, $port, $rootName, $rootPassword, "json");
|
$this->httpClient = new HttpClient($url, $port, $rootName, $rootPassword, "json");
|
||||||
$this->dc = new DependencyContainer();
|
$this->dc = new DependencyContainer();
|
||||||
$this->dc->instance(Config::class, $config);
|
$this->dc->instance(Config::class, $config);
|
||||||
|
$this->dc->instance("Nilemin\\Virtualmin\\Http\\HttpClientInterface", function() { return $this->httpClient; });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue