Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. vfsStreamWrapper.php

function 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 766

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']);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal