protected function addFilesystemResource($path, FilesystemResource $resource) { $resource = clone $resource; $resource->attachTo($this, $path); $relativePath = Path::makeRelative($resource->getFilesystemPath(), $this->baseDirectory); $this->insertReference($path, $relativePath); $this->storeVersion($resource); }
/** * {@inheritdoc} */ protected function addFilesystemResource($path, FilesystemResource $resource) { // Read children before attaching the resource to this repository $children = $resource->listChildren(); parent::addFilesystemResource($path, $resource); // Recursively add all child resources $basePath = '/' === $path ? $path : $path . '/'; foreach ($children as $name => $child) { $this->addFilesystemResource($basePath . $name, $child); } }