當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Package::setProvides方法代碼示例

本文整理匯總了PHP中Composer\Package\Package::setProvides方法的典型用法代碼示例。如果您正苦於以下問題:PHP Package::setProvides方法的具體用法?PHP Package::setProvides怎麽用?PHP Package::setProvides使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Package\Package的用法示例。


在下文中一共展示了Package::setProvides方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dataPackages

 public function dataPackages()
 {
     $metapackage = new Package('vendor/name', '1.0.0.0', '1.0');
     $metapackage->setType('metapackage');
     $package1 = new Package('vendor/name', '1.0.0.0', '1.0');
     $package2 = new Package('vendor/name', 'dev-master', 'dev-master');
     $package3 = new Package('othervendor/othername', '1.0.0.0', '1.0');
     $package3->setProvides([new Link('', 'vendor/name')]);
     $data = [];
     $data['metapackage'] = [true, $metapackage, []];
     $data['skipDev is true, but package is not'] = [false, $package1, ['skip-dev' => 1]];
     $data['skipDev is true, package isDev'] = [true, $package2, ['skip-dev' => 1]];
     $data['package in whitelist'] = [false, $package1, ['whitelist' => ['vendor/name']]];
     $data['package not in whitelist'] = [true, $package1, ['whitelist' => ['othervendor/othername']]];
     $data['package in blacklist'] = [true, $package1, ['blacklist' => ['vendor/name']]];
     $data['package not in blacklist'] = [false, $package1, ['blacklist' => ['othervendor/othername']]];
     $data['package provides a virtual package in blacklist'] = [true, $package3, ['blacklist' => ['vendor/name']]];
     return $data;
 }
開發者ID:composer,項目名稱:satis,代碼行數:19,代碼來源:ArchiveBuilderHelperTest.php

示例2: dataPackages

 public function dataPackages()
 {
     $metapackage = new Package('vendor/name', '1.0.0.0', '1.0');
     $metapackage->setType('metapackage');
     $package1 = new Package('vendor/name', '1.0.0.0', '1.0');
     $package2 = new Package('vendor/name', 'dev-master', 'dev-master');
     $package3 = new Package('othervendor/othername', '1.0.0.0', '1.0');
     $package3->setProvides(array(new Link('', 'vendor/name')));
     $data = array();
     $data['metapackage'] = array(true, $metapackage, array());
     $data['skipDev is true, but package is not'] = array(false, $package1, array('skip-dev' => 1));
     $data['skipDev is true, package isDev'] = array(true, $package2, array('skip-dev' => 1));
     $data['package in whitelist'] = array(false, $package1, array('whitelist' => array('vendor/name')));
     $data['package not in whitelist'] = array(true, $package1, array('whitelist' => array('othervendor/othername')));
     $data['package in blacklist'] = array(true, $package1, array('blacklist' => array('vendor/name')));
     $data['package not in blacklist'] = array(false, $package1, array('blacklist' => array('othervendor/othername')));
     $data['package provides a virtual package in blacklist'] = array(true, $package3, array('blacklist' => array('vendor/name')));
     return $data;
 }
開發者ID:ausger,項目名稱:satis,代碼行數:19,代碼來源:ArchiveBuilderHelperTest.php


注:本文中的Composer\Package\Package::setProvides方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。