PHPDaemon\HTTPRequest\Generic::postFinishHandler PHP Method

postFinishHandler() protected method

Called after request finish
protected postFinishHandler ( callable $cb = null ) : void
$cb callable Callback
return void
    protected function postFinishHandler($cb = null)
    {
        if (!$this->headers_sent) {
            $this->out('');
        }
        $this->sendfp = null;
        if (isset($this->attrs->files)) {
            foreach ($this->attrs->files as $f) {
                if (isset($f['tmp_name'])) {
                    FileSystem::unlink($f['tmp_name']);
                }
            }
        }
        if (isset($this->attrs->session)) {
            $this->sessionCommit($cb);
        } else {
            $cb === null || $cb();
        }
    }