Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function rmdir($path)
 {
     $this->incrementPending();
     $promisor = new Deferred();
     $priority = \EIO_PRI_DEFAULT;
     \eio_rmdir($path, $priority, [$this, "onGenericResult"], $promisor);
     return $promisor->promise();
 }
Exemple #2
0
 /**
  * Removes empty directory
  * @param  string   $path Path
  * @param  callable $cb   Callback
  * @param  integer  $pri  Priority
  * @return resource|boolean
  */
 public static function rmdir($path, $cb = null, $pri = EIO_PRI_DEFAULT)
 {
     $cb = CallbackWrapper::forceWrap($cb);
     if (!FileSystem::$supported) {
         $r = rmdir($path);
         if ($cb) {
             call_user_func($cb, $path, $r);
         }
         return $r;
     }
     return eio_rmdir($path, $pri, $cb, $path);
 }
Exemple #3
0
 public static function rmdir($path, $cb = null, $pri = EIO_PRI_DEFAULT)
 {
     if (!FS::$supported) {
         $r = rmdir($path);
         if ($cb) {
             call_user_func($cb, $path, $r);
         }
         return;
     }
     return eio_rmdir($path, $pri, $cb, $path);
 }
Exemple #4
0
 /**
  * {@inheritdoc}
  */
 public function rmDir(string $path) : \Generator
 {
     $delayed = new Delayed();
     \eio_rmdir($path, null, function (Delayed $delayed, $result, $req) {
         if (-1 === $result) {
             $delayed->reject(new FileException(sprintf('Could not remove directory: %s.', \eio_get_last_error($req))));
         } else {
             $delayed->resolve(true);
         }
     }, $delayed);
     $this->poll->listen();
     try {
         $result = (yield $delayed);
     } finally {
         $this->poll->done();
     }
     return $result;
 }
Exemple #5
0
 /**
  * {@inheritdoc}
  */
 public function rmdir($path)
 {
     \call_user_func($this->incrementor, 1);
     $promisor = new Deferred();
     $priority = \EIO_PRI_DEFAULT;
     $data = [$promisor, $path];
     \eio_rmdir($path, $priority, [$this, "onRmdir"], $data);
     return $promisor->promise();
 }