当前位置: 首页>>代码示例>>PHP>>正文


PHP PEAR_PackageFileManager2::addConfigureOption方法代码示例

本文整理汇总了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;
}
开发者ID:dong777,项目名称:qrcode,代码行数:47,代码来源:package.php

示例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();
开发者ID:knmasuda,项目名称:php-mecab,代码行数:31,代码来源:package.php

示例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) {
开发者ID:rsky,项目名称:php-gdextra,代码行数:31,代码来源:package.php


注:本文中的PEAR_PackageFileManager2::addConfigureOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。