/** * Read a JSON file and merge its contents * * @param RootPackageInterface $root * @param string $path */ protected function mergeFile(RootPackageInterface $root, $path) { if (isset($this->loadedFiles[$path])) { $this->logger->debug("Already merged <comment>{$path}</comment>"); return; } else { $this->loadedFiles[$path] = true; } $this->logger->info("Loading <comment>{$path}</comment>..."); $package = new ExtraPackage($path, $this->composer, $this->logger); $package->mergeInto($root, $this->state); if ($this->state->recurseIncludes()) { $this->mergeFiles($package->getIncludes(), false); $this->mergeFiles($package->getRequires(), true); } }
/** * Read a JSON file and merge its contents * * @param RootPackage $root * @param string $path */ protected function mergeFile(RootPackage $root, $path) { if (isset($this->loadedFiles[$path])) { $this->logger->debug("Skipping duplicate <comment>{$path}</comment>..."); return; } else { $this->loadedFiles[$path] = true; } $this->logger->debug("Loading <comment>{$path}</comment>..."); $package = new ExtraPackage($path, $this->composer, $this->logger); $package->mergeInto($root, $this->state); if ($this->state->recurseIncludes()) { $this->mergeIncludes($package->getIncludes()); } }