本文整理汇总了PHP中Composer\Package\Package::setBinaries方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::setBinaries方法的具体用法?PHP Package::setBinaries怎么用?PHP Package::setBinaries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Package\Package
的用法示例。
在下文中一共展示了Package::setBinaries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolvePackageDependencies
private function resolvePackageDependencies($repository, $packages, $packageName)
{
$config = $packages[$packageName];
foreach ($config['deps'] as $dependencyName) {
if ($dependencyName === 'vendor/php' || strpos($dependencyName, 'vendor/ext-') === 0 || strpos($dependencyName, 'vendor/lib-') === 0) {
continue;
}
if (!isset($packages[$dependencyName])) {
throw new \RuntimeException("Requiring non existant package '" . $dependencyName . "' in '" . $packageName . "'.");
}
$dependency = $packages[$dependencyName];
$package = new Package($dependency['path'], "@stable", "@stable");
$package->setType('fiddler');
if (isset($dependency['autoload']) && is_array($dependency['autoload'])) {
$package->setAutoload($dependency['autoload']);
}
if (isset($dependency['bin']) && is_array($dependency['bin'])) {
$package->setBinaries($dependency['bin']);
}
if (!$repository->hasPackage($package)) {
$repository->addPackage($package);
$this->resolvePackageDependencies($repository, $packages, $dependencyName);
}
}
}
示例2: resolvePackageDependencies
private function resolvePackageDependencies($repository, $packages, $packageName)
{
$config = $packages[$packageName];
$dependencies = $config['deps'];
if (isset($config['deps-dev'])) {
$dependencies = array_merge($dependencies, $config['deps-dev']);
}
foreach ($dependencies as $dependencyName) {
$isVendor = strpos($dependencyName, 'vendor/') === 0;
if ($dependencyName === 'vendor/php' || strpos($dependencyName, 'vendor/ext-') === 0 || strpos($dependencyName, 'vendor/lib-') === 0) {
continue;
// Meta-dependencies that composer checks
}
if (!isset($packages[$dependencyName])) {
if ($dependencyName == 'vendor/composer-plugin-api') {
continue;
}
if ($isVendor) {
throw new \RuntimeException("Requiring non-existent composer-package '" . $dependencyName . "' in '" . $packageName . "'. Please ensure it is present in composer.json.");
} else {
throw new \RuntimeException("Requiring non-existent repo-module '" . $dependencyName . "' in '" . $packageName . "'. Please check that the subdirectory exists, or append \"vendor/\" to reference a composer-package.");
}
}
$dependency = $packages[$dependencyName];
$package = new Package($dependency['path'], "@stable", "@stable");
$package->setType('monorepo');
if (isset($dependency['autoload']) && is_array($dependency['autoload'])) {
$package->setAutoload($dependency['autoload']);
}
if (isset($dependency['bin']) && is_array($dependency['bin'])) {
$package->setBinaries($dependency['bin']);
}
if (!$repository->hasPackage($package)) {
$repository->addPackage($package);
$this->resolvePackageDependencies($repository, $packages, $dependencyName);
}
}
}
示例3: bindPackageValues
/**
* @param string $newName
* @param array $package
* @return Package
*/
protected static function bindPackageValues($newName, array $package)
{
$new = new Package($newName, $package['version'], $package['version']);
$new->setType('dist');
if (isset($package['bin'])) {
$new->setBinaries($package['bin']);
}
if (isset($package['dist']['type'])) {
$new->setDistType($package['dist']['type']);
}
if (isset($package['dist']['url'])) {
$new->setDistUrl($package['dist']['url']);
}
if (isset($package['excludes'])) {
$new->setArchiveExcludes($package['excludes']);
}
return $new;
}