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


PHP PEAR_PackageFileManager2::setApiVersion方法代码示例

本文整理汇总了PHP中PEAR_PackageFileManager2::setApiVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::setApiVersion方法的具体用法?PHP PEAR_PackageFileManager2::setApiVersion怎么用?PHP PEAR_PackageFileManager2::setApiVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PEAR_PackageFileManager2的用法示例。


在下文中一共展示了PEAR_PackageFileManager2::setApiVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute($arguments = array(), $options = array())
 {
     // Remove E_STRICT and E_DEPRECATED from error_reporting
     error_reporting(error_reporting() & ~(E_STRICT | E_DEPRECATED));
     if (empty($options['channel'])) {
         $options['channel'] = opPluginManager::getDefaultPluginChannelServerName();
     }
     require_once 'PEAR/PackageFileManager2.php';
     $pluginName = $arguments['name'];
     $pluginDirectory = sfConfig::get('sf_plugins_dir') . '/' . $pluginName . '/';
     $info = $this->getPluginManager($options['channel'])->getPluginInfo($pluginName);
     if (!$info) {
         $info = array('n' => $pluginName, 'c' => $options['channel'], 'l' => 'Apache', 's' => $pluginName, 'd' => $pluginName);
     }
     $packageXml = new PEAR_PackageFileManager2();
     $packageOptions = array('packagedirectory' => $pluginDirectory, 'filelistgenerator' => 'file', 'baseinstalldir' => '/');
     $e = $packageXml->setOptions($packageOptions);
     if (PEAR::isError($e)) {
         echo $e->getMessage();
         exit;
     }
     $packageXml->_options['roles'] = array('*' => 'data');
     $maintainers = $this->getPluginManager()->getPluginMaintainer($pluginName);
     foreach ($maintainers as $maintainer) {
         $packageXml->addMaintainer($maintainer['r'], $maintainer['h'], $maintainer['n'], '');
     }
     $packageXml->setPackage($pluginName);
     $packageXml->setChannel($options['channel']);
     $packageXml->setReleaseVersion($arguments['version']);
     $packageXml->setReleaseStability($arguments['stability']);
     $packageXml->setApiVersion($arguments['version']);
     $packageXml->setApiStability($arguments['stability']);
     $packageXml->setNotes($arguments['note']);
     $packageXml->generateContents();
     $packageXml->setPackageType('php');
     $packageXml = $this->setDpendencies($packageXml, $pluginDirectory);
     if (isset($info['l'])) {
         $packageXml->setLicense($info['l']);
     }
     if (isset($info['s'])) {
         $packageXml->setSummary($info['s']);
     }
     if (isset($info['d'])) {
         $packageXml->setDescription($info['d']);
     }
     $e = $packageXml->writePackageFile();
     if (PEAR::isError($e)) {
         echo $e->getMessage();
         exit;
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:51,代码来源:opPluginDefineTask.class.php

示例2: execute

 protected function execute($arguments = array(), $options = array())
 {
     // Remove E_STRICT and E_DEPRECATED from error_reporting
     error_reporting(error_reporting() & ~(E_STRICT | E_DEPRECATED));
     require_once 'PEAR/PackageFileManager2.php';
     $pluginName = $arguments['name'];
     $info = $this->getPluginManager()->getPluginInfo($pluginName);
     if (!$info) {
         $info = array('n' => $pluginName, 'c' => opPluginManager::OPENPNE_PLUGIN_CHANNEL, 'l' => 'Apache', 's' => $pluginName, 'd' => $pluginName);
     }
     $packageXml = new PEAR_PackageFileManager2();
     $options = array('packagedirectory' => sfConfig::get('sf_plugins_dir') . '/' . $pluginName . '/', 'filelistgenerator' => 'file', 'baseinstalldir' => '/');
     $e = $packageXml->setOptions($options);
     if (PEAR::isError($e)) {
         echo $e->getMessage();
         exit;
     }
     $packageXml->_options['roles'] = array('*' => 'data');
     $maintainers = $this->getPluginManager()->getPluginMaintainer($pluginName);
     foreach ($maintainers as $maintainer) {
         $packageXml->addMaintainer($maintainer['r'], $maintainer['h'], $maintainer['n'], '');
     }
     $packageXml->setPackage($pluginName);
     $packageXml->setChannel(opPluginManager::OPENPNE_PLUGIN_CHANNEL);
     $packageXml->setReleaseVersion($arguments['version']);
     $packageXml->setReleaseStability($arguments['stability']);
     $packageXml->setApiVersion($arguments['version']);
     $packageXml->setApiStability($arguments['stability']);
     $packageXml->setNotes($arguments['note']);
     $packageXml->setPhpDep('5.2.3');
     $packageXml->setPearinstallerDep('1.4.0');
     $packageXml->addPackageDepWithChannel('package', 'symfony', 'pear.symfony-project.com', '1.2.0');
     $packageXml->generateContents();
     $packageXml->setPackageType('php');
     if (isset($info['l'])) {
         $packageXml->setLicense($info['l']);
     }
     if (isset($info['s'])) {
         $packageXml->setSummary($info['s']);
     }
     if (isset($info['d'])) {
         $packageXml->setDescription($info['d']);
     }
     $e = $packageXml->writePackageFile();
     if (PEAR::isError($e)) {
         echo $e->getMessage();
         exit;
     }
 }
开发者ID:phenom,项目名称:OpenPNE3,代码行数:49,代码来源:opPluginDefineTask.class.php

示例3: dirname

$package = new PEAR_PackageFileManager2();
// Set some default settings
$package->setOptions(array('baseinstalldir' => 'Url', 'packagedirectory' => dirname(__FILE__) . '/Url'));
// Set the Package Name
$package->setPackage('Url_Shortener');
// Set a package summary
$package->setSummary('Shorten URLs with a variety of services.');
// Set a lengthier description
$package->setDescription('Url_Shortener will let you shorten URLs with Bit.ly, is.gd or Tinyurl');
// We don't have a channel yet, but a valid one is required so just use pear.
$package->setChannel('pear.local');
// Set the Package version and stability
$package->setReleaseVersion('0.2.0');
$package->setReleaseStability('alpha');
// Set the API version and stability
$package->setApiVersion('0.1.0');
$package->setApiStability('alpha');
// Add Release Notes
//$package->setNotes('This is the first release of the Url_Shortener package');
$package->setNotes('Repackaged for release on the pear.local channel.');
// Set the package type (This is a PEAR-style PHP package)
$package->setPackageType('php');
// Add a release section
$package->addRelease();
// Add the pecl_http extension as a dependency
$package->addPackageDepWithChannel('required', 'pecl_http', 'pecl.php.net', '1.7.0', false, '1.7.1', false, 'pecl_http');
// Add a maintainer
$package->addMaintainer('lead', 'dshafik', 'Davey Shafik', 'me@daveyshafik.com');
// Set the minimum PHP version on which the code will run
$package->setPhpDep('5.3.6');
// Set the minimum PEAR install requirement
开发者ID:CodeBooks,项目名称:php-master-write-cutting-edge-code,代码行数:31,代码来源:packager.php


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