Example #1
0
 /**
  * @param DirectoryInterface $node
  * @return ObjectStream
  */
 protected function copyToDirectory(DirectoryInterface $node)
 {
     return $this->copyToFile($node->getFilesystem()->file($node->getPath() . $this->getName()));
 }
Example #2
0
 /**
  * @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]);
 }