This commit is contained in:
Marcel Pociot
2021-06-22 10:28:32 +02:00
parent 71ce328eb0
commit 48c759a7d9
2 changed files with 14 additions and 15 deletions

View File

@@ -31,6 +31,9 @@ class Client
/** @var int */
protected $timeConnected = 0;
/** @var bool */
protected $shouldExit = true;
public static $user = [];
public static $subdomains = [];
@@ -41,6 +44,11 @@ class Client
$this->logger = $logger;
}
public function shouldExit($shouldExit = true)
{
$this->shouldExit = $shouldExit;
}
public function share(string $sharedUrl, array $subdomains = [], $serverHost = null)
{
$sharedUrl = $this->prepareSharedUrl($sharedUrl);
@@ -237,7 +245,9 @@ class Client
$deferred->reject();
$this->loop->futureTick(function () {
exit(1);
if ($this->shouldExit) {
exit(1);
}
});
}