本文整理汇总了PHP中PEAR_PackageFileManager2::setChannel方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::setChannel方法的具体用法?PHP PEAR_PackageFileManager2::setChannel怎么用?PHP PEAR_PackageFileManager2::setChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_PackageFileManager2
的用法示例。
在下文中一共展示了PEAR_PackageFileManager2::setChannel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main entrypoint of the task
*/
function main()
{
$pkg = new PEAR_PackageFileManager2();
$e = $pkg->setOptions(array('baseinstalldir' => 'yii', 'packagedirectory' => $this->pkgdir, 'filelistgenerator' => 'file', 'simpleoutput' => true, 'ignore' => array(), 'roles' => array('*' => 'php')));
// PEAR error checking
if (PEAR::isError($e)) {
die($e->getMessage());
}
$pkg->setPackage($this->package);
$pkg->setSummary($this->summary);
$pkg->setDescription($this->pkgdescription);
$pkg->setChannel($this->channel);
$pkg->setReleaseStability($this->state);
$pkg->setAPIStability($this->state);
$pkg->setReleaseVersion($this->version);
$pkg->setAPIVersion($this->version);
$pkg->setLicense($this->license);
$pkg->setNotes($this->notes);
$pkg->setPackageType('php');
$pkg->setPhpDep('5.1.0');
$pkg->setPearinstallerDep('1.4.2');
$pkg->addRelease();
$pkg->addMaintainer('lead', 'qxue', 'Qiang Xue', 'qiang.xue@gmail.com');
$test = $pkg->generateContents();
$e = $pkg->writePackageFile();
if (PEAR::isError($e)) {
echo $e->getMessage();
}
}
示例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));
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;
}
}
示例3: 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;
}
}
示例4: dirname
echo " \$ pear install XML_Serializer-0.20.2\n";
echo " \$ pear install Console_ProgressBar-0.5.2beta\n";
echo " \$ pear install --alldeps PEAR_PackageFileManager2\n\n";
exit(0);
}
include dirname(__FILE__) . '/package-config.php';
$package = new PEAR_PackageFileManager2();
$result = $package->setOptions($options);
if (PEAR::isError($result)) {
echo $result->getMessage();
die(__LINE__ . "\n");
}
$package->setPackage($name);
$package->setSummary($summary);
$package->setDescription($description);
$package->setChannel($channel);
$package->setAPIVersion($version);
$package->setReleaseVersion($version);
$package->setReleaseStability($stability);
$package->setAPIStability($stability);
$package->setNotes($notes);
$package->setPackageType('php');
// this is a PEAR-style php script package
$package->setLicense($license['name'], $license['url']);
foreach ($maintainer as $m) {
$package->addMaintainer($m['role'], $m['handle'], $m['name'], $m['email'], $m['active']);
}
foreach ($dependency as $d) {
$package->addPackageDepWithChannel($d['type'], $d['package'], $d['channel'], $d['version']);
}
$package->setPhpDep($require['php']);
示例5: main
/**
* Main entry point for d51pearpkg2 task
*/
public function main()
{
$package = new PEAR_PackageFileManager2();
$this->_initOptions();
$package->setOptions($this->_options);
$package->setPackage($this->_name->__toString());
$package->setSummary($this->_summary->__toString());
$desc = preg_replace("/^({$this->_description->indention_type}{{$this->_description->indentions_to_remove}}|\t)+/m", '', $this->_description->__toString());
$package->setDescription($desc);
$package->setChannel($this->_channel->__toString());
$package->setAPIVersion($this->_version->api);
$package->setReleaseVersion($this->_version->release);
$package->setAPIStability($this->_stability->api);
$package->setReleaseStability($this->_stability->release);
// TODO: allow different types
$package->setPackageType('php');
$package->addRelease();
if ($this->_dependencies->php !== false) {
$package->setPhpDep($this->_dependencies->php->minimum_version);
} else {
$package->setPhpDep(phpversion());
}
if ($this->_dependencies->pear !== false) {
$package->setPearinstallerDep($this->_dependencies->pear->minimum_version, $this->_dependencies->pear->maximum_version, $this->_dependencies->pear->recommended_version, $this->_dependencies->pear->exclude_version);
} else {
$package->setPearinstallerDep(PEAR_Config::singleton()->getRegistry()->packageInfo('PEAR', 'version'));
}
foreach ($this->_maintainers as $maintainer) {
$package->addMaintainer($maintainer->role, $maintainer->user, $maintainer->name, $maintainer->email, $maintainer->active);
}
// handle dependencies
if (!empty($this->_dependencies)) {
$this->log('adding dependencies');
if (count($this->_dependencies->groups) > 0) {
$this->log('found dependency groups');
foreach ($this->_dependencies->groups as $group) {
$this->log("adding [{$group->name}] :: [{$group->hint}]");
$package->addDependencyGroup($group->name, $group->hint);
foreach ($group->packages as $sub_package) {
$package->addGroupPackageDepWithChannel('subpackage', $group->name, $sub_package->name, $sub_package->channel, '0.0.1');
}
}
}
if (count($this->_dependencies->packages) > 0) {
$this->log('found dependencies');
foreach ($this->_dependencies->packages as $dependency) {
$this->log("adding following dependency: {$dependency->channel}/{$dependency->name}");
$package->addPackageDepWithChannel($dependency->type, $dependency->name, $dependency->channel, $dependency->minimum_version, $dependency->maximum_version, $dependency->recommended_version, $dependency->exclude_version, $dependency->providesextension, $dependency->nodefault);
}
}
if (count($this->_dependencies->extensions) > 0) {
$this->log('adding extension dependencies');
foreach ($this->_dependencies->extensions as $extension) {
$this->log("adding ext dependency for: {$extension->name}");
$package->addExtensionDep($extension->type, $extension->name, $extension->minimum_version, $extension->maximum_version, $extension->recommended_version, $extension->extension);
}
}
}
foreach ($this->_changelogs as $changelog) {
$this->log("adding changelog for prior release [{$changelog->version}]");
$changelog->package = $package;
$package->setChangelogEntry($changelog->version, $changelog->toArray());
if (is_null($this->_notes) && $package->getVersion() == $changelog->version) {
$this->log("no package notes specified, using changelog entry");
$this->_notes = $changelog->contents;
}
}
foreach ($this->_replacements as $replacement) {
$replacement->isValid();
$package->addReplacement($replacement->path, $replacement->type, $replacement->from, $replacement->to);
}
foreach ($this->_globalreplacements as $replacement) {
$replacement->isValid();
$this->log("adding global repalcement: {$replacement->from}");
$package->addGlobalReplacement($replacement->type, $replacement->from, $replacement->to);
}
foreach ($this->_releases as $release) {
$this->log('adding new release');
$package->addRelease();
foreach ($release->install as $install) {
$this->log("installing [{$install->name}] as [{$install->as}]");
$package->addInstallAs($install->name, $install->as);
}
}
$notes = preg_replace("/^( {4}|\t)+/m", '', $this->_notes->__toString());
$package->setNotes($notes);
$package->setLicense($this->_license->license, $this->_license->uri);
// handle PostInstallation
if (!empty($this->_postinstalls)) {
foreach ($this->_postinstalls as $postInstall) {
$postInstallScript = $package->initPostinstallScript($postInstall->script);
$this->log('adding post installation for script : ' . $postInstall->script);
foreach ($postInstall->paramgroups as $paramGroup) {
$this->log('adding parameter group' . $paramGroup->name);
$instructions = $paramGroup->instructions;
if (empty($instructions)) {
$instructions = false;
//.........这里部分代码省略.........
示例6: htmlspecialchars
$description = htmlspecialchars(file_get_contents(dirname(__FILE__) . '/DESCRIPTION'));
$maintainers = explode("\n", trim(file_get_contents(dirname(__FILE__) . '/MAINTAINERS')));
$version = $baseVersion . (isset($argv[3]) ? $argv[3] : '');
$dir = dirname(__FILE__);
$apiVersion = $baseVersion;
$apiStability = $state;
$package = new PEAR_PackageFileManager2();
$result = $package->setOptions(array('license' => 'LGPL', 'filelistgenerator' => 'file', 'ignore' => array('package.php', 'package.xml', '*.tgz', 'var', 'setup.override.php', 'common.ini.override'), 'baseinstalldir' => 'limb/' . $name, 'packagedirectory' => './', 'packagefile' => 'package.xml', 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'tests' => 'test'), 'roles' => array('*' => 'php')));
if (PEAR::isError($result)) {
echo $result->getMessage();
exit(1);
}
$package->setPackage($name);
$package->setSummary($summary);
$package->setDescription($description);
$package->setChannel('pear.limb-project.com');
$package->setAPIVersion($apiVersion);
$package->setReleaseVersion($version);
$package->setReleaseStability($state);
$package->setAPIStability($apiStability);
$package->setNotes($changelog);
$package->setPackageType('php');
$package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.txt');
foreach ($maintainers as $line) {
list($role, $nick, $name, $email, $active) = explode(',', $line);
$package->addMaintainer($role, $nick, $name, $email, $active);
}
$package->setPhpDep('5.1.4');
$package->setPearinstallerDep('1.4.99');
$package->addPackageDepWithChannel('required', 'core', 'pear.limb-project.com', '0.1.3');
$package->addPackageDepWithChannel('required', 'config', 'pear.limb-project.com', '0.2.0');
示例7: dirname
$summary = 'Net_FTP provides an OO interface to the PHP FTP functions plus some additions';
$description = 'Net_FTP allows you to communicate with FTP servers in a more comfortable way
than the native FTP functions of PHP do. The class implements everything natively
supported by PHP and additionally features like recursive up- and downloading,
dircreation and chmodding. It also implements an observer pattern to allow
for example the view of a progress bar.';
$current_notes = '* Fixed Bug #13946: Test Failed : testPutRecursive
* Fixed Bug #14513: Timestamp when using the LS function
* Implemented Request #14773: setPassive possible before connecting';
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'dumpError');
$p2 = new PEAR_PackageFileManager2();
$p2->setOptions(array('baseinstalldir' => '/', 'filelistgenerator' => 'cvs', 'packagedirectory' => dirname(__FILE__), 'include' => array(), 'ignore' => array('package.xml', 'package2.xml', '*.tgz', 'generate*', 'doc*'), 'dir_roles' => array('tests' => 'test', 'example' => 'doc'), 'simpleoutput' => true));
$p2->setPackage('Net_FTP');
$p2->setSummary($summary);
$p2->setDescription($description);
$p2->setChannel('pear.php.net');
$p2->setPackageType('php');
$p2->addGlobalReplacement('package-info', '@package_version@', 'version');
$p2->generateContents();
$p2->setReleaseVersion($current_version);
$p2->setAPIVersion('1.4.0');
$p2->setReleaseStability($current_stability);
$p2->setAPIStability('stable');
$p2->setNotes($current_notes);
$p2->addGlobalReplacement('package-info', '@package_version@', 'version');
$p2->addInstallAs('tests/AllTests.php', 'AllTests.php');
$p2->addInstallAs('tests/Net_FTPTest.php', 'Net_FTPTest.php');
$p2->addInstallAs('tests/config.php.dist', 'config.php.dist');
$p2->addInstallAs('tests/testfile.dat', 'testfile.dat');
$p2->addInstallAs('tests/extensions.ini', 'extensions.ini');
$p2->addRelease();
示例8: exit
*/
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR.php';
PEAR::staticPushErrorHandling(PEAR_ERROR_CALLBACK, create_function('$error', 'var_dump($error); exit();'));
$releaseVersion = '1.0.0';
$releaseStability = 'stable';
$apiVersion = '1.0.0';
$apiStability = 'stable';
$notes = 'The first release of Piece_Unity_Component_ContentLength.';
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagefile' => 'package.xml', 'packagedirectory' => '.', 'ignore' => array('package.php')));
$package->setPackage('Piece_Unity_Component_ContentLength');
$package->setPackageType('php');
$package->setSummary('An output filter which sends a Content-Legnth header. This filter must be added first.');
$package->setDescription('An output filter which sends a Content-Legnth header. This filter must be added first.');
$package->setChannel('pear.piece-framework.com');
$package->setLicense('BSD License (revised)', 'http://www.opensource.org/licenses/bsd-license.php');
$package->setAPIVersion($apiVersion);
$package->setAPIStability($apiStability);
$package->setReleaseVersion($releaseVersion);
$package->setReleaseStability($releaseStability);
$package->setNotes($notes);
$package->setPhpDep('4.3.0');
$package->setPearinstallerDep('1.4.3');
$package->addPackageDepWithChannel('required', 'Piece_Unity', 'pear.piece-framework.com', '1.0.0');
$package->addMaintainer('lead', 'iteman', 'KUBO Atsuhiro', 'iteman@users.sourceforge.net');
$package->addGlobalReplacement('package-info', '@package_version@', 'version');
$package->generateContents();
if (array_key_exists(1, $_SERVER['argv']) && $_SERVER['argv'][1] == 'make') {
$package->writePackageFile();
} else {
示例9: main
public function main()
{
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/Exception.php';
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');
if (!$this->baseDir || !file_exists($this->baseDir)) {
throw new BuildException('Base directory is not defined or does not exist.');
}
if (!$this->buildDir || !file_exists($this->buildDir)) {
throw new BuildException('Build directory is not defined or does not exist.');
}
set_time_limit(0);
$this->log("Adding .keep files to empty directories", PROJECT_MSG_INFO);
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(realpath('samples')), RecursiveIteratorIterator::CHILD_FIRST) as $dir) {
if ($dir->isDir()) {
foreach (new DirectoryIterator($dir->getPathname()) as $d) {
if (!in_array($d->getFilename(), array('.', '..'))) {
continue 2;
}
}
touch($dir->getPathname() . '/.keep');
}
}
$this->log("Building package contents in: {$this->dir}", PROJECT_MSG_INFO);
$version = $this->project->getProperty('agavi.pear.version');
$status = $this->project->getProperty('agavi.status');
// Modify short description. Try to keep under 80 chars width
$shortDesc = <<<EOD
PHP5 MVC Application Framework
EOD;
// Modify long description. Try to keep under 80 chars width
$longDesc = <<<EOD
Agavi is a full-featured MVC-style framework for PHP5 with a strong focus on structure, code reusability and flexibility.
EOD;
$p2 = new PEAR_PackageFileManager2();
$p2->setOptions(array('filelistgenerator' => 'file', 'outputdirectory' => $this->baseDir, 'packagedirectory' => $this->buildDir, 'baseinstalldir' => 'agavi', 'ignore' => array('.svn/'), 'addhiddenfiles' => true, 'dir_roles' => array('/' => 'php', 'bin' => 'script', 'samples' => 'data'), 'installexceptions' => array('bin/agavi-dist' => '/', 'bin/agavi.bat-dist' => '/'), 'exceptions' => array('API_CHANGELOG' => 'doc', 'CHANGELOG' => 'doc', 'COPYRIGHT' => 'doc', 'INSTALL' => 'doc', 'LICENSE' => 'doc', 'LICENSE-AGAVI' => 'doc', 'LICENSE-ICU' => 'doc', 'LICENSE-SCHEMATRON' => 'doc', 'LICENSE-UNICODE_CLDR' => 'doc', 'RELEASE_NOTES' => 'doc', 'UPGRADING' => 'doc')));
$p2->setPackageType('php');
$p2->setPackage('agavi');
$p2->addMaintainer('lead', 'david', 'David Zülke', 'david.zuelke@bitextender.com');
$p2->addMaintainer('developer', 'dominik', 'Dominik del Bondio', 'dominik.del.bondio@bitextender.com');
$p2->addMaintainer('developer', 'felix', 'Felix Gilcher', 'felix.gilcher@bitextender.com');
$p2->addMaintainer('developer', 'impl', 'Noah Fontes', 'nfontes@cynigram.com');
$p2->addMaintainer('developer', 'v-dogg', 'Veikko Mäkinen', 'mail@veikkomakinen.com');
$p2->setChannel('pear.agavi.org');
$p2->setReleaseVersion($version);
$p2->setAPIVersion($version);
$p2->setReleaseStability($status);
$p2->setAPIStability($status);
$p2->setSummary($shortDesc);
$p2->setDescription($longDesc);
$p2->setNotes("To see what's new, please refer to the RELEASE_NOTES. Also, the CHANGELOG contains a full list of changes.\n\nFor installation instructions, consult INSTALL. Information on how to migrate applications written using previous releases can be found in UPGRADING.");
// this must be the most stupid syntax I've ever seen.
$p2->addRelease();
$p2->setOSInstallCondition('windows');
$p2->addInstallAs('bin/agavi.bat-dist', 'agavi.bat');
$p2->addIgnoreToRelease('bin/agavi-dist');
// and the next release... very cool, eh? how utterly stupid is that
$p2->addRelease();
$p2->addInstallAs('bin/agavi-dist', 'agavi');
$p2->addIgnoreToRelease('bin/agavi.bat-dist');
$p2->addPackageDepWithChannel('required', 'phing', 'pear.phing.info', '2.4.0');
$p2->addPackageDepWithChannel('optional', 'PHPUnit', 'pear.phpunit.de', '3.7.0');
$p2->addConflictingPackageDepWithChannel('phing', 'pear.php.net');
$p2->setPhpDep('5.2.0');
$p2->addExtensionDep('required', 'dom');
$p2->addExtensionDep('required', 'libxml');
$p2->addExtensionDep('required', 'SPL');
$p2->addExtensionDep('required', 'Reflection');
$p2->addExtensionDep('required', 'pcre');
$p2->addExtensionDep('optional', 'xsl');
$p2->addExtensionDep('optional', 'tokenizer');
$p2->addExtensionDep('optional', 'session');
$p2->addExtensionDep('optional', 'xmlrpc');
$p2->addExtensionDep('optional', 'PDO');
$p2->addExtensionDep('optional', 'iconv');
$p2->addExtensionDep('optional', 'gettext');
$p2->setPearinstallerDep('1.4.0');
$p2->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.html');
$p2->addReplacement('bin/agavi-dist', 'pear-config', '@PEAR-DIR@', 'php_dir');
$p2->addReplacement('bin/agavi-dist', 'pear-config', '@PHP-BIN@', 'php_bin');
$p2->addReplacement('bin/agavi.bat-dist', 'pear-config', '@PEAR-DIR@', 'php_dir');
$p2->addReplacement('bin/agavi.bat-dist', 'pear-config', '@PHP-BIN@', 'php_bin');
$p2->addReplacement('src/build/build.xml', 'pear-config', '@PEAR-DIR@', 'php_dir');
$p2->generateContents();
try {
$p2->writePackageFile();
} catch (PEAR_Exception $e) {
$this->log("Oops! Caught PEAR Exception: " . $e->getMessage());
}
}
示例10: dirname
$config['api_ver'] = $config['release_ver'];
$config['stability'] = 'beta';
$config['summery'] = 'Panda PHP Error handler';
$config['description'] = 'Panda is PHP Error handler and debug/trace print utility.';
$config['note'] = 'Maintenance release';
$config['dep_php'] = '5.2.0';
$config['pear_ver'] = '1.6.0';
// recommended - makes PEAR_Errors act like exceptions (kind of)
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
//$packagexml->specifySubpackage($p2, false, true);
$packagexml->setOptions(array('filelistgenerator' => 'file', 'packagedirectory' => dirname(dirname(dirname(__FILE__))), 'baseinstalldir' => '/', 'ignore' => array('CVS/', '.svn/', 'package/'), 'exceptions' => array('BEAR/BEAR/bin/bear.sh' => 'script'), 'installexceptions' => array('BEAR/BEAR/bin/bear.sh' => '/'), 'installas' => array('BEAR/BEAR/bin/bear.sh' => 'bear'), 'dir_roles' => array('data' => 'data', 'bin' => 'script', 'inc' => 'php'), 'simpleoutput' => true));
$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->setPackage($config['package']);
$packagexml->setChannel($config['channel']);
$packagexml->setReleaseVersion($config['release_ver']);
$packagexml->setAPIVersion($config['api_ver']);
$packagexml->setReleaseStability($config['stability']);
$packagexml->setAPIStability($config['stability']);
$packagexml->setSummary($config['summery']);
$packagexml->setDescription($config['description']);
$packagexml->setNotes($config['note']);
$packagexml->setPhpDep($config['dep_php']);
$packagexml->setPearinstallerDep($config['pear_ver']);
$packagexml->addMaintainer('lead', 'koriyama', 'Koriyama', 'koriyama@users.sourceforge.jp');
$packagexml->setLicense('The BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->addRole('sh', 'script');
$packagexml->addRole('conf', 'php');
$packagexml->addRole('yml', 'php');
$packagexml->addRole('css', 'php');
示例11: main
/**
* Main entry point for d51pearpkg2 task
*/
public function main()
{
PEAR_Frontend::setFrontendObject(new d51PearPkg2Task_Frontend($this));
$package = new PEAR_PackageFileManager2();
$this->_initOptions();
$a = $package->setOptions($this->_options);
if (PEAR::isError($a)) {
$this->log($a->getMessage(), Project::MSG_ERR);
exit(-1);
}
$package->setPackage((string) $this->_name);
$package->setSummary((string) $this->_summary);
$desc = preg_replace("/^({$this->_description->indention_type}{{$this->_description->indentions_to_remove}}|\t)+/m", '', (string) $this->_description);
$package->setDescription($desc);
$package->setChannel((string) $this->_channel);
$package->setAPIVersion($this->_version->api);
$package->setReleaseVersion($this->_version->release);
$package->setAPIStability($this->_stability->api);
$package->setReleaseStability($this->_stability->release);
// TODO: allow different types
$package->setPackageType($this->_type);
$package->addRelease();
if (!is_null($this->_dependencies->php)) {
$this->log('Using explicit PHP minimum version: ' . $this->_dependencies->php->minimum_version);
$package->setPhpDep($this->_dependencies->php->minimum_version);
} else {
$this->log('Using current PHP version as minimum: ' . phpversion());
$package->setPhpDep(phpversion());
}
if (!is_null($this->_dependencies->pear)) {
$this->log('setting minimum PEAR version: ' . $this->_dependencies->pear->minimum_version);
$package->setPearinstallerDep($this->_dependencies->pear->minimum_version, $this->_dependencies->pear->maximum_version, $this->_dependencies->pear->recommended_version, $this->_dependencies->pear->exclude_version);
} else {
$this->log('setting minimum PEAR version to currently installed version');
$pear_version = PEAR_Config::singleton()->getRegistry()->packageInfo('PEAR', 'version');
$this->log('minimum PEAR version: ' . $pear_version);
$package->setPearinstallerDep(PEAR_Config::singleton()->getRegistry()->packageInfo('PEAR', 'version'));
}
foreach ($this->_maintainers as $maintainer) {
$this->log("adding maintainer [{$maintainer->user}/{$maintainer->name}] with role [{$maintainer->role}]");
$package->addMaintainer($maintainer->role, $maintainer->user, $maintainer->name, $maintainer->email, $maintainer->active);
}
// handle dependencies
if (!empty($this->_dependencies)) {
$this->log('adding dependencies');
if (count($this->_dependencies->groups) > 0) {
$this->log('found dependency groups');
foreach ($this->_dependencies->groups as $group) {
$this->log("adding [{$group->name}] :: [{$group->hint}]");
$package->addDependencyGroup($group->name, $group->hint);
foreach ($group->packages as $sub_package) {
$package->addGroupPackageDepWithChannel('subpackage', $group->name, $sub_package->name, $sub_package->channel, '0.0.1');
}
}
}
if (count($this->_dependencies->packages) > 0) {
$this->log('found dependencies');
foreach ($this->_dependencies->packages as $dependency) {
$this->log("adding following dependency: {$dependency->channel}/{$dependency->name}");
$package->addPackageDepWithChannel($dependency->type, $dependency->name, $dependency->channel, $dependency->minimum_version, $dependency->maximum_version, $dependency->recommended_version, $dependency->exclude_version, $dependency->providesextension, $dependency->nodefault);
}
}
if (count($this->_dependencies->extensions) > 0) {
$this->log('adding extension dependencies');
foreach ($this->_dependencies->extensions as $extension) {
$this->log("adding ext dependency for: {$extension->name}");
$package->addExtensionDep($extension->type, $extension->name, $extension->minimum_version, $extension->maximum_version, $extension->recommended_version, $extension->extension);
}
}
}
foreach ($this->_changelogs as $changelog) {
$this->log("adding changelog for prior release [{$changelog->version}]");
$changelog->package = $package;
$package->setChangelogEntry($changelog->version, $changelog->toArray());
if (is_null($this->_notes) && $package->getVersion() == $changelog->version) {
$this->log("no package notes specified, using changelog entry");
$this->_notes = $changelog->contents;
}
}
foreach ($this->_replacements as $replacement) {
$replacement->isValid();
$this->log("adding replace from [{$replacement->from}] to [{$replacement->to}]");
$package->addReplacement($replacement->path, $replacement->type, $replacement->from, $replacement->to);
}
foreach ($this->_releases as $release) {
$this->log('adding new release');
$package->addRelease();
foreach ($release->install as $install) {
$this->log("installing [{$install->name}] as [{$install->as}]");
$package->addInstallAs($install->name, $install->as);
}
}
$notes = preg_replace("/^( {4}|\t)+/m", '', (string) $this->_notes);
$package->setNotes($notes);
$package->setLicense($this->_license->license, $this->_license->uri);
$package->generateContents();
$e = $package->writePackageFile();
//.........这里部分代码省略.........
示例12: dirname
* @link http://pear.php.net/package/PEAR_PackageFileManager
* @since File available since Release 1.6.0
* @ignore
*/
/**
* This is the only setup function needed
*/
require_once 'PEAR/PackageFileManager2.php';
// recommended - makes PEAR_Errors act like exceptions (kind of)
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__) . "/src", 'baseinstalldir' => 'PEAR', 'simpleoutput' => true));
$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->setPackage('ChainRecord');
$packagexml->setChannel('__uri');
$packagexml->setReleaseVersion('0.1.0');
$packagexml->setAPIVersion('0.1.0');
$packagexml->setReleaseStability('alpha');
$packagexml->setAPIStability('alpha');
$packagexml->setSummary('Object-Relation Mapper for php with Method Chain.');
$packagexml->setDescription('Database Access Library for php 5.2.x');
$packagexml->setNotes('Initial release');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.4.0a12');
$packagexml->addPackageDepWithChannel('required', 'PEAR_PackageFileManager', 'pear.php.net', '1.5.1');
$packagexml->addMaintainer('lead', 'hirakiuc', 'Daisuke Hirakiuchi', 'hirakiuc@gmail.com');
$packagexml->setLicense('MIT License', 'http://www.opensource.org/licenses/mit-license.php');
$packagexml->addGlobalReplacement('package-info', '@PEAR-VER@', 'version');
$packagexml->generateContents();
//$pkg = &$packagexml->exportCompatiblePackageFile1();
示例13: realpath
$outsideDir = realpath(dirname(dirname(__FILE__)));
$version = trim(file_get_contents($outsideDir . '/VERSION'));
$api_version = $version;
$api_state = 'beta';
$release_version = $version;
$release_state = 'beta';
$release_notes = "This is an alpha release, see readme.md for examples.";
$summary = "A PHP library for swagger resource generation";
$readme = dirname(__DIR__) . '/readme.md';
$description = file_get_contents($readme);
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'outputdirectory' => dirname(dirname(__FILE__)), 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => $outsideDir, 'dir_roles' => array('benchmarks' => 'doc', 'bin' => 'script', 'examples' => 'doc', 'library' => 'php', 'library/Swagger' => 'php', 'tests' => 'test'), 'exceptions' => array('CHANGELOG' => 'doc', 'readme.md' => 'doc', 'VERSION' => 'doc', 'LICENSE-2.0.txt' => 'doc'), 'ignore' => array('build/*', 'package.xml', 'build.xml', 'scripts/*', '.git', '.gitignore', 'tests/phpunit.xml', 'tests/build*', '.project', '.buildpath', 'releases', '.settings', 'vendor/*', '*.iml', 'composer.*', '*.tgz')));
$package->setPackage('Swagger');
$package->setSummary($summary);
$package->setDescription($description);
$package->setChannel('zircote.com/pear');
$package->setPackageType('php');
$package->setLicense('Apache 2.0', 'http://www.apache.org/licenses/LICENSE-2.0');
$package->setNotes($release_notes);
$package->setReleaseVersion($release_version);
$package->setReleaseStability($release_state);
$package->setAPIVersion($api_version);
$package->setAPIStability($api_state);
/**
* Dependencies
*/
$maintainers = array(array('name' => 'Robert Allen', 'user' => 'zircote', 'email' => 'zircote@gmail.com', 'role' => 'lead'));
foreach ($maintainers as $_m) {
$package->addMaintainer($_m['role'], $_m['user'], $_m['name'], $_m['email']);
}
$files = array();
示例14: array
exit;
}
$api_version = '0.4.1';
$api_state = 'beta';
$release_version = '0.4.1';
$release_state = 'beta';
$release_notes = "Small bugfixes:\n";
$release_notes .= "https://github.com/easybib/EasyBib_Form_Decorator/pulls?direction=desc&page=1&sort=created&state=closed\n";
$description = "EasyBib_Form Decorator supports four modes: \n" . " * Table \n" . " * Div \n" . " * Twitter Bootstrap \n\n" . " * Twitter Bootstrap Minimal \n\n" . "The default is 'Twitter Bootstrap'.\n";
/** @var PEAR_PackageFile_v2_rw $package */
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('library' => 'php', 'tests' => 'test', 'docs' => 'doc'), 'exceptions' => array('README.md' => 'doc'), 'ignore' => array('.git*', 'generate-package.php', '*.tgz', 'composer.*', 'vendor/')));
$package->setPackage('EasyBib_Form_Decorator');
$package->setSummary('A set of decorators for Zend_Form');
$package->setDescription($description);
$package->setChannel('easybib.github.com/pear');
$package->setPackageType('php');
$package->setLicense('MIT', 'http://www.opensource.org/licenses/mit-license.php');
$package->setNotes($release_notes);
$package->setReleaseVersion($release_version);
$package->setReleaseStability($release_state);
$package->setAPIVersion($api_version);
$package->setAPIStability($api_state);
$package->addMaintainer('lead', 'mischosch', 'Michael Scholl', 'michael@sch0ll.de');
$package->addMaintainer('lead', 'till', 'Till Klampaeckel', 'till@lagged.biz');
/**
* Generate the list of files in {@link $GLOBALS['files']}
*
* @param string $path
*
* @return void
示例15: array
* @version $Id$
*/
chdir("./trax/");
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/Packager.php';
require_once './vendor/trax/inflector.php';
require_once './vendor/trax/trax.php';
$trax_version = Trax::version();
$packagexml = new PEAR_PackageFileManager2();
// Set package options
$e = $packagexml->setOptions(array('baseinstalldir' => 'PHPonTrax', 'packagedirectory' => '.', 'filelistgenerator' => 'file', 'simpleoutput' => true, 'addhiddenfiles' => true, 'dir_roles' => array('doc' => 'doc', 'test' => 'test', 'data' => 'data'), 'exceptions' => array('pear-trax' => 'script', 'pear-trax.bat' => 'script', 'vendor/trax/templates/error.phtml' => 'php', 'vendor/trax/templates/view.phtml' => 'php', 'vendor/trax/templates/mailer_view.phtml' => 'php', 'vendor/trax/templates/scaffolds/add.phtml' => 'php', 'vendor/trax/templates/scaffolds/edit.phtml' => 'php', 'vendor/trax/templates/scaffolds/index.phtml' => 'php', 'vendor/trax/templates/scaffolds/layout.phtml' => 'php', 'vendor/trax/templates/scaffolds/show.phtml' => 'php', 'vendor/trax/templates/scaffolds/scaffold.css' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/form_scaffolding.phtml' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/layout.phtml' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/view_add.phtml' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/view_edit.phtml' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/view_index.phtml' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/view_show.phtml' => 'php', 'vendor/trax/templates/scaffolds/generator_templates/style.css' => 'php'), 'installexceptions' => array('pear-trax' => '/', 'dispatch.php' => 'public')));
$packagexml->setPackage('PHPonTrax');
$packagexml->setSummary('Rapid Application Development Made Easy');
$packagexml->setDescription('PHP port of Ruby on Rails');
$packagexml->setNotes('We\'ve implemented many new and exciting features');
$packagexml->setChannel('pear.phpontrax.com');
$packagexml->setReleaseVersion($trax_version);
$packagexml->setAPIVersion($trax_version);
$packagexml->setReleaseStability('stable');
$packagexml->setAPIStability('stable');
$packagexml->setLicense('MIT License', 'http://www.opensource.org/licenses/mit-license.php');
$packagexml->setPackageType('php');
// this is a PEAR-style php script package
// Depends on PHP 5
$packagexml->setPhpDep('5.1.2');
// Depends on Pear 1.4.0 or greater
$packagexml->setPearinstallerDep('1.4.0');
// Depends on these PEAR packages
# added these to when you create a new app into the vendor folder
#$packagexml->addPackageDepWithChannel('required', 'MDB2', 'pear.php.net', '2.0');
#$packagexml->addPackageDepWithChannel('required', 'Mail', 'pear.php.net', '1.0');