PHPDaemon\FS\FileSystem::unlink PHP Method

    public static function unlink($path, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!self::$supported) {
            $r = unlink($path);
            if ($cb) {
                $cb($path, $r);
            }
            return $r;
        }
        return eio_unlink($path, $pri, $cb, $path);
    }

Usage Example

Beispiel #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();
     }
 }