Example #1
0
 /**
  * Adds child Node.
  *
  * @param Node $node
  *
  * @throws FileExistsException
  */
 protected function addNode(Node $node)
 {
     if (array_key_exists($node->basename(), $this->children)) {
         throw new FileExistsException(sprintf('%s already exists', $node->basename()));
     }
     $this->children[$node->basename()] = $node;
     $node->setParent($this);
 }
Example #2
0
 /**
  * Sets default (current) uid/gui on object.
  *
  * @param Node $node
  *
  * @return Node
  */
 protected function updateOwnership(Node $node)
 {
     $node->chown($this->userid);
     $node->chgrp($this->groupid);
     return $node;
 }
Example #3
0
 /**
  * Checks whether file is writable for world
  *
  * @return bool
  */
 public function worldCanWrite()
 {
     return (bool) ($this->node->mode() & self::MODE_WORLD_WRITE);
 }