/** * @param DirectoryInterface $node * @return ObjectStream */ protected function copyToDirectory(DirectoryInterface $node) { return $this->copyToFile($node->getFilesystem()->file($node->getPath() . $this->getName())); }
/** * @param DirectoryInterface $node * @param $stream * @param $closeCount */ protected function streamLsIntoStream(DirectoryInterface $node, $stream, &$closeCount) { $closeCount++; $nodeStream = $node->lsRecursiveStreaming(); $nodeStream->on('end', function () use(&$closeCount) { $closeCount--; }); $nodeStream->pipe($stream, ['end' => false]); }