当前位置: 首页>>代码示例>>PHP>>正文


PHP PackageInterface::getTargetDir方法代码示例

本文整理汇总了PHP中Composer\Package\PackageInterface::getTargetDir方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageInterface::getTargetDir方法的具体用法?PHP PackageInterface::getTargetDir怎么用?PHP PackageInterface::getTargetDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Composer\Package\PackageInterface的用法示例。


在下文中一共展示了PackageInterface::getTargetDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dump

 public function dump(PackageInterface $package)
 {
     $keys = array('binaries' => 'bin', 'type', 'extra', 'installationSource' => 'installation-source', 'autoload', 'notificationUrl' => 'notification-url', 'includePaths' => 'include-path');
     $data = array();
     $data['name'] = $package->getPrettyName();
     $data['version'] = $package->getPrettyVersion();
     $data['version_normalized'] = $package->getVersion();
     if ($package->getTargetDir()) {
         $data['target-dir'] = $package->getTargetDir();
     }
     if ($package->getSourceType()) {
         $data['source']['type'] = $package->getSourceType();
         $data['source']['url'] = $package->getSourceUrl();
         $data['source']['reference'] = $package->getSourceReference();
     }
     if ($package->getDistType()) {
         $data['dist']['type'] = $package->getDistType();
         $data['dist']['url'] = $package->getDistUrl();
         $data['dist']['reference'] = $package->getDistReference();
         $data['dist']['shasum'] = $package->getDistSha1Checksum();
     }
     if ($package->getArchiveExcludes()) {
         $data['archive']['exclude'] = $package->getArchiveExcludes();
     }
     foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
         if ($links = $package->{'get' . ucfirst($opts['method'])}()) {
             foreach ($links as $link) {
                 $data[$type][$link->getTarget()] = $link->getPrettyConstraint();
             }
             ksort($data[$type]);
         }
     }
     if ($packages = $package->getSuggests()) {
         ksort($packages);
         $data['suggest'] = $packages;
     }
     if ($package->getReleaseDate()) {
         $data['time'] = $package->getReleaseDate()->format('Y-m-d H:i:s');
     }
     $data = $this->dumpValues($package, $keys, $data);
     if ($package instanceof CompletePackageInterface) {
         $keys = array('scripts', 'license', 'authors', 'description', 'homepage', 'keywords', 'repositories', 'support');
         $data = $this->dumpValues($package, $keys, $data);
         if (isset($data['keywords']) && is_array($data['keywords'])) {
             sort($data['keywords']);
         }
     }
     if ($package instanceof RootPackageInterface) {
         $minimumStability = $package->getMinimumStability();
         if ($minimumStability) {
             $data['minimum-stability'] = $minimumStability;
         }
     }
     return $data;
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:55,代码来源:ArrayDumper.php

示例2: parseAutoloadsTypeFiles

 /**
  * @param array
  * @param \Composer\Package\PackageInterface
  */
 public function parseAutoloadsTypeFiles($paths, PackageInterface $mainPackage)
 {
     $autoloads = array();
     $installPath = '';
     foreach ((array) $paths as $path) {
         if ($mainPackage->getTargetDir() && !is_readable($installPath . '/' . $path)) {
             // remove target-dir from file paths of the root package
             $targetDir = str_replace('\\<dirsep\\>', '[\\\\/]', preg_quote(str_replace(array('/', '\\'), '<dirsep>', $mainPackage->getTargetDir())));
             $path = ltrim(preg_replace('{^' . $targetDir . '}', '', ltrim($path, '\\/')), '\\/');
         }
         $relativePath = empty($installPath) ? empty($path) ? '.' : $path : $installPath . '/' . $path;
         $autoloads[$this->getFileIdentifier($mainPackage, $path)] = $relativePath;
     }
     return $autoloads;
 }
开发者ID:funkjedi,项目名称:composer-include-files,代码行数:19,代码来源:AutoloadGenerator.php

示例3: getInstallPath

 /**
  * {@inheritdoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $this->initializeVendorDir();
     $targetDir = $package->getTargetDir();
     list(, $name) = explode('/', $package->getPrettyName(), 2);
     return ($this->vendorDir ? $this->vendorDir . '/' : '') . $name . ($targetDir ? '/' . $targetDir : '');
 }
开发者ID:DYFeng,项目名称:composer-asset-plugin,代码行数:10,代码来源:AssetInstaller.php

示例4: dump

 public function dump(PackageInterface $package)
 {
     $keys = array('binaries' => 'bin', 'scripts', 'type', 'extra', 'installationSource' => 'installation-source', 'license', 'authors', 'description', 'homepage', 'keywords', 'autoload', 'repositories', 'includePaths' => 'include-path', 'support');
     $data = array();
     $data['name'] = $package->getPrettyName();
     $data['version'] = $package->getPrettyVersion();
     $data['version_normalized'] = $package->getVersion();
     if ($package->getTargetDir()) {
         $data['target-dir'] = $package->getTargetDir();
     }
     if ($package->getReleaseDate()) {
         $data['time'] = $package->getReleaseDate()->format('Y-m-d H:i:s');
     }
     if ($package->getSourceType()) {
         $data['source']['type'] = $package->getSourceType();
         $data['source']['url'] = $package->getSourceUrl();
         $data['source']['reference'] = $package->getSourceReference();
     }
     if ($package->getDistType()) {
         $data['dist']['type'] = $package->getDistType();
         $data['dist']['url'] = $package->getDistUrl();
         $data['dist']['reference'] = $package->getDistReference();
         $data['dist']['shasum'] = $package->getDistSha1Checksum();
     }
     foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
         if ($links = $package->{'get' . ucfirst($opts['method'])}()) {
             foreach ($links as $link) {
                 $data[$type][$link->getTarget()] = $link->getPrettyConstraint();
             }
         }
     }
     if ($packages = $package->getSuggests()) {
         $data['suggest'] = $packages;
     }
     foreach ($keys as $method => $key) {
         if (is_numeric($method)) {
             $method = $key;
         }
         $getter = 'get' . ucfirst($method);
         $value = $package->{$getter}();
         if (null !== $value && !(is_array($value) && 0 === count($value))) {
             $data[$key] = $value;
         }
     }
     return $data;
 }
开发者ID:nicodmf,项目名称:composer,代码行数:46,代码来源:ArrayDumper.php

示例5: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $prefix = substr($package->getPrettyName(), 0, 14);
     if ('zepluf/plugin-' !== $prefix) {
         throw new \InvalidArgumentException('Unable to install plugin ' . $package->getPrettyName() . ', ZePLUF plugin package names  should always begin with "zepluf/plugin-"');
     }
     return 'app/plugins/' . $package->getTargetDir();
 }
开发者ID:zepluf,项目名称:installer,代码行数:11,代码来源:PluginInstaller.php

示例6: getInstallPath

 /**
  * @param PackageInterface $package
  * @return string
  */
 public function getInstallPath(PackageInterface $package)
 {
     $targetDir = $package->getTargetDir();
     if ($targetDir) {
         return sprintf('%s/%s', $this->getPackageBasePath($package), $targetDir);
     }
     return $this->getPackageBasePath($package);
 }
开发者ID:robofirm,项目名称:magento-core-composer-installer,代码行数:12,代码来源:CoreManager.php

示例7: getInstallPath

 public function getInstallPath(PackageInterface $package)
 {
     $path = $this->vendorDir;
     $path .= '/' . $package->getPrettyName();
     $targetDir = $package->getTargetDir();
     if ($targetDir) {
         $path .= '/' . $targetDir;
     }
     return $path;
 }
开发者ID:netresearch,项目名称:composer-installers,代码行数:10,代码来源:SymlinkDriver.php

示例8: getInstallPath

 /**
  * Install extensions before vendor dir
  */
 public function getInstallPath(PackageInterface $package)
 {
     $this->initializeVendorDir();
     $basePath = $this->vendorDir ? $this->vendorDir : '';
     $extras = $package->getExtra();
     if (!is_null($extras) && isset($extras[self::EXT_NAME_KEY]) && !empty($extras[self::EXT_NAME_KEY])) {
         // get extension
         return $basePath . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $extras[self::EXT_NAME_KEY];
     } else {
         // default path
         $targetDir = $package->getTargetDir();
         return (empty($basePath) ? '' : $basePapth . DIRECTORY_SEPARATOR) . $package->getPrettyName() . ($targetDir ? DIRECTORY_SEPARATOR . $targetDir : '');
     }
 }
开发者ID:blog-tree,项目名称:lib-bt-branch-installer,代码行数:17,代码来源:BlogTreeInstaller.php

示例9: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $type = $package->getType();
     $prettyName = $package->getPrettyName();
     if (strpos($prettyName, '/') !== false) {
         list($vendor, $name) = explode('/', $prettyName);
     } else {
         $vendor = '';
         $name = $prettyName;
     }
     $installerPaths = $this->composer->getConfig()->get('installer-paths');
     $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
     if (!empty($installerPaths)) {
         $customPath = $this->mapCustomInstallPaths($installerPaths, $prettyName, $type);
         if ($customPath !== false) {
             return $this->templatePath($customPath, $availableVars);
         }
     }
     $this->initializeVendorDir();
     $basePath = ($this->vendorDir ? $this->vendorDir . '/' : '') . $package->getPrettyName();
     $targetDir = $package->getTargetDir();
     return $basePath . ($targetDir ? '/' . $targetDir : '');
 }
开发者ID:easylo,项目名称:extension-installer-plugin,代码行数:26,代码来源:ExtensionInstaller.php

示例10: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $targetDir = $package->getTargetDir();
     return $package->getPrettyName() . ($targetDir ? '/' . $targetDir : '');
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:8,代码来源:NoopInstaller.php

示例11: getTargetDir

 public function getTargetDir()
 {
     return $this->aliasOf->getTargetDir();
 }
开发者ID:neon64,项目名称:composer,代码行数:4,代码来源:AliasPackage.php

示例12: getSymlinkSourcePath

 /**
  * @param PackageInterface $package
  *
  * @return string
  */
 protected function getSymlinkSourcePath(PackageInterface $package)
 {
     if (null != $this->config->getSymlinkBasePath()) {
         $targetDir = $package->getTargetDir();
         $sourcePath = $this->config->getSymlinkBasePath() . '/' . $package->getPrettyName() . '/' . $package->getPrettyVersion() . ($targetDir ? '/' . $targetDir : '');
     } else {
         $sourcePath = $this->getInstallPath($package);
     }
     return $sourcePath;
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:15,代码来源:SharedPackageInstaller.php

示例13: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     $this->initializeVendorDir();
     $basePath = ($this->vendorDir ? $this->vendorDir . '/' : '') . $package->getPrettyName();
     $targetDir = $package->getTargetDir();
     return $basePath . ($targetDir ? '/' . $targetDir : '');
 }
开发者ID:radykal-com,项目名称:composer,代码行数:10,代码来源:LibraryInstaller.php

示例14: getInstallPath

 /**
  * {@inheritDoc}
  */
 public function getInstallPath(PackageInterface $package)
 {
     if (!is_null($this->modmanRootDir) && true === $this->modmanRootDir->isDir()) {
         $targetDir = $package->getTargetDir();
         if (!$targetDir) {
             list($vendor, $targetDir) = explode('/', $package->getPrettyName());
         }
         $installPath = $this->modmanRootDir . '/' . $targetDir;
     } else {
         $installPath = parent::getInstallPath($package);
     }
     // Make install path absolute. This is needed in the symlink deploy strategies.
     if (DIRECTORY_SEPARATOR !== $installPath[0] && $installPath[1] !== ':') {
         $installPath = getcwd() . "/{$installPath}";
     }
     return $installPath;
 }
开发者ID:vv-team,项目名称:foodo,代码行数:20,代码来源:Installer.php

示例15: updateInformation

 private function updateInformation(Package $package, PackageInterface $data, $flags)
 {
     $em = $this->doctrine->getManager();
     $version = new Version();
     $normVersion = $data->getVersion();
     $existingVersion = $package->getVersion($normVersion);
     if ($existingVersion) {
         $source = $existingVersion->getSource();
         // update if the right flag is set, or the source reference has changed (re-tag or new commit on branch)
         if ($source['reference'] !== $data->getSourceReference() || $flags & self::UPDATE_EQUAL_REFS) {
             $version = $existingVersion;
         } else {
             // mark it updated to avoid it being pruned
             $existingVersion->setUpdatedAt(new \DateTime());
             return false;
         }
     }
     $version->setName($package->getName());
     $version->setVersion($data->getPrettyVersion());
     $version->setNormalizedVersion($normVersion);
     $version->setDevelopment($data->isDev());
     $em->persist($version);
     $descr = $this->sanitize($data->getDescription());
     $version->setDescription($descr);
     $package->setDescription($descr);
     $version->setHomepage($data->getHomepage());
     $version->setLicense($data->getLicense() ?: array());
     $version->setPackage($package);
     $version->setUpdatedAt(new \DateTime());
     $version->setReleasedAt($data->getReleaseDate());
     if ($data->getSourceType()) {
         $source['type'] = $data->getSourceType();
         $source['url'] = $data->getSourceUrl();
         $source['reference'] = $data->getSourceReference();
         $version->setSource($source);
     } else {
         $version->setSource(null);
     }
     if ($data->getDistType()) {
         $dist['type'] = $data->getDistType();
         $dist['url'] = $data->getDistUrl();
         $dist['reference'] = $data->getDistReference();
         $dist['shasum'] = $data->getDistSha1Checksum();
         $version->setDist($dist);
     } else {
         $version->setDist(null);
     }
     if ($data->getType()) {
         $type = $this->sanitize($data->getType());
         $version->setType($type);
         if ($type !== $package->getType()) {
             $package->setType($type);
         }
     }
     $version->setTargetDir($data->getTargetDir());
     $version->setAutoload($data->getAutoload());
     $version->setExtra($data->getExtra());
     $version->setBinaries($data->getBinaries());
     $version->setIncludePaths($data->getIncludePaths());
     $version->setSupport($data->getSupport());
     if ($data->getKeywords()) {
         $keywords = array();
         foreach ($data->getKeywords() as $keyword) {
             $keywords[mb_strtolower($keyword, 'UTF-8')] = $keyword;
         }
         $existingTags = [];
         foreach ($version->getTags() as $tag) {
             $existingTags[mb_strtolower($tag->getName(), 'UTF-8')] = $tag;
         }
         foreach ($keywords as $tagKey => $keyword) {
             if (isset($existingTags[$tagKey])) {
                 unset($existingTags[$tagKey]);
                 continue;
             }
             $tag = Tag::getByName($em, $keyword, true);
             if (!$version->getTags()->contains($tag)) {
                 $version->addTag($tag);
             }
         }
         foreach ($existingTags as $tag) {
             $version->getTags()->removeElement($tag);
         }
     } elseif (count($version->getTags())) {
         $version->getTags()->clear();
     }
     $authorRepository = $this->doctrine->getRepository('PackagistWebBundle:Author');
     $version->getAuthors()->clear();
     if ($data->getAuthors()) {
         foreach ($data->getAuthors() as $authorData) {
             $author = null;
             foreach (array('email', 'name', 'homepage', 'role') as $field) {
                 if (isset($authorData[$field])) {
                     $authorData[$field] = trim($authorData[$field]);
                     if ('' === $authorData[$field]) {
                         $authorData[$field] = null;
                     }
                 } else {
                     $authorData[$field] = null;
                 }
             }
//.........这里部分代码省略.........
开发者ID:jakoch,项目名称:packagist,代码行数:101,代码来源:Updater.php


注:本文中的Composer\Package\PackageInterface::getTargetDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。