當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。