本文整理汇总了PHP中Composer\Package\PackageInterface::getDistMirrors方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageInterface::getDistMirrors方法的具体用法?PHP PackageInterface::getDistMirrors怎么用?PHP PackageInterface::getDistMirrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Package\PackageInterface
的用法示例。
在下文中一共展示了PackageInterface::getDistMirrors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dump
public function dump(PackageInterface $package)
{
$keys = array('binaries' => 'bin', 'type', 'extra', 'installationSource' => 'installation-source', 'autoload', 'devAutoload' => 'autoload-dev', '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 ($mirrors = $package->getSourceMirrors()) {
$data['source']['mirrors'] = $mirrors;
}
}
if ($package->getDistType()) {
$data['dist']['type'] = $package->getDistType();
$data['dist']['url'] = $package->getDistUrl();
$data['dist']['reference'] = $package->getDistReference();
$data['dist']['shasum'] = $package->getDistSha1Checksum();
if ($mirrors = $package->getDistMirrors()) {
$data['dist']['mirrors'] = $mirrors;
}
}
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;
}
}
if (count($package->getTransportOptions()) > 0) {
$data['transport-options'] = $package->getTransportOptions();
}
return $data;
}
示例2: getDistMirrors
/**
* {@inheritdoc}
*/
public function getDistMirrors()
{
return $this->package->getDistMirrors();
}
示例3: getUrlFromPackage
private static function getUrlFromPackage(Package\PackageInterface $package)
{
$url = $package->getDistUrl();
if (!$url) {
return false;
}
if ($package->getDistMirrors()) {
$url = current($package->getDistUrls());
}
if (!parse_url($url, PHP_URL_HOST)) {
return false;
}
return $url;
}
示例4: getDistMirrors
public function getDistMirrors()
{
return $this->aliasOf->getDistMirrors();
}