예제 #1
0
파일: FidoPlugin.php 프로젝트: rtens/fido
 private function processFetches(RootPackageInterface $package, $fetches)
 {
     $targets = array();
     $requires = $package->getRequires();
     foreach ($fetches as $key => $data) {
         if ($key == 'base-dir') {
             continue;
         }
         $data = $this->handleShortSyntax($key, $data);
         $name = $this->packageName($data['source']);
         try {
             $fetcher = $this->createFetcher($this->determineType($data));
             $targets += $fetcher->fetch($data, $name);
         } catch (\Exception $e) {
             throw new \Exception("Cannot fetch [{$key}]: " . $e->getMessage(), 0, $e);
         }
         $requires[$name] = new Link($package->getName(), $name);
     }
     $package->setRequires($requires);
     return $targets;
 }