Exemplo n.º 1
0
 protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
 {
     // keep the name of the main identifier for all packages
     $data['name'] = $this->packageName ?: $data['name'];
     if (!isset($data['dist'])) {
         $data['dist'] = $driver->getDist($identifier);
     }
     if (!isset($data['source'])) {
         $data['source'] = $driver->getSource($identifier);
     }
     return $data;
 }
    /**
     * Pre process the data of package before the conversion to Package instance.
     *
     * @param VcsDriverInterface $driver
     * @param array              $data
     * @param string             $identifier
     *
     * @return array
     */
    protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
    {
        $vcsRepos = array();
        $data = array_merge($data, $this->packageData);
        $data = $this->assetType->getPackageConverter()->convert($data, $vcsRepos);

        $this->dispatchAddVcsEvent($vcsRepos);

        if (!isset($data['dist'])) {
            $data['dist'] = $driver->getDist($identifier);
        }
        if (!isset($data['source'])) {
            $data['source'] = $driver->getSource($identifier);
        }

        return  (array) $data;
    }
Exemplo n.º 3
0
 private function preProcess(VcsDriverInterface $driver, array $data, $identifier)
 {
     $data['name'] = $this->packageName ?: $data['name'];
     if (!isset($data['dist'])) {
         $data['dist'] = $driver->getDist($identifier);
     }
     if (!isset($data['source'])) {
         $data['source'] = $driver->getSource($identifier);
     }
     return $data;
 }
Exemplo n.º 4
0
 /**
  * Pre inits the branch of complete package.
  *
  * @param VcsDriverInterface $driver     The vcs driver
  * @param array              $data       The asset package data
  * @param string             $branch     The branch name
  * @param string             $identifier The branch identifier
  */
 protected function preInitBranchPackage(VcsDriverInterface $driver, array $data, $branch, $identifier)
 {
     $packageName = $this->createPackageName();
     $data = array_merge($this->createMockOfPackageConfig($packageName, $branch), $data);
     $data = $this->preProcessAsset($data);
     $data['version'] = $branch;
     $data = $this->configureBranchPackage($branch, $data);
     if (!isset($data['dist'])) {
         $data['dist'] = $driver->getDist($identifier);
     }
     if (!isset($data['source'])) {
         $data['source'] = $driver->getSource($identifier);
     }
     $loader = new ArrayLoader();
     $package = $loader->load($data);
     $package = $this->includeBranchAlias($driver, $package, $branch);
     $this->addPackage($package);
 }
 /**
  * Make proper package data
  *
  * @param VcsDriverInterface $driver
  * @param array $data
  * @param string $identifier
  * @return array
  */
 protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
 {
     // keep the name of the main identifier for all packages
     if ($this->packageName != $this->url) {
         $namespace = preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $data['namespace']);
         $namespace = strtolower($namespace);
         $data['name'] = $this->packageName . '-' . $namespace;
     }
     if (!isset($data['dist'])) {
         $data['dist'] = $driver->getDist($identifier);
     }
     if (!isset($data['source'])) {
         $data['source'] = $driver->getSource($identifier);
         $data['source']['type'] = $this->repoConfig['type'];
     }
     return $data;
 }