示例#1
0
 /**
  * Called after request finish
  * @param  callable $cb 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();
     }
 }