本文整理汇总了PHP中PEAR_PackageFileManager2::addUsesRole方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::addUsesRole方法的具体用法?PHP PEAR_PackageFileManager2::addUsesRole怎么用?PHP PEAR_PackageFileManager2::addUsesRole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_PackageFileManager2
的用法示例。
在下文中一共展示了PEAR_PackageFileManager2::addUsesRole方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
$pfm->setOptions(array('baseinstalldir' => '/', 'filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__) . '/src', 'packagefile' => 'package.xml', 'ignore' => $ignore, 'dir_roles' => array('www' => 'web'), 'simpleoutput' => true, 'addhiddenfiles' => true));
$pfm->setPackage('VIH_Elevforeningen');
$pfm->setSummary('VIH');
$pfm->setDescription('VIH');
$pfm->setUri('http://localhost/');
$pfm->setLicense('LGPL License', 'http://www.gnu.org/licenses/lgpl.html');
$pfm->addMaintainer('lead', 'lsolesen', 'Lars Olesen', 'lars@legestue.net');
$pfm->setPackageType('php');
$pfm->setAPIVersion($version);
$pfm->setReleaseVersion($version);
$pfm->setAPIStability('beta');
$pfm->setReleaseStability('stable');
$pfm->setNotes($notes);
$pfm->addRelease();
$pfm->resetUsesRole();
$pfm->addUsesRole('web', 'Role_Web', 'pearified.com');
$pfm->addPackageDepWithChannel('required', 'Role_Web', 'pearified.com', '1.1.1');
// $pfm->addGlobalReplacement('package-info', '@package-version@', 'version');
$pfm->addReplacement($postinstall_file, 'pear-config', '@php-dir@', 'php_dir');
$pfm->addReplacement($postinstall_file, 'pear-config', '@web-dir@', 'web_dir');
$pfm->addReplacement($postinstall_file, 'pear-config', '@data-dir@', 'data_dir');
$pfm->clearDeps();
$pfm->setPhpDep('5.2.0');
$pfm->setPearinstallerDep('1.5.4');
$pfm->addPackageDepWithChannel('required', 'MDB2', 'pear.php.net', '2.4.0');
$pfm->addPackageDepWithChannel('required', 'MDB2_Driver_mysql', 'pear.php.net', '1.4.0');
$pfm->addPackageDepWithChannel('required', 'Validate', 'pear.php.net', '0.7.0');
$pfm->addPackageDepWithChannel('required', 'Validate_DK', 'pear.php.net', '0.1.1');
$pfm->addPackageDepWithChannel('required', 'Image_Transform', 'pear.php.net', '0.9.0');
$pfm->addPackageDepWithChannel('required', 'HTTP_Upload', 'pear.php.net', '0.9.1');
$pfm->addPackageDepWithChannel('required', 'HTML_QuickForm', 'pear.php.net', '2.0.0');
示例2:
$pkg->setPhpDep('4.3.0');
$pkg->setPearinstallerDep('1.4.2');
// Require custom file role for our web installation
$pkg->addPackageDepWithChannel('required', 'Role_Web', 'pearified.com');
// Geeklog Required Packages. In a 'typcial' for non-core plugins this wouldn't happen and
// instead the plugins would require a specific version of Geeklog. In fact, for non-core
// plugins (e.g. Forum, File Manager, etc) that's exactly what should happen
$pkg->addPackageDepWithChannel('required', 'Geeklog_FCKeditor', 'pear.geeklog.net', '2.3.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Layout_Professional', 'pear.geeklog.net', $currentGeeklogVersion);
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Calendar', 'pear.geeklog.net', '1.0.2');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Links', 'pear.geeklog.net', '1.1.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Polls', 'pear.geeklog.net', '2.0.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Spamx', 'pear.geeklog.net', '1.1.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Staticpages', 'pear.geeklog.net', '1.4.4');
// Define that we will use our custom file role in this script
$pkg->addUsesRole('web', 'Webfiles');
// Mapping misc roles to file name extensions
$pkg->addRole('', 'web');
$pkg->addRole('png', 'web');
$pkg->addRole('gif', 'web');
$pkg->addRole('jpeg', 'web');
// Create the current release and add it to the package definition
$pkg->addRelease();
// Package release needs a maintainer
$pkg->addMaintainer('lead', 'tony', 'Tony Bibbs', 'tony@tonybibbs.com');
// Internally generate the XML for our package.xml (does not perform output!)
$test = $pkg->generateContents();
// If called without "make" parameter, we just want to debug the generated package.xml file and
// want to receive additional information on error.
if (isset($argv[1]) and $argv[1] === 'make') {
$pkg->writePackageFile();