本文整理汇总了PHP中PEAR_PackageFileManager2::setAPIVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2::setAPIVersion方法的具体用法?PHP PEAR_PackageFileManager2::setAPIVersion怎么用?PHP PEAR_PackageFileManager2::setAPIVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_PackageFileManager2
的用法示例。
在下文中一共展示了PEAR_PackageFileManager2::setAPIVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main entrypoint of the task
*/
function main()
{
$pkg = new PEAR_PackageFileManager2();
$e = $pkg->setOptions(array('baseinstalldir' => 'prado', 'packagedirectory' => $this->pkgdir, 'pathtopackagefile' => $this->pkgdir, 'filelistgenerator' => 'file', 'simpleoutput' => true, 'ignore' => array(), 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'framework' => 'php', 'framework/js' => 'doc', 'framework/3rdParty' => 'doc'), 'exceptions' => array('requirements.php' => 'doc')));
// 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.0.0');
$pkg->setPearinstallerDep('1.4.2');
$pkg->addRelease();
$pkg->addMaintainer('lead', 'qxue', 'Qiang (Charlie) Xue', 'qiang.xue@gmail.com');
$test = $pkg->generateContents();
$e = $pkg->writePackageFile();
if (PEAR::isError($e)) {
echo $e->getMessage();
}
}
示例2: array
<?php
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT);
require_once "PEAR/PackageFileManager2.php";
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array("outputdirectory" => ".", "filelistgenerator" => "file", "packagefile" => "package_pman.xml", "packagedirectory" => "output/", "baseinstalldir" => "php.net/", "simpleoutput" => true, "roles" => array("sh" => "script"), "dir_roles" => array("man3" => "doc"), "ignore" => array("index.sqlite", "man3/DomDocument.xinclude.3.gz")));
$packagexml->setPackage("pman");
$packagexml->setSummary("PHP Unix manual pages");
$packagexml->setDescription("Unix manual pages of the PHP documentations from php.net.");
$packagexml->setChannel("doc.php.net");
$packagexml->setAPIVersion("1.0.0");
$packagexml->setReleaseVersion(date("Y.m.d"));
$packagexml->setReleaseStability("stable");
$packagexml->setAPIStability("stable");
$packagexml->setLicense("Creative Commons Attribution 3.0", "http://creativecommons.org/licenses/by/3.0/");
$packagexml->setNotes("New release \\o/");
$packagexml->setPackageType("php");
$packagexml->addRelease();
$packagexml->setPhpDep("5.0.0");
$packagexml->setPearinstallerDep("1.9.0");
$packagexml->addExtensionDep("required", "zlib");
$packagexml->addMaintainer("lead", "phpdoc", "The PHP Documentation team", "phpdoc@lists.php.net");
rename("output/php-functions", "output/man3");
copy(__DIR__ . "/pman.sh", "output/pman.sh");
$packagexml->addReplacement("pman.sh", "pear-config", "@doc_dir@", "doc_dir");
$packagexml->addInstallAs("pman.sh", "pman");
$packagexml->generateContents();
$packagexml->writePackageFile();
rename("output/pman.sh", "pman.sh");
rename("output/man3", "man3");
示例3: array
<?php
error_reporting(E_ALL & ~E_DEPRECATED);
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('baseinstalldir' => '/', 'simpleoutput' => true, 'packagedirectory' => './', 'filelistgenerator' => 'file', 'ignore' => array('runTests.php', 'generatePackage.php', 'phpunit-bootstrap.php', 'phpunit.xml', 'README', 'coverage*'), 'dir_roles' => array('tests' => 'test', 'examples' => 'doc')));
$packagexml->setPackage('HTTP_OAuth');
$packagexml->setSummary('PEAR implementation of the OAuth 1.0a specification');
$packagexml->setDescription('Allows the use of the consumer and provider angles of the OAuth 1.0a specification');
$packagexml->setChannel('pear.php.net');
$packagexml->setAPIVersion('0.2.0');
$packagexml->setReleaseVersion('0.2.3');
$packagexml->setReleaseStability('alpha');
$packagexml->setAPIStability('alpha');
$packagexml->setNotes('* Fixed GH issue #10. don\'t use reset() to get the first array value
* Disabled E_DEPRECTED error logging when creating packages
');
$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->detectDependencies();
$packagexml->addMaintainer('lead', 'jeffhodsdon', 'Jeff Hodsdon', 'jeffhodsdon@gmail.com');
$packagexml->addMaintainer('lead', 'shupp', 'Bill Shupp', 'shupp@php.net');
$packagexml->setLicense('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->setPhpDep('5.1.2');
$packagexml->setPearinstallerDep('1.4.0');
$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0');
$packagexml->addPackageDepWithChannel('required', 'HTTP_Request2', 'pear.php.net', '0.5.1');
$packagexml->addPackageDepWithChannel('optional', 'Log', 'pear.php.net');
$packagexml->addPackageDepWithChannel('optional', 'Cache_Lite', 'pear.php.net');
$packagexml->addExtensionDep('required', 'date');
示例4: array
EOT;
$description = <<<EOT
Tumblr blog integration with Site package.
EOT;
$package = new PEAR_PackageFileManager2();
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$result = $package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('Sniftr' => 'php', 'locale' => 'data', 'www' => 'data', 'dependencies' => 'data', '/' => 'data')));
$package->setPackage('Sniftr');
$package->setSummary('Tumblr blog integration for Site package.');
$package->setDescription($description);
$package->setChannel('pear.silverorange.com');
$package->setPackageType('php');
$package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.html');
$package->setReleaseVersion($version);
$package->setReleaseStability('alpha');
$package->setAPIVersion('0.1.0');
$package->setAPIStability('alpha');
$package->setNotes($notes);
$package->addIgnore('package.php');
$package->addMaintainer('lead', 'gauthierm', 'Mike Gauthier', 'mike@silverorange.com');
$package->addReplacement('Sniftr/Sniftr.php', 'pear-config', '@DATA-DIR@', 'data_dir');
$package->setPhpDep('5.3.0');
$package->setPearinstallerDep('1.4.0');
$package->addPackageDepWithChannel('required', 'Site', 'pear.silverorange.com', '1.5.25');
$package->addExtensionDep('required', 'curl');
$package->addExtensionDep('required', 'simplexml');
$package->generateContents();
if (isset($_GET['make']) || isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make') {
$package->writePackageFile();
} else {
$package->debugPackageFile();
示例5: 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());
}
}
示例6: 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;
}
示例7: array
This class provides an object oriented interface for
asynchronous server side PHP calls from client side
javascript without the need for a full page request.
EOT;
$package = new PEAR_PackageFileManager2();
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$result = $package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('www' => 'data', 'dependencies' => 'data', 'tests' => 'test'), 'exceptions' => array('README.md' => 'doc')));
$package->setPackage('XML_RPCAjax');
$package->setSummary('XML-RPC client implementation using AJAX');
$package->setDescription($description);
$package->setChannel('pear.silverorange.com');
$package->setPackageType('php');
$package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.html');
$package->setReleaseVersion($version);
$package->setReleaseStability('stable');
$package->setAPIVersion('0.0.1');
$package->setAPIStability('stable');
$package->setNotes($notes);
$package->addIgnore('package.php');
$package->addIgnore('deprecated');
$package->addMaintainer('lead', 'nrf', 'Nathan Fredrickson', 'nathan@silverorange.com');
$package->addMaintainer('lead', 'gauthierm', 'Mike Gauthier', 'mike@silverorange.com');
$package->setPhpDep('5.1.5');
$package->setPearinstallerDep('1.4.0');
$package->addPackageDepWithChannel('required', 'Swat', 'pear.silverorange.com', '0.9.4');
$package->generateContents();
if (isset($_GET['make']) || isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make') {
$package->writePackageFile();
} else {
$package->debugPackageFile();
}
示例8: dirname
// no E_STRICT
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('baseinstalldir' => '/', 'packagedirectory' => dirname(__FILE__), 'filelistgenerator' => 'file', 'ignore' => array('TODO'), 'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc')));
$packagexml->setPackage('sfEasyGMapPlugin');
$packagexml->setSummary('An easy, object-oriented, PHP abstraction of the Google Maps API');
$packagexml->setDescription('The sfEasyGMap plugin provides helpers and an objet-oriented PHP abstraction to the Google Maps API to ease the process of adding a Google Map and customising it in your symfony projects.');
$packagexml->setChannel('plugins.symfony-project.org');
$packagexml->addMaintainer('lead', 'fabriceb', 'Fabrice Bernhard', 'fabriceb@theodo.fr');
$packagexml->addMaintainer('developer', 'vincentg', 'Vincent Guillon', 'vincentg@theodo.fr');
$packagexml->addMaintainer('developer', 'laurentb', 'Laurent Bachelier', 'laurentb@theodo.fr');
$packagexml->addMaintainer('developer', 'chok', 'Maxime Picaud', 'chokorp@gmail.com');
$packagexml->setLicense('MIT License', 'http://www.symfony-project.org/license');
// This will ADD a changelog entry to an existing package.xml
$packagexml->setAPIVersion('3.1.0');
$packagexml->setReleaseVersion('3.1.0');
$packagexml->setNotes('
* corrected package.xml
* added GMapDirections functionalities
');
$packagexml->setReleaseStability('stable');
$packagexml->setAPIStability('stable');
$packagexml->addRelease();
$packagexml->setPackageType('php');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.4.1');
// Supported versions of Symfony
$packagexml->addPackageDepWithChannel('required', 'symfony', 'pear.symfony-project.com', '1.0.0', '1.3.0');
$packagexml->generateContents();
// Add the files
示例9: array
<?php
error_reporting(E_ALL & ~E_DEPRECATED);
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('baseinstalldir' => '/', 'simpleoutput' => true, 'packagedirectory' => './', 'filelistgenerator' => 'file', 'ignore' => array('phpunit-bootstrap.php', 'phpunit.xml', 'test.php', 'generatePackage.php'), 'dir_roles' => array('tests' => 'test', 'examples' => 'doc')));
$packagexml->setPackage('OpenID');
$packagexml->setSummary('PHP implementation of OpenID 1.1 and 2.0');
$packagexml->setDescription('OpenID is a free and easy way to use a single digital identity across the ' . 'Internet. See http://openid.net for details.');
$packagexml->setChannel('pear.php.net');
$packagexml->setAPIVersion('0.3.3');
$packagexml->setReleaseVersion('0.3.3');
$packagexml->setReleaseStability('alpha');
$packagexml->setAPIStability('alpha');
$packagexml->setNotes('
* Fix bug #19234: Normalization of identifiers/openID not implemented correctly
* Some doc block fixes
');
$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->detectDependencies();
$packagexml->addMaintainer('lead', 'shupp', 'Bill Shupp', 'shupp@php.net');
$packagexml->setLicense('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->setPhpDep('5.1.2');
$packagexml->setPearinstallerDep('1.4.0b1');
$packagexml->addPackageDepWithChannel('required', 'HTTP_Request2', 'pear.php.net', '0.5.1');
$packagexml->addPackageDepWithChannel('required', 'Cache_Lite', 'pear.php.net');
$packagexml->addPackageDepWithChannel('required', 'Crypt_DiffieHellman', 'pear.php.net');
$packagexml->addPackageDepWithChannel('required', 'Services_Yadis', 'pear.php.net', '0.5.1');
$packagexml->addPackageDepWithChannel('optional', 'Log', 'pear.php.net');
示例10: dirname
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();
$p2->addMaintainer('lead', 'jorrit', 'Jorrit Schippers', 'jschippers@php.net', 'yes');
$p2->addMaintainer('lead', 'toby', 'Tobias Schlitt', 'toby@php.net', 'no');
$p2->setPhpDep('4.3.0');
$p2->setPearinstallerDep('1.3.0');
$p2->setLicense('BSD License', 'http://www.opensource.org/licenses/bsd-license.html');
示例11:
4. Netwon-Raphson
5. Netwon-Raphson 2
6. Ralston-Rabinowitz
7. Secant
EOT;
$notes = <<<EOT
* Request #2897: added new parameter \$guess to validateEqFunction()
* Added unit tests
* Examples files renamed to lower case
EOT;
// Some hard-coded stuffs.
$pkg->setPackage('Math_Numerical_RootFinding');
$pkg->setSummary($summary);
$pkg->setDescription($desc);
$pkg->setChannel('pear.php.net');
$pkg->setAPIVersion('1.0');
$pkg->setReleaseVersion('1.1.0a1');
$pkg->setReleaseStability('alpha');
$pkg->setAPIStability('alpha');
$pkg->setNotes($notes);
$pkg->setPackageType('php');
$pkg->setLicense('BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
// Add maintainers.
$pkg->addMaintainer('lead', 'firman', 'Firman Wandayandi', 'firman@php.net', 'yes');
$pkg->addMaintainer('lead', 'mfonda', 'Matthew Fonda', 'mfonda@php.net', 'yes');
// Core dependencies.
$pkg->setPhpDep('4.3.0');
$pkg->setPearinstallerDep('1.4.0');
// Add some replacements.
$pkg->addGlobalReplacement('package-info', '@package_version@', 'version');
// Generate file contents.
示例12: 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();
//.........这里部分代码省略.........
示例13: die
$pkg->addReplacement('public_html/lib-common.php', 'pear-config', '@WEB_DIR@', 'web_dir');
$pkg->addReplacement('public_html/lib-common.php', 'package-info', '@PACKAGE@', 'name');
// PEAR error checking
if (PEAR::isError($e)) {
die($e->getMessage());
}
// Choices for this are alpha, beta and stable.
$pkg->setReleaseStability('stable');
// Set misc package information. You shouldn't have to ever change these.
$pkg->setPackage($package);
$pkg->setSummary($summary);
$pkg->setDescription($description);
$pkg->setChannel($channel);
$pkg->setAPIStability('stable');
$pkg->setReleaseVersion($version);
$pkg->setAPIVersion($version);
$pkg->setLicense($license);
$pkg->setNotes($notes);
$pkg->setPackageType('php');
$pkg->setPhpDep('4.3.0');
$pkg->setPearinstallerDep('1.4.2');
// Require custom file role for our web installation
$pkg->addPackageDepWithChannel('required', 'Role_Web', 'pearified.com');
// Geeklog Required Packages. In a 'typcial' for non-core plugins this wouldn't happen and
// instead the plugins would require a specific version of Geeklog. In fact, for non-core
// plugins (e.g. Forum, File Manager, etc) that's exactly what should happen
$pkg->addPackageDepWithChannel('required', 'Geeklog_FCKeditor', 'pear.geeklog.net', '2.3.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Layout_Professional', 'pear.geeklog.net', $currentGeeklogVersion);
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Calendar', 'pear.geeklog.net', '1.0.2');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Links', 'pear.geeklog.net', '1.1.1');
$pkg->addPackageDepWithChannel('required', 'Geeklog_Plugin_Polls', 'pear.geeklog.net', '2.0.1');
示例14: array
/**
* @access private
*/
function &_makePackage($setting, $workdir)
{
// package.xml を作る
$pkgconfig = array('packagedirectory' => $workdir, 'outputdirectory' => $workdir, 'ignore' => array('CVS/', '.cvsignore', '.svn/', 'package.xml', '*.ini', $setting['pkgname'] . '-*.tgz'), 'filelistgenerator' => 'file', 'changelogoldtonew' => false);
$packagexml = new PEAR_PackageFileManager2();
$pkgconfig = array_merge($pkgconfig, $setting['config']);
$packagexml->setOptions($pkgconfig);
$packagexml->setPackage($setting['pkgname']);
$packagexml->setSummary($setting['summary']);
$packagexml->setNotes($setting['notes']);
$packagexml->setDescription($setting['description']);
$packagexml->setChannel($setting['channel']);
$packagexml->setAPIVersion($setting['version']);
$packagexml->setReleaseVersion($setting['version']);
$packagexml->setReleaseStability($setting['state']);
$packagexml->setAPIStability($setting['state']);
$packagexml->setPackageType('php');
foreach ($setting['maintainers'] as $m) {
$packagexml->addMaintainer($m['role'], $m['user'], $m['name'], $m['email'], $m['active']);
}
$packagexml->setLicense($setting['license']['name'], $setting['license']['uri']);
$packagexml->addRole('css', 'php');
$packagexml->addRole('tpl', 'php');
$packagexml->addRole('ethna', 'php');
$packagexml->addRole('sh', 'script');
$packagexml->addRole('bat', 'script');
$packagexml->setPhpDep('4.3.0');
$packagexml->setPearinstallerDep('1.3.5');
$packagexml->generateContents();
foreach ($setting['callback'] as $method => $params) {
$r = call_user_func_array(array(&$packagexml, $method), $params);
}
$r = $packagexml->writePackageFile();
if (PEAR::isError($r)) {
return Ethna::raiseError($r->getMessage, $r->getCode());
}
// finally make package
PEAR_Command::setFrontendType('CLI');
$ui = PEAR_Command::getFrontendObject();
$config = PEAR_Config::singleton();
$ui->setConfig($config);
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$ui, 'displayFatalError'));
$cmd = PEAR_Command::factory('package', $config);
if (PEAR::isError($cmd)) {
return Ethna::raiseError($cmd->getMessage, $cmd->getCode());
}
$r = $cmd->run('package', array(), array("{$workdir}/package.xml"));
if (PEAR::isError($r)) {
return Ethna::raiseError($r->getMessage, $r->getCode());
}
}
示例15: array
/**
* Creates the package.xml file needed for distribution.
*
* Use php PackageManager.php to test output on cli,
* php PackageManager.php make to really generate package.xml
*/
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2();
$e = $packagexml->setOptions(array('clearcontents' => true, 'baseinstalldir' => 'SQLI', 'packagedirectory' => '.', 'dir_roles' => array('scripts' => 'script', 'tests' => 'test', 'CodeSniffer/Standards/Generic/Reports' => 'php', 'CodeSniffer/Standards/GN/Reports' => 'php', 'CodeSniffer/Standards/GNNew/Reports' => 'php', 'CodeSniffer/Standards/ZF/Reports' => 'php', 'CodeSniffer/Standards/Symfony/Reports' => 'php', 'CodeSniffer/Standards/Generic/Tests' => 'test', 'CodeSniffer/Standards/GN/Tests' => 'test', 'CodeSniffer/Standards/GNNew/Tests' => 'test', 'CodeSniffer/Standards/ZF/Tests' => 'test', 'CodeSniffer/Standards/Symfony/Tests' => 'test'), 'installexceptions' => array('scripts/sqlics.dist' => '/', 'scripts/sqlics.bat.dist' => '/')));
$packagexml->setPackage('SQLI_CodeSniffer');
$packagexml->setSummary('SQLI extension to PHP_CodeSniffer');
$packagexml->setDescription('SQLI_CodeSniffer extends PHP_CodeSniffer to add violation codes and configurable severities and messages');
$packagexml->setUri('http://www.assembla.com/spaces/sqlics/documents');
$packagexml->setAPIVersion('0.4.0dev1');
$packagexml->setReleaseVersion('0.4.0dev1');
$packagexml->setReleaseStability('devel');
$packagexml->setAPIStability('devel');
$packagexml->setNotes("This version adds/recovers some compatibility with PHP_CodeSniffer : sniffers' interface, tests.");
$packagexml->setPackageType('php');
// this is a PEAR-style php script package
$packagexml->setPhpDep('5.1.2');
$packagexml->setPearinstallerDep('1.4.0b1');
$packagexml->addPackageDepWithChannel('package', 'PHP_CodeSniffer', 'pear.php.net', '1.2.0RC1');
$packagexml->addMaintainer('lead', 'blacksun', 'Gabriele Santini', 'gsantini@sqli.com');
$packagexml->setLicense('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->addRelease();
// set up a release section
$packagexml->setOSInstallCondition('windows');
$packagexml->addReplacement('scripts/sqlics.bat.dist', 'pear-config', '@php_bin@', 'php_bin');