mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-25 18:43:22 +01:00
Using a shutdown function rather than a destructor to terminate the test server
This commit is contained in:
parent
3a0787217e
commit
d818788776
@ -47,16 +47,7 @@ class Server
|
||||
{
|
||||
$this->port = $port ?: self::DEFAULT_PORT;
|
||||
$this->client = new Client($this->getUrl());
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
try {
|
||||
$this->stop();
|
||||
} catch (\Exception $e) {
|
||||
// Can't throw exceptions in destructor
|
||||
echo "\n{$e}\n";
|
||||
}
|
||||
register_shutdown_function(array($this, 'stop'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user