|
@@ -34,20 +34,24 @@ class DeviceListener
|
|
*/
|
|
*/
|
|
private $devicePutUrl;
|
|
private $devicePutUrl;
|
|
|
|
|
|
|
|
+ private $serviceContainer;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param Webservice $webservice
|
|
* @param Webservice $webservice
|
|
* @param string $devicePostUrl
|
|
* @param string $devicePostUrl
|
|
* @param string $deviceDeletePostUrl
|
|
* @param string $deviceDeletePostUrl
|
|
* @param string $devicePutUrl
|
|
* @param string $devicePutUrl
|
|
|
|
+ * @param ContainerInterface $serviceContainer
|
|
*/
|
|
*/
|
|
- public function __construct(Webservice $webservice, $devicePostUrl, $deviceDeletePostUrl, $devicePutUrl)
|
|
|
|
|
|
+ public function __construct(Webservice $webservice, $devicePostUrl, $deviceDeletePostUrl, $devicePutUrl, $serviceContainer)
|
|
{
|
|
{
|
|
$this->webservice = $webservice;
|
|
$this->webservice = $webservice;
|
|
$this->devicePostUrl = $devicePostUrl;
|
|
$this->devicePostUrl = $devicePostUrl;
|
|
$this->deviceDeletePostUrl = $deviceDeletePostUrl;
|
|
$this->deviceDeletePostUrl = $deviceDeletePostUrl;
|
|
$this->devicePutUrl = $devicePutUrl;
|
|
$this->devicePutUrl = $devicePutUrl;
|
|
$this->enabled = true;
|
|
$this->enabled = true;
|
|
|
|
+ $this->serviceContainer = $serviceContainer;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -78,7 +82,7 @@ class DeviceListener
|
|
*/
|
|
*/
|
|
public function runCommand($name, $cmd_args = array())
|
|
public function runCommand($name, $cmd_args = array())
|
|
{
|
|
{
|
|
- global $kernel;
|
|
|
|
|
|
+ $kernel = $this->serviceContainer->get('kernel');
|
|
|
|
|
|
$application = new Application($kernel);
|
|
$application = new Application($kernel);
|
|
$application->setAutoExit(false);
|
|
$application->setAutoExit(false);
|