本文整理汇总了PHP中PEAR_PackageFileManager2::addConfigureOption方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::addConfigureOption方法的具体用法?PHP PEAR_PackageFileManager2::addConfigureOption怎么用?PHP PEAR_PackageFileManager2::addConfigureOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_PackageFileManager2
的用法示例。
在下文中一共展示了PEAR_PackageFileManager2::addConfigureOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initialize PackageFileManager
*
* @param array $cfg
* @return PEAR_PackageFileManager2
*/
function init(array $cfg)
{
extract($cfg);
$package = new \PEAR_PackageFileManager2();
$package->setOptions($options);
$package->setPackage($name);
$package->setSummary($summary);
$package->setNotes($notes);
$package->setDescription($description);
$package->setLicense($license, $licenseUri);
$package->setReleaseVersion($version);
$package->setAPIVersion($apiVersion);
$package->setReleaseStability($stability);
$package->setAPIStability($apiStability);
foreach ($maintainers as $maintainer) {
$package->addMaintainer($maintainer['role'], $maintainer['handle'], $maintainer['name'], $maintainer['email'], $maintainer['active'] ?: 'yes');
}
$package->setPackageType($type);
if (strpos($type, 'ext') !== false) {
$package->setProvidesExtension($name);
if (strpos($type, 'extsrc') !== false && isset($configureOptions)) {
foreach ($configureOptions as $configureOption) {
$package->addConfigureOption($configureOption['name'], $configureOption['prompt'], $configureOption['default']);
}
}
}
$package->setPhpDep($phpDep);
$package->setPearinstallerDep($pearDep);
if (isset($packageDeps)) {
foreach ($packageDeps as $packageDeps) {
$min = $packageDeps['min'] ?: false;
$max = $packageDeps['max'] ?: false;
$recommended = $packageDeps['recommended'] ?: false;
$exclude = $packageDeps['exclude'] ?: false;
$nodefault = $packageDeps['nodefault'] ?: false;
$package->addSubpackageDepWithChannel($packageDeps['type'], $packageDeps['name'], $packageDeps['channel'], $min, $max, $recommended, $exclude, $nodefault);
}
}
$package->setChannel($channel);
return $package;
}
示例2: dirname
// set parameters to the package
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('baseinstalldir' => '/', 'packagedirectory' => dirname(__FILE__), 'filelistgenerator' => 'file', 'ignore' => array('package.php', 'package.xml', "{$packagename}-{$version}.tgz"), 'dir_roles' => array('tests' => 'test', 'manual' => 'doc', 'examples' => 'data'), 'exceptions' => array("{$packagename}.dsp" => 'src', 'CREDITS' => 'doc', 'EXPERIMENTAL' => 'doc', 'LICENSE' => 'doc', 'README' => 'doc')));
$packagexml->setPackage($packagename);
$packagexml->setSummary($summary);
$packagexml->setNotes($notes);
$packagexml->setDescription($description);
$packagexml->setLicense('MIT License', 'http://www.opensource.org/licenses/mit-license.php');
$packagexml->setReleaseVersion($version);
$packagexml->setAPIVersion($apiversion);
$packagexml->setReleaseStability($stability);
$packagexml->setAPIStability($apistability);
$packagexml->addMaintainer('lead', 'rsk', 'Ryusuke SEKIYAMA', 'rsky0711@gmail.com');
$packagexml->setPackageType('extsrc');
$packagexml->setProvidesExtension($packagename);
$packagexml->addConfigureOption('with-mecab', 'specify pathname to mecab-config', 'no');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.4.1');
$packagexml->setChannel($channel);
$packagexml->generateContents();
// generate package.xml
if (php_sapi_name() === 'cli' && $_SERVER['argc'] > 1 && $_SERVER['argv'][1] === 'make') {
$make = true;
} elseif (!empty($_GET['make'])) {
$make = true;
} else {
$make = false;
}
// note use of debugPackageFile() - this is VERY important
if ($make) {
$packagexml->writePackageFile();
示例3: dirname
// set parameters to the package
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('baseinstalldir' => '/', 'packagedirectory' => dirname(__FILE__), 'filelistgenerator' => 'file', 'ignore' => array('package.php', 'package.xml', "{$packagename}-{$version}.tgz"), 'dir_roles' => array('tests' => 'test', 'manual' => 'doc', 'examples' => 'data'), 'exceptions' => array("{$packagename}.dsp" => 'src', 'CREDITS' => 'doc', 'EXPERIMENTAL' => 'doc', 'LICENSE' => 'doc', 'README' => 'doc')));
$packagexml->setPackage($packagename);
$packagexml->setSummary($summary);
$packagexml->setNotes($notes);
$packagexml->setDescription($description);
$packagexml->setLicense('MIT License', 'http://www.opensource.org/licenses/mit-license.php');
$packagexml->setReleaseVersion($version);
$packagexml->setAPIVersion($apiversion);
$packagexml->setReleaseStability($stability);
$packagexml->setAPIStability($apistability);
$packagexml->addMaintainer('lead', 'rsk', 'Ryusuke SEKIYAMA', 'rsky0711@gmail.com');
$packagexml->setPackageType('extsrc');
$packagexml->setProvidesExtension($packagename);
$packagexml->addConfigureOption('with-gdextra-lqr', 'Enable liquid rescaling support. Yes, no or liblqr install prefix.', 'no');
$packagexml->addConfigureOption('with-gdextra-magick', 'Enable ImageMagick image loader support. Yes, no or pathname to Wand-config.', 'no');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.4.1');
$packagexml->setChannel($channel);
$packagexml->generateContents();
// generate package.xml
if (php_sapi_name() === 'cli' && $_SERVER['argc'] > 1 && $_SERVER['argv'][1] === 'make') {
$make = true;
} elseif (!empty($_GET['make'])) {
$make = true;
} else {
$make = false;
}
// note use of debugPackageFile() - this is VERY important
if ($make) {