public function takeDown() { if ($this->httpServer === NULL) { return; } foreach ($this->windows as $window) { $window->stop(); } if ($this->videoRecorder) { sleep(2); // give it some time before it disappears $this->videoRecorder->stop(); } $this->windows = array(); $this->httpServer->slaughter(); $this->httpServer = NULL; $this->videoRecorder = NULL; }