Ejemplo n.º 1
0
 /**
  * @param ProjectConfiguration $projectConfig
  * @param OutputInterface      $output
  *
  * @return int Exit code
  */
 protected function synchronizeRemoteProjectVendorToLocal(ProjectConfiguration $projectConfig, OutputInterface $output)
 {
     $output->writeln(sprintf('<comment>Synchronize remote project vendor to local for the project "<info>%s</info>"</comment>', $projectConfig->getProjectName()));
     $this->getLocalFilesystem()->mkdir($projectConfig->getLocalVendorDir());
     return $this->getRemoteFilesystem()->syncRemoteToLocal($projectConfig->getRemoteVendorDir(), $projectConfig->getLocalVendorDir(), ['delete' => true]);
 }
 protected function getGraphComposer(ProjectConfiguration $projectConfig)
 {
     $composerJsonFileContent = $this->getRemoteFilesystem()->getRemoteFileContent($projectConfig->getRemoteWebappDir() . '/composer.json');
     $composerLockFileContent = $this->getRemoteFilesystem()->getRemoteFileContent($projectConfig->getRemoteWebappDir() . '/composer.lock');
     $installedFileContent = $this->getRemoteFilesystem()->getRemoteFileContent($projectConfig->getRemoteVendorDir() . '/composer/installed.json');
     if (null === $this->dependencyAnalyzer) {
         $this->dependencyAnalyzer = new DependencyAnalyzer();
     }
     $dependencyGraph = $this->dependencyAnalyzer->analyze($composerJsonFileContent, $composerLockFileContent, $installedFileContent);
     $class = $this->getGraphComposerClass();
     return new $class($dependencyGraph);
 }