You are here

protected function vfsStreamWrapper::doUnlink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php \org\bovigo\vfs\vfsStreamWrapper::doUnlink()

removes a path

Parameters

string $path:

Return value

bool

2 calls to vfsStreamWrapper::doUnlink()
vfsStreamWrapper::rename in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
rename from one path to another
vfsStreamWrapper::unlink in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
remove the data under the given path

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php, line 760

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

protected function doUnlink($path) {
  if (self::$root
    ->getName() === $path) {

    // delete root? very brave. :)
    self::$root = null;
    clearstatcache();
    return true;
  }
  $names = $this
    ->splitPath($path);
  $content = $this
    ->getContent($names['dirname']);
  if (!$content
    ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup())) {
    return false;
  }
  clearstatcache();
  return $content
    ->removeChild($names['basename']);
}