From 762cddcc6c17c08a2e499a1bd0dd575899fbec06 Mon Sep 17 00:00:00 2001 From: barbushin Date: Tue, 30 Jun 2015 11:05:02 +0300 Subject: [PATCH] Fix sending messages in disabled mode Fixes #7 --- composer.json | 2 +- src/PhpConsole/Laravel/ServiceProvider.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 58d7b89..8d159ef 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "require": { "php": ">=5.3.0", "illuminate/support": "5.*", - "php-console/php-console": ">=3.1" + "php-console/php-console": ">=3.1.4 <4.0" }, "autoload": { "psr-0": { diff --git a/src/PhpConsole/Laravel/ServiceProvider.php b/src/PhpConsole/Laravel/ServiceProvider.php index 4553afa..7253f45 100644 --- a/src/PhpConsole/Laravel/ServiceProvider.php +++ b/src/PhpConsole/Laravel/ServiceProvider.php @@ -108,7 +108,11 @@ protected function initPhpConsole() { Helper::register(); } - if (!$this->isEnabled || !Connector::getInstance()->isActiveClient()) { + $isActiveClient = $connector->isActiveClient(); + if (!$this->isEnabled || !$isActiveClient) { + if($isActiveClient) { + $connector->disable(); + } return; }