public function close() { if (!$this->resource) { return; } $resource = $this->detach(); fclose($resource); }