本文整理汇总了PHP中PEAR_PackageFileManager2::setProvidesExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::setProvidesExtension方法的具体用法?PHP PEAR_PackageFileManager2::setProvidesExtension怎么用?PHP PEAR_PackageFileManager2::setProvidesExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_PackageFileManager2
的用法示例。
在下文中一共展示了PEAR_PackageFileManager2::setProvidesExtension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
EOS;
// 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-unichar-icu', 'Enable ICU-related features. Yes, no or pathname to icu-config.', 'no');
$packagexml->setPhpDep('4.4.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) {
示例2: 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;
}
示例3: array
$package = new PEAR_PackageFileManager2();
$result = $package->setOptions(array('filelistgenerator' => 'cvs', 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagefile' => 'package.xml', 'packagedirectory' => '.', 'clearcontents' => true, 'ignore' => array('package.php', 'package.xml'), 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'tests' => 'test'), 'exceptions' => array('CREDITS' => 'doc', 'EXPERIMENTAL' => 'doc', 'LICENSE' => 'doc', 'TODO' => 'doc')));
if (PEAR::isError($result)) {
echo $result->getMessage();
die;
}
$package->clearDeps();
$package->setPackage('python');
$package->setPackageType('extsrc');
$package->setSummary('Embedded Python');
$package->setDescription($desc);
$package->setChannel('pecl.php.net');
$package->setLicense('MIT License');
$package->addMaintainer('lead', 'jon', 'Jon Parise', 'jon@php.net');
$package->addRelease();
$package->setProvidesExtension('python');
$package->setAPIVersion('0.6.0');
$package->setAPIStability('alpha');
$package->setReleaseVersion($version);
$package->setReleaseStability('alpha');
$package->setNotes($notes);
$package->setPhpDep('5.3.0');
$package->setPearInstallerDep('1.4.3');
$package->generateContents();
if ($_SERVER['argv'][1] == 'commit') {
$result = $package->writePackageFile();
} else {
$result = $package->debugPackageFile();
}
if (PEAR::isError($result)) {
echo $result->getMessage();