本文整理汇总了PHP中PEAR_PackageFileManager2类的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFileManager2类的具体用法?PHP PEAR_PackageFileManager2怎么用?PHP PEAR_PackageFileManager2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PEAR_PackageFileManager2类的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: createPackager
function createPackager($original_file, $options = array())
{
// merge the options with these defaults.
$options = array_merge(array('packagefile' => 'package.xml', 'filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/DbPatch', 'packagedirectory' => dirname(__FILE__) . '/../', 'clearcontents' => true, 'ignore' => array('deploy.properties', 'deploy.xml', 'build/*', 'bin/package.php'), 'exceptions' => array('bin/dbpatch.php' => 'script', 'bin/dbpatch.bat' => 'script', 'LICENSE' => 'php', 'phpunit.xml.dist' => 'php', 'README.md' => 'php', 'TODOS.md' => 'php', 'CHANGES.md' => 'php'), 'installexceptions' => array('bin/dbpatch.php' => '/', 'bin/dbpatch.bat' => '/'), 'dir_roles' => array('bin' => 'php', 'docs' => 'php', 'tests' => 'php', 'src' => 'php')), $options);
$packagexml = PEAR_PackageFileManager2::importOptions($original_file, $options);
$packagexml->setPackageType('php');
$packagexml->setPackage('DbPatch');
$packagexml->setSummary('DbPatch is an open-source PHP command-line utility to patch your MySQL database.');
$packagexml->setDescription(<<<DESC
DbPatch is an open-source PHP command-line utility to patch your MySQL database.
Add a patch file to your codebase and use a single command to easily update your database.
DESC
);
$packagexml->setChannel('pear.dbpatch-project.com');
$packagexml->setNotes('Please see the README in the root of the application for the latest changes');
$packagexml->setPhpDep('5.1.6');
$packagexml->setPearinstallerDep('1.4.0');
$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0');
$packagexml->addReplacement('bin/dbpatch.php', 'pear-config', '/usr/bin/env php', 'php_bin');
$packagexml->addReplacement('bin/dbpatch.php', 'pear-config', '@php_bin@', 'php_bin');
$packagexml->addReplacement('bin/dbpatch.php', 'pear-config', '@php_dir@', 'php_dir');
$packagexml->addMaintainer('lead', 'sndpl', 'Sandy Pleyte', 'sandy@ibuildings.nl');
$packagexml->addMaintainer('lead', 'mdletter', 'Martijn De Letter', 'martijn@ibuildings.nl');
$packagexml->setLicense('MIT', 'http://www.opensource.org/licenses/mit-license.html');
// Add this as a release, and generate XML content
$packagexml->addRelease();
$packagexml->setOSInstallCondition('windows');
$packagexml->addInstallAs('bin/dbpatch.bat', 'dbpatch.bat');
$packagexml->addInstallAs('bin/dbpatch.php', 'dbpatch.php');
$packagexml->addRelease();
$packagexml->addInstallAs('bin/dbpatch.php', 'dbpatch');
$packagexml->addIgnoreToRelease('bin/dbpatch.bat');
return $packagexml;
}
示例3: createPackager
function createPackager($original_file, $options = array())
{
// merge the options with these defaults.
$options = array_merge(array('packagefile' => 'package.xml', 'filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/DocBlox', 'packagedirectory' => dirname(__FILE__) . '/../', 'clearcontents' => true, 'ignore' => array('build/*', 'data/themes/cache/*', 'data/output/*', 'data/log/*', 'bin/package.php', 'src/Image/*', 'src/Zend/*', 'src/markdown/*', 'src/markdown.php'), 'exceptions' => array('bin/docblox.php' => 'script', 'docblox.dist.xml' => 'php', 'LICENSE' => 'php', 'phpunit.xml.dist' => 'php', 'README' => 'php'), 'installexceptions' => array('bin/docblox.php' => '/', 'bin/docblox.bat' => '/'), 'dir_roles' => array('bin' => 'php', 'docs' => 'php', 'data' => 'php', 'tests' => 'php', 'src' => 'php')), $options);
$packagexml = PEAR_PackageFileManager2::importOptions($original_file, $options);
$packagexml->setPackageType('php');
$packagexml->setPackage('DocBlox');
$packagexml->setSummary('PHP 5.3 compatible API Documentation generator aimed at projects of all sizes and Continuous Integration');
$packagexml->setDescription(<<<DESC
DocBlox is a Documentation Generation Application (DGA) for use with PHP applications.
It is capable of transforming the comments in your source code into a full API reference document.
DocBlox is build to be PHP 5.3 compatible, fast, having a low memory consumption and easily integratable into Continuous Integration.
DESC
);
$packagexml->setChannel('pear.docblox-project.org');
$packagexml->setNotes('Please see the CHANGELOG in the root of the application for the latest changes');
$packagexml->setPhpDep('5.2.4');
$packagexml->setPearinstallerDep('1.4.0');
$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0');
$packagexml->addPackageDepWithChannel('required', 'Image_GraphViz', 'pear.php.net', '1.3.0');
$packagexml->addPackageDepWithChannel('required', 'zf', 'pear.zfcampus.org', '1.11.3');
$packagexml->addPackageDepWithChannel('required', 'MarkdownExtra', 'pear.michelf.com', '1.2.4');
$packagexml->addReplacement('bin/docblox.bat', 'pear-config', '/usr/bin/env php', 'php_bin');
$packagexml->addReplacement('bin/docblox.bat', 'pear-config', '@php_bin@', 'php_bin');
$packagexml->addReplacement('bin/docblox.bat', 'pear-config', '@php_dir@', 'php_dir');
$packagexml->addReplacement('bin/docblox.php', 'pear-config', '/usr/bin/env php', 'php_bin');
$packagexml->addReplacement('bin/docblox.php', 'pear-config', '@php_bin@', 'php_bin');
$packagexml->addReplacement('bin/docblox.php', 'pear-config', '@php_dir@', 'php_dir');
$packagexml->addMaintainer('lead', 'mvriel', 'Mike van Riel', 'mike.vanriel@naenius.com');
$packagexml->setLicense('MIT', 'http://www.opensource.org/licenses/mit-license.html');
// Add this as a release, and generate XML content
$packagexml->addRelease();
$packagexml->setOSInstallCondition('windows');
$packagexml->addInstallAs('bin/docblox.bat', 'docblox.bat');
$packagexml->addRelease();
$packagexml->addInstallAs('bin/docblox.php', 'docblox');
$packagexml->addIgnoreToRelease('bin/docblox.bat');
return $packagexml;
}
示例4: createPackager
/**
* Creates a packager object with all basic options set.
*
* @param string $original_file Path of the original package.xml.
* @param string[] $options Set of options to merge in.
*
* @return PEAR_Error|PEAR_PackageFileManager2
*/
function createPackager($original_file, $options = array())
{
// merge the options with these defaults.
$options = array_merge(array('packagefile' => 'package.xml', 'filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/phpDocumentor', 'packagedirectory' => dirname(__FILE__) . '/../../', 'clearcontents' => true, 'ignore' => array('build.properties', 'build.xml', 'build/*', 'data/output/*', 'data/log/*', 'bin/utils/*', 'src/XHProf/*', 'vendor/twig/twig/ext/*'), 'exceptions' => array('bin/phpdoc.php' => 'script', 'bin/phpdoc.bat' => 'script', 'phpdoc.dist.xml' => 'php', 'LICENSE' => 'php', 'phpunit.xml.dist' => 'php', 'README' => 'php', 'VERSION' => 'php', 'vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Autoload.php.in' => 'php', 'vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in' => 'php', 'vendor/phpunit/phpunit/PHPUnit/Autoload.php.in' => 'php', 'vendor/phpunit/php-token-stream/PHP/Token/Stream/Autoload.php.in' => 'php', 'vendor/phpunit/php-timer/PHP/Timer/Autoload.php.in' => 'php', 'vendor/phpunit/php-text-template/Text/Template/Autoload.php.in' => 'php', 'vendor/phpunit/php-file-iterator/File/Iterator/Autoload.php.in' => 'php', 'vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Autoload.php.in' => 'php'), 'installexceptions' => array('bin/phpdoc.php' => '/', 'bin/phpdoc.bat' => '/'), 'dir_roles' => array('bin' => 'php', 'docs' => 'php', 'data' => 'php', 'tests' => 'php', 'src' => 'php')), $options);
$packagexml = PEAR_PackageFileManager2::importOptions($original_file, $options);
$packagexml->setPackageType('php');
$packagexml->setPackage('phpDocumentor');
$packagexml->setSummary('PHP 5.3 compatible API Documentation generator aimed at projects of ' . 'all sizes and Continuous Integration');
$packagexml->setDescription(<<<DESC
phpDocumentor is a Documentation Generation Application (DGA) for use with PHP applications.
It is capable of transforming the comments in your source code into a full API reference document.
phpDocumentor is build to be PHP 5.3 compatible, fast, having a low memory consumption and easily integratable into Continuous Integration.
DESC
);
$packagexml->setChannel('pear.phpdoc.org');
$packagexml->setNotes('Please see the CHANGELOG in the root of the application for the ' . 'latest changes');
$packagexml->setPhpDep('5.3.3');
$packagexml->setPearinstallerDep('1.4.0');
$packagexml->addReplacement('bin/phpdoc.php', 'pear-config', '/usr/bin/env php', 'php_bin');
$packagexml->addGlobalReplacement('pear-config', '@php_bin@', 'php_bin');
$packagexml->addReplacement('bin/phpdoc.php', 'pear-config', '@php_dir@', 'php_dir');
$packagexml->addMaintainer('lead', 'mvriel', 'Mike van Riel', 'mike.vanriel@naenius.com');
$packagexml->addMaintainer('lead', 'ashnazg', 'Chuck Burgess', 'ashnazg@php.net');
$packagexml->setLicense('MIT', 'http://www.opensource.org/licenses/mit-license.html');
// Add this as a release, and generate XML content
$packagexml->addRelease();
$packagexml->setOSInstallCondition('windows');
$packagexml->addInstallAs('bin/phpdoc.bat', 'phpdoc.bat');
$packagexml->addInstallAs('bin/phpdoc.php', 'phpdoc.php');
$packagexml->addRelease();
$packagexml->addInstallAs('bin/phpdoc.php', 'phpdoc');
$packagexml->addIgnoreToRelease('bin/phpdoc.bat');
return $packagexml;
}
示例5: PEAR_PackageFileManager2
<?php
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$api_version = '0.0.0';
$api_state = 'alpha';
$release_version = '0.0.0';
$release_state = 'alpha';
$release_notes = "No release notes.";
$description = <<<DESC
A JWT encoder/decoder.
DESC;
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('tests' => 'test'), 'ignore' => array('package.php', '*.tgz')));
$package->setPackage('JWT');
$package->setSummary('A JWT encoder/decoder.');
$package->setDescription($description);
$package->setChannel('pear.php.net');
$package->setPackageType('php');
$package->setLicense('MIT License', 'http://creativecommons.org/licenses/MIT/');
$package->setNotes($release_notes);
$package->setReleaseVersion($release_version);
$package->setReleaseStability($release_state);
$package->setAPIVersion($api_version);
$package->setAPIStability($api_state);
$package->addMaintainer('lead', 'lcfrs', 'Neuman Vong', 'neuman+pear@twilio.com');
$package->addExtensionDep('required', 'json');
$package->addExtensionDep('required', 'hash');
$package->setPhpDep('5.1');
$package->setPearInstallerDep('1.7.0');
$package->generateContents();
示例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: ini_set
*/
ini_set('display_errors', '0');
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
require_once 'PEAR/PackageFileManager/File.php';
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$api_version = '3.12.8';
$api_state = 'stable';
$release_version = '3.12.8';
$release_state = 'stable';
$release_notes = 'Add Addresses support';
$description = <<<DESC
A SDK (or helper library, as we're calling them) for PHP developers to write
applications against Twilio's REST API and generate TwiML responses.
DESC;
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('Services' => 'php', 'Services/Twilio' => 'php', 'tests' => 'test'), 'ignore' => array('package.php', '*.tgz', 'scratch/*', 'vendor/*', 'composer.*', 'coverage/*', '.travis.yml', 'venv/*')));
$package->setPackage('Services_Twilio');
$package->setSummary('PHP helper library for Twilio');
$package->setDescription($description);
$package->setChannel('twilio-pear.herokuapp.com/pear');
$package->setPackageType('php');
$package->setLicense('MIT License', 'http://creativecommons.org/licenses/MIT/');
$package->setNotes($release_notes);
$package->setReleaseVersion($release_version);
$package->setReleaseStability($release_state);
$package->setAPIVersion($api_version);
$package->setAPIStability($api_state);
$package->addMaintainer('lead', 'ihumanable', 'Matt Nowack', 'matt@twilio.com');
$package->setPhpDep('5.2.1');
$package->addPackageDepWithChannel('optional', 'Mockery', 'pear.survivethedeepend.com');
示例8: PEAR_PackageFileManager2
<?php
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', 'File/Mogile/BigFile.php'), 'dir_roles' => array('tests' => 'test', 'examples' => 'doc')));
$packagexml->setPackage('File_Mogile');
$packagexml->setSummary('PHP interface to MogileFS');
$packagexml->setDescription('An interface for accessing MogileFS.');
$packagexml->setChannel('pear.php.net');
$packagexml->setAPIVersion('0.2.0');
$packagexml->setReleaseVersion('0.2.0');
$packagexml->setReleaseStability('alpha');
$packagexml->setAPIStability('alpha');
$packagexml->setNotes('* Initial release');
$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->detectDependencies();
$packagexml->addMaintainer('lead', 'shupp', 'Bill Shupp', 'shupp@php.net');
$packagexml->addMaintainer('lead', 'richid', 'Rich Schumacher', 'rich.schu@gmail.com');
$packagexml->setLicense('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->setPhpDep('5.2.0');
$packagexml->setPearinstallerDep('1.4.0b1');
$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0');
$packagexml->addExtensionDep('required', 'curl');
$packagexml->addExtensionDep('required', 'mbstring');
$packagexml->addExtensionDep('required', 'filter');
$packagexml->addExtensionDep('required', 'date');
$packagexml->generateContents();
$packagexml->writePackageFile();
示例9: create_function
* @package Piece_Unity
* @subpackage Piece_Unity_Component_ContentLength
* @copyright 2006-2008 KUBO Atsuhiro <iteman@users.sourceforge.net>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License (revised)
* @version SVN: $Id$
* @since File available since Release 1.0.0
*/
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');
示例10: array
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package WindowsAzure
* @author Azure PHP SDK <azurephpsdk@microsoft.com>
* @copyright 2012 Microsoft Corporation
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://github.com/windowsazure/azure-sdk-for-php
*/
require_once 'PEAR/PackageFileManager2.php';
require_once 'Defaults.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$p =& PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'package.xml', array('packagefile' => 'package.xml', 'ignore' => $ignore, 'filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__), 'changelogoldtonew' => false, 'simpleoutput' => false));
$p->addInclude($include);
$p->setPackage(PACKAGE_NAME);
$p->setSummary(PACKAGE_SUMMARY);
$p->setDescription(PACKAGE_DESCRIPTION);
$p->setNotes(PACKAGE_RELEASE_NOTES);
$p->setPackageType('php');
$p->addRelease();
$p->clearDeps();
$p->setChannel(CHANNEL_NAME);
$p->setLicense(PACKAGE_LICENSE, PACKAGE_LICENSE_AGREEMENT);
$p->setReleaseVersion(PACKAGE_RELEASE_VERSION);
$p->setAPIVersion(PACKAGE_API_VERSION);
$p->setReleaseStability(PACKAGE_RELEASE_STATE);
$p->setAPIStability(PACKAGE_API_STATE);
$p->setPhpDep(PACKAGE_MIN_PHP_VERSION);
示例11: PEAR_PackageFileManager2
$version = '1.11.4';
$api_version = '1.11.2';
$notes = <<<EOT
No release notes for you!
EOT;
$description = <<<EOT
jQuery is a fast, small, and feature-rich JavaScript library. It makes things
like HTML document traversal and manipulation, event handling, animation, and
Ajax much simpler with an easy-to-use API that works across a multitude of
browsers. With a combination of versatility and extensibility, jQuery has
changed the way that millions of people write JavaScript.
This package provides jQuery in a manner compatibile with silverorange PEAR
packages.
EOT;
$package = new PEAR_PackageFileManager2();
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$result = $package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('JQuery' => 'php', 'www' => 'data', 'dependencies' => 'data', '/' => 'data'), 'exceptions' => array('LICENSE' => 'doc', 'README.md' => 'doc')));
$package->setPackage('JQuery');
$package->setSummary('A fast, small, and feature-rich JavaScript library.');
$package->setDescription($description);
$package->setChannel('pear.silverorange.com');
$package->setPackageType('php');
$package->setLicense('MIT License', 'http://www.opensource.org/licenses/mit-license.html');
$package->setReleaseVersion($version);
$package->setReleaseStability('stable');
$package->setAPIVersion($api_version);
$package->setAPIStability('stable');
$package->setNotes($notes);
$package->addIgnore('package.php');
$package->addMaintainer('lead', 'gauthierm', 'Mike Gauthier', 'mike@silverorange.com');
示例12: list
/**
* @package i18n
* @version $Id: package.php 7486 2009-01-26 19:13:20Z pachanga $
*/
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/PackageFileManager/Svn.php';
list($name, $baseVersion, $state) = explode('-', trim(file_get_contents(dirname(__FILE__) . '/VERSION')));
$changelog = htmlspecialchars(file_get_contents(dirname(__FILE__) . '/CHANGELOG'));
$summary = htmlspecialchars(file_get_contents(dirname(__FILE__) . '/SUMMARY'));
$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');
示例13: array
<?php
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$options = array('filelistgenerator' => 'cvs', 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => 'Crypt', 'packagedirectory' => dirname(__FILE__), 'clearcontents' => true, 'ignore' => array('generate_package_xml.php', '.svn', '.cvs*'), 'dir_roles' => array('docs' => 'doc', 'examples' => 'doc', 'tests' => 'test'));
$packagexml =& PEAR_PackageFileManager2::importOptions($packagefile, $options);
$packagexml->setPackageType('php');
$packagexml->setPackage('Crypt_HMAC2');
$packagexml->setSummary('Implementation of Hashed Message Authentication Code for PHP5');
$packagexml->setDescription("Implementation of Hashed Message Authentication Code for PHP5.\nThis package may use the hash or mhash extensions when enabled to\nextend the range of cryptographic hash functions beyond the natively\nimplemented MD5 and SHA1.");
$packagexml->setChannel('pear.php.net');
$notes = <<<EOT
* Fixed base directory path bug in package.xml
EOT;
$packagexml->setNotes($notes);
$packagexml->setPhpDep('5.0.0');
$packagexml->setPearinstallerDep('1.4.0b1');
$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.3.6');
$packagexml->addMaintainer('lead', 'padraic', 'Pádraic Brady', 'padraic@php.net');
$packagexml->setLicense('New BSD License', 'http://opensource.org/licenses/bsd-license.php');
$packagexml->addRelease();
$packagexml->generateContents();
$packagexml->setAPIVersion('0.2.1');
$packagexml->setReleaseVersion('0.2.1');
$packagexml->setReleaseStability('beta');
$packagexml->setAPIStability('beta');
if (isset($_GET['make']) || isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make') {
$packagexml->writePackageFile();
} else {
$packagexml->debugPackageFile();
}
示例14: 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());
}
}
示例15: PEAR_PackageFileManager2
<?php
require_once 'PEAR/PackageFileManager2.php';
$version = '1.0.3';
$notes = <<<EOT
No release notes for you!
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');