You are here

public function vfsStreamWrapper::unlink 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::unlink()

remove the data under the given path

Parameters

string $path:

Return value

bool

1 call to vfsStreamWrapper::unlink()
vfsStreamWrapperRecordingProxy::unlink in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php
remove the data under the given path
1 method overrides vfsStreamWrapper::unlink()
vfsStreamWrapperRecordingProxy::unlink in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php
remove the data under the given path

File

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

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

public function unlink($path) {
  $realPath = $this
    ->resolvePath(vfsStream::path($path));
  $content = $this
    ->getContent($realPath);
  if (null === $content) {
    trigger_error('unlink(' . $path . '): No such file or directory', E_USER_WARNING);
    return false;
  }
  if ($content
    ->getType() !== vfsStreamContent::TYPE_FILE) {
    trigger_error('unlink(' . $path . '): Operation not permitted', E_USER_WARNING);
    return false;
  }
  return $this
    ->doUnlink($realPath);
}