/** * 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); }
/** * 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; }
/** * Checks whether file is writable for world * * @return bool */ public function worldCanWrite() { return (bool) ($this->node->mode() & self::MODE_WORLD_WRITE); }