コード例 #1
0
ファイル: PathMapping.php プロジェクト: sensorario/manager
 /**
  * Creates a new path mapping.
  *
  * @param string          $repositoryPath The repository path.
  * @param string|string[] $pathReferences The path references.
  *
  * @throws InvalidArgumentException If any of the arguments is invalid.
  */
 public function __construct($repositoryPath, $pathReferences)
 {
     Assert::path($repositoryPath);
     $pathReferences = (array) $pathReferences;
     Assert::notEmpty($pathReferences, 'At least one filesystem path must be passed.');
     Assert::allString($pathReferences, 'The filesystem paths must be strings. Got: %s');
     Assert::allNotEmpty($pathReferences, 'The filesystem paths must not be empty.');
     $this->repositoryPath = $repositoryPath;
     $this->pathReferences = $pathReferences;
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function removeRootPathMapping($repositoryPath)
 {
     Assert::path($repositoryPath);
     $this->assertMappingsLoaded();
     if (!$this->mappings->contains($repositoryPath, $this->rootPackage->getName())) {
         return;
     }
     $mapping = $this->mappings->get($repositoryPath, $this->rootPackage->getName());
     $tx = new Transaction();
     try {
         $syncOp = $this->syncRepositoryPath($repositoryPath);
         $syncOp->takeSnapshot();
         $tx->execute($this->unloadPathMapping($mapping));
         $tx->execute($this->removePathMappingFromPackageFile($repositoryPath));
         $tx->execute($syncOp);
         $this->saveRootPackageFile();
         $tx->commit();
     } catch (Exception $e) {
         $tx->rollback();
         throw $e;
     }
     $this->removeResolvedConflicts();
 }
コード例 #3
0
 /**
  * Creates the conflict.
  *
  * @param string $repositoryPath The conflicting repository path.
  */
 public function __construct($repositoryPath)
 {
     Assert::path($repositoryPath);
     $this->repositoryPath = $repositoryPath;
 }