You are here

private function vfsStreamWrapper::doPermChange in Zircon Profile 8.0

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

executes given permission change when necessary rights allow such a change

Parameters

string $path:

vfsStreamAbstractContent $content:

\Closure $change:

Return value

bool

1 call to vfsStreamWrapper::doPermChange()
vfsStreamWrapper::stream_metadata in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
sets metadata like owner, user or permissions

File

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

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

private function doPermChange($path, vfsStreamAbstractContent $content, \Closure $change) {
  if (!$content
    ->isOwnedByUser(vfsStream::getCurrentUser())) {
    return false;
  }
  if (self::$root
    ->getName() !== $path) {
    $names = $this
      ->splitPath($path);
    $parent = $this
      ->getContent($names['dirname']);
    if (!$parent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup())) {
      return false;
    }
  }
  $change();
  return true;
}