/**
  * Setup.
  *
  * @param mixed $pkgConfig
  * @param array $pfmOptions
  *
  * @return PackageFileBuilder $this
  */
 public function setup($pkgConfig, array $pfmOptions = array())
 {
     $pkgInfo = $this->loader->load($pkgConfig);
     if (array_key_exists('packageFileManagerOptions', $pkgInfo)) {
         $pfmOptions = array_merge($pkgInfo['packageFileManagerOptions'], $pfmOptions);
     }
     $this->pfm = new PackageFileManager();
     $this->pfm->setOptions($pfmOptions);
     $this->setPackage($pkgInfo['package']);
     $this->setState($pkgInfo['state']);
     $this->addMaintainers($pkgInfo['maintainers']);
     if (array_key_exists('releases', $pkgInfo)) {
         foreach ($pkgInfo['releases'] as $release) {
             $this->addRelease($release);
         }
     } else {
         $this->addRelease();
     }
     if (array_key_exists('dependencies', $pkgInfo)) {
         $this->setDependencies($pkgInfo['dependencies']);
     }
     if (array_key_exists('tasks', $pkgInfo)) {
         $this->addTasks($pkgInfo['tasks']);
     }
     return $this;
 }
 /**
  * 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', '*****@*****.**');
     $test = $pkg->generateContents();
     $e = $pkg->writePackageFile();
     if (PEAR::isError($e)) {
         echo $e->getMessage();
     }
 }
 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;
     }
 }
 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;
     }
 }
Exemple #5
0
 /**
  * Get PackageFileManager2 instance
  *
  * @param string|null $package
  * @return PEAR_PackageFileManager2
  * @throws PEAR_Exception
  */
 public function getPfm($package = null)
 {
     if (!$this->_pfm) {
         if (is_null($package)) {
             $this->_pfm = new PEAR_PackageFileManager2();
             $this->_pfm->setOptions($this->get('options'));
         } else {
             $this->defineData();
             $this->_pfm = PEAR_PackageFileManager2::importOptions($package, $this->get('options'));
             if ($this->_pfm instanceof PEAR_Error) {
                 $e = PEAR_Exception('Could not instantiate PEAR_PackageFileManager2');
                 $e->errorObject = $this->_pfm;
                 throw $e;
             }
         }
     }
     return $this->_pfm;
 }
 * @subpackage Piece_Unity_Component_ContentLength
 * @copyright  2006-2008 KUBO Atsuhiro <*****@*****.**>
 * @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');
$package->addMaintainer('lead', 'iteman', 'KUBO Atsuhiro', '*****@*****.**');
<?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', '*****@*****.**');
$packagexml->addMaintainer('lead', 'richid', 'Rich Schumacher', '*****@*****.**');
$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();
Exemple #8
0
$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', '*****@*****.**');
// This package technically has a circular dependency with the Swat package
// because it uses SwatJavaScriptHtmlHeadEntry and SwatHtmlHeadEntrySet.
<?php

/**
 * 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', '*****@*****.**');
$packagexml->setLicense('New BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
$packagexml->addRelease();
// set up a release section
$packagexml->setOSInstallCondition('windows');
Exemple #10
0
 * @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');
$package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.txt');
 *
 * @category Application
 * @package  VIH
 * @author   Lars Olesen <*****@*****.**>
 * @since    0.1.0
 * @version  @package-version@
 */
require_once 'PEAR/PackageFileManager2.php';
$version = '1.0.2';
$notes = '* initial release as PEAR';
$web_dir = 'www';
$ignore = array('makepackage.php', '*.tgz', 'tests/', '.svn/', 'build.xml', 'config.elevforeningen.php');
$postinstall_file = 'elevforeningen.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$pfm = new PEAR_PackageFileManager2();
$pfm->setOptions(array('baseinstalldir' => '/', 'filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__) . '/src', 'packagefile' => 'package.xml', 'ignore' => $ignore, 'dir_roles' => array('www' => 'web'), 'simpleoutput' => true, 'addhiddenfiles' => true));
$pfm->setPackage('VIH_Elevforeningen');
$pfm->setSummary('VIH');
$pfm->setDescription('VIH');
$pfm->setUri('http://localhost/');
$pfm->setLicense('LGPL License', 'http://www.gnu.org/licenses/lgpl.html');
$pfm->addMaintainer('lead', 'lsolesen', 'Lars Olesen', '*****@*****.**');
$pfm->setPackageType('php');
$pfm->setAPIVersion($version);
$pfm->setReleaseVersion($version);
$pfm->setAPIStability('beta');
$pfm->setReleaseStability('stable');
$pfm->setNotes($notes);
$pfm->addRelease();
$pfm->resetUsesRole();
$pfm->addUsesRole('web', 'Role_Web', 'pearified.com');
Exemple #12
0
<?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', '*****@*****.**');
$package->addExtensionDep('required', 'json');
$package->addExtensionDep('required', 'hash');
$package->setPhpDep('5.1');
$package->setPearInstallerDep('1.7.0');
$package->generateContents();
 * Generates and updates a package.xml file
 * dependencies : PEAR_PackageFileManager 1.6+
 * @author Laurent Bachelier <*****@*****.**>
 */
/** 
 * INSTALL on Ubuntu 10.10
 * sudo pear config-set preferred_state beta
 * sudo pear install --alldeps PEAR_PackageFileManager
 * sudo pear config-set preferred_state stable
 */
error_reporting(E_ALL);
// 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('sfFacebookConnectPlugin');
$packagexml->setSummary('Add easily Facebook connect to your symfony website and/or develop IFrame-FBML agnostic Facebook applications.');
$packagexml->setDescription('The sfFacebookConnectPlugin provides multiples functionalities geared both at making Facebook Connect integration in a symfony website easy and also help develop Facebook applications. This is achieved by smoothly connecting sfGuard (Doctrine AND Propel) with Facebook and helping developers program without worrying about whether the application is FBML or IFrame/Facebook Connect.');
$packagexml->setChannel('plugins.symfony-project.org');
$packagexml->addMaintainer('lead', 'fabriceb', 'Fabrice Bernhard', '*****@*****.**');
$packagexml->addMaintainer('developer', 'oncletom', 'Thomas Parisot', '*****@*****.**');
$packagexml->addMaintainer('developer', 'dalexandre', 'Damien Alexandre', '*****@*****.**');
$packagexml->addMaintainer('developer', 'benjaming', 'Benjamin Grandfond', '*****@*****.**');
$packagexml->setLicense('MIT License', 'http://www.symfony-project.org/license');
// This will ADD a changelog entry to an existing package.xml
$packagexml->setAPIVersion('1.1.1');
$packagexml->setReleaseVersion('1.1.1');
$packagexml->setNotes('Symfony 1.4 officialy compatible version');
$packagexml->setReleaseStability('stable');
$packagexml->setAPIStability('stable');
Exemple #14
0
/**
 * 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;
}
Exemple #15
0
 /**
  * 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;
                 }
                 $params = array();
                 foreach ($paramGroup->params as $param) {
                     $this->log('adding parameter ' . $param->name);
                     $params[] = $postInstallScript->getParam($param->name, $param->prompt, $param->type, $param->default);
                 }
                 if (empty($params)) {
                     $params = false;
                 }
                 $postInstallScript->addParamGroup($paramGroup->name, $params, $instructions);
             }
             $e = $package->addPostInstallTask($postInstallScript, $postInstall->script);
             if (PEAR::isError($e)) {
                 throw new d51PearPkg2Task_Exception('unable to add post install task: ' . $e->getMessage());
             }
             $this->log('Added POSTINSTALL for ' . $postInstall->script);
         }
     }
     $package->generateContents();
     $e = $package->writePackageFile();
     if (PEAR::isError($e)) {
         throw new d51PearPkg2Task_Exception('unable to write package.xml file: ' . $e->getMessage());
     }
 }
Exemple #16
0
 * $ pear package package.xml
 * </code>
 *
 * @package PEL
 * @author  Lars Olesen <*****@*****.**>
 * @version @package-version@
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public
 */
require_once 'PEAR/PackageFileManager2.php';
$version = '0.9.2';
$stability = 'beta';
$notes = '* initial release as a PEAR package';
$url = 'http://downloads.sf.net/pel/PEL-' . $version . '.tgz';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$pfm = new PEAR_PackageFileManager2();
$pfm->setOptions(array('baseinstalldir' => 'PEL', 'filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__), 'packagefile' => 'package.xml', 'ignore' => array('makepackagexml.php', '*.tgz', '*.sh', 'test/', 'tutorials/', 'authors.xml'), 'dir_roles' => array('doc' => 'doc', 'examples' => 'doc', 'test' => 'test'), 'exceptions' => array('README' => 'doc', 'AUTHORS' => 'doc', 'COPYING' => 'doc', 'INSTALL' => 'doc', 'NEWS' => 'doc', 'TODO' => 'doc'), 'simpleoutput' => true));
$pfm->setPackage('PEL');
$pfm->setSummary('The PHP Exif Library (PEL) lets you fully manipulate Exif (Exchangeable Image File Format) data.');
$pfm->setDescription('The PHP Exif Library (PEL) lets you fully manipulate Exif (Exchangeable Image File Format) data. This is the data that digital cameras place in their images, such as the date and time, shutter speed, ISO value and so on.

Using PEL, one can fully modify the Exif data, meaning that it can be both read and written. Completely new Exif data can also be added to images. PEL is written completely in PHP and depends on nothing except a standard installation of PHP, version 5. PEL is hosted on SourceForge.');
$pfm->setUri($url);
$pfm->setLicense('GPL License', 'http://www.gnu.org/licenses/gpl.html');
$pfm->addMaintainer('lead', 'mgeisler', 'Martin Geisler', '*****@*****.**');
$pfm->addMaintainer('helper', 'lsolesen', 'Lars Olesen', '*****@*****.**');
$pfm->setPackageType('php');
$pfm->setAPIVersion($version);
$pfm->setReleaseVersion($version);
$pfm->setAPIStability($stability);
$pfm->setReleaseStability($stability);
$pfm->setNotes($notes);
 * limitations under the License.
 */
date_default_timezone_set('Europe/Berlin');
@(include 'PEAR/PackageFileManager2.php');
if (!class_exists('PEAR_PackageFileManager2')) {
    echo "\nYou need to install PEAR_PackageFileManager2 in order to run this script\n\n";
    echo "Installation tips:\n\n";
    echo "  \$ pear upgrade PEAR\n";
    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
Exemple #18
0
<?php

require_once 'PEAR/PackageFileManager2.php';
require_once dirname(__FILE__) . '/../XRef.class.php';
$version = XRef::version();
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$pfm = new PEAR_PackageFileManager2();
$pfm->setOptions(array('baseinstalldir' => 'XRef', 'packagedirectory' => '.', 'filelistgenerator' => 'file', 'ignore' => array('Makefile', 'dev/', '.idea', '.xref', 'tmp'), 'dir_roles' => array('bin' => 'script', 'config' => 'data', 'tests' => 'test', 'examples' => 'doc', 'templates' => 'data', 'scripts' => 'php', 'web-scripts' => 'php', 'plugins' => 'php'), 'exceptions' => array('README.md' => 'doc')));
$pfm->setPackage('XRef');
$pfm->setSummary('XRef - php source file toolkit');
$pfm->setDescription('XRef Lint - php lint and crossref doc tool');
$pfm->setChannel('pear.xref-lint.net');
$pfm->setAPIVersion($version);
$pfm->setReleaseVersion($version);
$pfm->setReleaseStability('stable');
$pfm->setAPIStability('stable');
$pfm->setNotes("v1.0.0 release candidate #1");
$pfm->setPackageType('php');
// dependencies
//$pfm->addDependency("Console_Getopt");
// windows-release
$pfm->addRelease();
// set up a release section
$pfm->setOSInstallCondition('windows');
$pfm->addIgnoreToRelease('bin/xref-lint');
$pfm->addIgnoreToRelease('bin/xref-doc');
$pfm->addIgnoreToRelease('bin/xref-ci');
$pfm->addIgnoreToRelease('bin/git-xref-lint');
$pfm->addInstallAs('bin/xref-lint.bat', 'xref-lint.bat');
$pfm->addInstallAs('bin/xref-doc.bat', 'xref-doc.bat');
// other platforms
 * @author     Sergio Carvalho <*****@*****.**>
 * @copyright  2005-2007 The PHP Group
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
 * @version    CVS: $Id: package.php,v 1.37 2007/11/20 20:04:24 farell Exp $
 * @link       http://pear.php.net/package/PEAR_PackageFileManager
 * @since      File available since Release 1.6.0
 */
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$release_version = '1.0.0';
$release_state = 'stable';
$api_version = '1.0.0';
$api_state = 'stable';
$release_notes = '* Initial version';
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions(array('packagefile' => 'package.xml', 'exceptions' => array(), 'filelistgenerator' => 'file', 'packagedirectory' => dirname(__FILE__), 'changelogoldtonew' => false, 'baseinstalldir' => '/', 'simpleoutput' => true, 'dirroles' => array('tests' => 'test'), 'ignore' => array('package.php', '_MTN/')));
$packagexml->setPackage('Text_Tokenizer_Regex');
$packagexml->setSummary('Text_Tokenizer implementation that tokenizes a string based on a set of regular expressions');
$packagexml->setDescription(<<<EOS
Text_Tokenizer_Regexp is a text tokenizer, following the Text_Tokenizer interface that uses a set of perl-compatible regular expressions to tokenize the input text.
EOS
);
$packagexml->addMaintainer('lead', 'sergiosgc', 'Sergio Carvalho', '*****@*****.**');
$packagexml->setNotes($release_notes);
$packagexml->addIgnore(array('package.php', '*.tgz'));
$packagexml->setPackageType('php');
$packagexml->addRelease();
$packagexml->clearDeps();
$packagexml->setChannel('pear.sergiocarvalho.com');
$packagexml->setLicense('PHP License 3.01', 'http://www.php.net/license/3_01.txt');
$packagexml->setReleaseVersion($release_version);
Exemple #20
0
 * @package    stagehand-php-class
 * @copyright  2009 KUMAKURA Yousuke <*****@*****.**>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License (revised)
 * @version    Release: @package_version@
 * @since      File available since Release 0.1.0
 */
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR.php';
PEAR::staticPushErrorHandling(PEAR_ERROR_CALLBACK, create_function('$error', 'var_dump($error); exit();'));
$releaseVersion = '0.1.0';
$releaseStability = 'beta';
$apiVersion = '0.1.0';
$apiStability = 'beta';
$notes = 'The first release of Stagehand_PHP_Class.';
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'changelogoldtonew' => false, 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagefile' => 'package.xml', 'packagedirectory' => '.', 'dir_roles' => array('bin' => 'script', 'doc' => 'doc', 'src' => 'php', 'tests' => 'test'), 'ignore' => array('package.php')));
$package->setPackage('Stagehand_PHP_Class');
$package->setPackageType('php');
$package->setSummary('A meta object system for PHP classes');
$package->setDescription('Stagehand_PHP_Class provides features of the building, loading, and code generating for PHP classes.
These classes can be written in pure PHP code.');
$package->setChannel('pear.piece-framework.com');
$package->setLicense('New BSD License', '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('5.0.0');
$package->setPearinstallerDep('1.4.3');
$package->addMaintainer('lead', 'kumatch', 'KUMAKURA Yousuke', '*****@*****.**');
Exemple #21
0
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', '*****@*****.**');
$package->setPhpDep('5.2.1');
$package->addPackageDepWithChannel('optional', 'Mockery', 'pear.survivethedeepend.com');
$package->setPearInstallerDep('1.9.3');
<?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', '*****@*****.**');
$packagexml->addMaintainer('lead', 'shupp', 'Bill Shupp', '*****@*****.**');
$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');
Exemple #23
0
    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', '*****@*****.**');
        $p2->addMaintainer('developer', 'dominik', 'Dominik del Bondio', '*****@*****.**');
        $p2->addMaintainer('developer', 'felix', 'Felix Gilcher', '*****@*****.**');
        $p2->addMaintainer('developer', 'impl', 'Noah Fontes', '*****@*****.**');
        $p2->addMaintainer('developer', 'v-dogg', 'Veikko Mäkinen', '*****@*****.**');
        $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());
        }
    }
 public function buildSubPackage($dir, $baseinstalldir, $info)
 {
     $package = str_replace('/', '_', $baseinstalldir);
     $opts = array('packagedirectory' => $dir, 'filelistgenerator' => 'file', 'ignore' => array('*composer.json', '*package.xml'), 'baseinstalldir' => '/' . $info['target-dir'], 'packagefile' => 'package.xml');
     $pfm = new PEAR_PackageFileManager2();
     $e = $pfm->setOptions($opts);
     $pfm->setPackage($package);
     $pfm->setSummary($info['description']);
     $pfm->setDescription($info['description']);
     $pfm->setPackageType('php');
     $pfm->setChannel('guzzlephp.org/pear');
     $pfm->setAPIVersion('3.0.0');
     $pfm->setReleaseVersion($this->getVersion());
     $pfm->setAPIStability('stable');
     $pfm->setReleaseStability('stable');
     $pfm->setNotes($this->changelog_notes);
     $pfm->setPackageType('php');
     $pfm->setLicense('MIT', 'http://github.com/guzzle/guzzle/blob/master/LICENSE');
     $pfm->addMaintainer('lead', 'mtdowling', 'Michael Dowling', '*****@*****.**', 'yes');
     $pfm->setDate($this->changelog_release_date);
     $pfm->generateContents();
     $phpdep = $this->guzzleinfo['require']['php'];
     $phpdep = str_replace('>=', '', $phpdep);
     $pfm->setPhpDep($phpdep);
     $pfm->setPearinstallerDep('1.4.6');
     foreach ($info['require'] as $type => $version) {
         if ($type == 'php') {
             continue;
         }
         if ($type == 'symfony/event-dispatcher') {
             $pfm->addPackageDepWithChannel('required', 'EventDispatcher', 'pear.symfony.com', '2.1.0');
         }
         if ($type == 'ext-curl') {
             $pfm->addExtensionDep('required', 'curl');
         }
         if (substr($type, 0, 6) == 'guzzle') {
             $gdep = str_replace('/', ' ', $type);
             $gdep = ucwords($gdep);
             $gdep = str_replace(' ', '_', $gdep);
             $pfm->addPackageDepWithChannel('required', $gdep, 'guzzlephp.org/pear', $this->getVersion());
         }
     }
     // can't have main Guzzle package AND sub-packages
     $pfm->addConflictingPackageDepWithChannel('Guzzle', 'guzzlephp.org/pear', false, $apiversion);
     ob_start();
     $startdir = getcwd();
     chdir((string) $this->basedir . '/build/pearwork');
     echo "DEBUGGING GENERATED PACKAGE FILE\n";
     $result = $pfm->debugPackageFile();
     if ($result) {
         $out = $pfm->writePackageFile();
         echo "\n\n\nWRITE PACKAGE FILE RESULT:\n";
         var_dump($out);
         // load up package file and build package
         $packager = new PEAR_Packager();
         echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n";
         $dest_package = $packager->package($opts['packagedirectory'] . '/package.xml');
         var_dump($dest_package);
     } else {
         echo "\n\n\nDEBUGGING RESULT:\n";
         var_dump($result);
     }
     echo "removing package.xml";
     unlink($opts['packagedirectory'] . '/package.xml');
     $log = ob_get_clean();
     file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package_' . $package . '.log', $log);
     chdir($startdir);
 }
Exemple #25
0
<?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', '*****@*****.**');
$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');
*/
require_once 'PEAR/PackageFileManager2.php';
//using this, we don't need to do any error handling ourselves
PEAR::setErrorHandling(PEAR_ERROR_DIE);
/* don't modify this */
// Directory where the package files are located.
$packagedir = dirname(__FILE__);
$glDir = realpath(dirname(__FILE__) . '/../../');
/**
 * Calendar configuration file
 */
require $packagedir . '/config.php';
//print $glDir; exit;
$channel = 'pear.geeklog.net';
$category = 'Geeklog Plugins';
$package = 'Geeklog_Plugin_Calendar';
// Should be actual FCKeditor version number to avoid any confusion
$version = $_CA_CONF['version'];
$summary = <<<EOT
Calendar Plugin for Geeklog 1.x
EOT;
$description = <<<EOT
Calendar Plugin for Geeklog 1.x
EOT;
$license = 'GPL';
$notes = 'Initial Release';
// Instanciate package file manager
$pkg = new PEAR_PackageFileManager2();
// Setting options
$e = $pkg->setOptions(array('packagefile' => 'package-calendar.xml', 'outputdirectory' => $glDir . DIRECTORY_SEPARATOR, 'packagedirectory' => $glDir . DIRECTORY_SEPARATOR, 'baseinstalldir' => 'Geeklog', 'pathtopackagefile' => dirname(__FILE__), 'filelistgenerator' => 'CVS', 'ignore' => array('buildpackage*.php', 'package.xml', '*.tgz'), 'include' => array($packagedir . '/', $glDir . '/public_html/calendar/', $glDir . '/public_html/admin/plugins/calendar/'), 'simpleoutput' => true, 'dir_roles' => array('*' => 'web'), 'roles' => array('*' => 'web')));
include $glDir . '/system/build/buildpackage-end.php';
<?php

set_time_limit(0);
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_PRINT);
$pkg = new PEAR_PackageFileManager2();
$pkg->setOptions(array('baseinstalldir' => '/', 'packagefile' => 'package2.xml', 'packagedirectory' => realpath(dirname(__FILE__) . '/library'), 'filelistgenerator' => 'file', 'include' => array('*'), 'dir_roles' => array('/' => 'php'), 'ignore' => array('HTMLPurifier.standalone.php', 'HTMLPurifier.path.php', 'standalone/')));
$pkg->setPackage('HTMLPurifier');
$pkg->setLicense('LGPL', 'http://www.gnu.org/licenses/lgpl.html');
$pkg->setSummary('Standards-compliant HTML filter');
$pkg->setDescription('HTML Purifier is an HTML filter that will remove all malicious code
    (better known as XSS) with a thoroughly audited, secure yet permissive
    whitelist and will also make sure your documents are standards
    compliant.');
$pkg->addMaintainer('lead', 'ezyang', 'Edward Z. Yang', '*****@*****.**', 'yes');
$version = trim(file_get_contents('VERSION'));
$api_version = substr($version, 0, strrpos($version, '.'));
$pkg->setChannel('htmlpurifier.org');
$pkg->setAPIVersion($api_version);
$pkg->setAPIStability('stable');
$pkg->setReleaseVersion($version);
$pkg->setReleaseStability('stable');
$pkg->addRelease();
$pkg->setNotes(file_get_contents('WHATSNEW'));
$pkg->setPackageType('php');
$pkg->setPhpDep('5.0.0');
$pkg->setPearinstallerDep('1.4.3');
$pkg->generateContents();
$compat =& $pkg->exportCompatiblePackageFile1();
$compat->writePackageFile();
$pkg->writePackageFile();
Exemple #28
0
/**
 * Require the PEAR_PackageFileManager2 classes, and other
 * necessary classes for package.xml file creation.
 */
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/PackageFileManager/File.php';
require_once 'PEAR/Task/Postinstallscript/rw.php';
require_once 'PEAR/Config.php';
require_once 'PEAR/Frontend.php';
/**
 * @var PEAR_PackageFileManager
 */
PEAR::setErrorHandling(PEAR_ERROR_DIE);
chdir(dirname(__FILE__));
$pfm = new PEAR_PackageFileManager2();
$pfm->setOptions(array('packagedirectory' => '${basedir}/tmp/CAS-${phpcas.version}', 'outputdirectory' => '${basedir}/tmp', 'baseinstalldir' => '/', 'filelistgenerator' => 'file', 'simpleoutput' => true, 'roles' => array('php' => 'php'), 'exceptions' => array('README.md' => 'doc', 'LICENSE' => 'doc', 'NOTICE' => 'doc')));
$pfm->setPackage('CAS');
$pfm->setPackageType('php');
// this is a PEAR-style php script package
$pfm->setSummary('Central Authentication Service client library in php');
$pfm->setDescription('This package is a PEAR installable library for using a Central Authentication Service.');
$pfm->setChannel('__uri');
$pfm->setAPIStability('${phpcas.apiStability}');
$pfm->setReleaseStability('${phpcas.releaseStability}');
$pfm->setAPIVersion('${phpcas.version}');
$pfm->setReleaseVersion('${phpcas.version}');
$pfm->setNotes('see https://github.com/Jasig/phpCAS/blob/master/docs/ChangeLog');
$pfm->addMaintainer('lead', 'jfritschi', 'Joachim Fritschi', '*****@*****.**');
$pfm->addMaintainer('contributor', 'adamfranco', 'Adam Franco', '*****@*****.**');
$pfm->setLicense('Apache 2.0 License', 'https://github.com/Jasig/phpCAS/blob/master/LICENSE');
$pfm->clearDeps();
Exemple #29
0
#!/usr/bin/env php
<?php 
use Phrozn\Autoloader as Loader;
error_reporting(E_ALL & ~E_NOTICE);
// rely on configuration files
require_once dirname(__FILE__) . '/../Phrozn/Autoloader.php';
$loader = Loader::getInstance()->getLoader();
$config = new \Phrozn\Config(dirname(__FILE__) . '/../configs/');
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$pack = new PEAR_PackageFileManager2();
$outputDir = realpath(dirname(__FILE__) . '/../') . '/';
$inputDir = realpath(dirname(__FILE__) . '/../');
$e = $pack->setOptions(array('baseinstalldir' => '/', 'packagedirectory' => $inputDir, 'ignore' => array('build/', 'tests/', 'extras/', 'plugin/', 'phrozn.png', '*.tgz', 'bin/release', 'tags'), 'outputdirectory' => $outputDir, 'simpleoutput' => true, 'roles' => array('textile' => 'doc'), 'dir_roles' => array('Phrozn' => 'php', 'configs' => 'data', 'skeleton' => 'data', 'tests' => 'test'), 'exceptions' => array('bin/phrozn.php' => 'script', 'bin/phr.php' => 'script', 'LICENSE' => 'doc'), 'installexceptions' => array(), 'clearchangelog' => true));
$pack->setPackage('Phrozn');
$pack->setSummary($config['phrozn']['summary']);
$pack->setDescription($config['phrozn']['description']);
$pack->setChannel('pear.phrozn.info');
$pack->setPackageType('php');
// this is a PEAR-style php script package
$pack->setReleaseVersion($config['phrozn']['version']);
$pack->setAPIVersion($config['phrozn']['version']);
$pack->setReleaseStability($config['phrozn']['stability']);
$pack->setAPIStability($config['phrozn']['stability']);
$pack->setNotes('
    * The first public release of Phrozn
');
$pack->setLicense('Apache License, Version 2.0', 'http://www.apache.org/licenses/LICENSE-2.0');
$pack->addMaintainer('lead', 'victor', 'Victor Farazdagi', '*****@*****.**');
$pack->addRelease();
$pack->addInstallAs('bin/phr.php', 'phr');
Exemple #30
0
 * @author    Michael Gauthier <*****@*****.**>
 * @author    Nathan Fredrikson <*****@*****.**>
 * @copyright 2005-2013 silverorange
 * @license   http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
 * @link      http://pear.php.net/package/Crypt_GPG
 */
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$apiVersion = '1.6.0';
$apiState = 'beta';
$releaseVersion = '1.6.0b2';
$releaseState = 'beta';
$releaseNotes = "This release adds GnuPG 2.1 support\n" . "Internal API has been refactored.\n\n" . "Fixed Bug #21148: Throw bad-passphrase exception instead of key-not-found exception on decryption";
$description = "This package provides an object oriented interface to GNU Privacy " . "Guard (GnuPG). It requires the GnuPG executable to be on the system.\n\n" . "Though GnuPG can support symmetric-key cryptography, this package is " . "intended only to facilitate public-key cryptography.\n\n" . "This package requires PHP version 5.4.8 or greater.";
$package = new PEAR_PackageFileManager2();
$package->setOptions(array('filelistgenerator' => 'file', 'simpleoutput' => true, 'baseinstalldir' => '/', 'packagedirectory' => './', 'dir_roles' => array('Crypt' => 'php', 'Crypt/GPG' => 'php', 'tests' => 'test', 'data' => 'data'), 'exceptions' => array('LICENSE' => 'doc', 'README.md' => 'doc', 'scripts/crypt-gpg-pinentry' => 'script'), 'ignore' => array('tests/config.php', 'tools/', 'package.php', 'composer.json', '*.tgz'), 'installexceptions' => array('scripts/crypt-gpg-pinentry' => '/')));
$package->setPackage('Crypt_GPG');
$package->setSummary('GNU Privacy Guard (GnuPG)');
$package->setDescription($description);
$package->setChannel('pear.php.net');
$package->setPackageType('php');
$package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.html');
$package->setNotes($releaseNotes);
$package->setReleaseVersion($releaseVersion);
$package->setReleaseStability($releaseState);
$package->setAPIVersion($apiVersion);
$package->setAPIStability($apiState);
$package->addMaintainer('lead', 'gauthierm', 'Mike Gauthier', '*****@*****.**');
$package->addMaintainer('lead', 'nrf', 'Nathan Fredrickson', '*****@*****.**');
$package->addMaintainer('lead', 'alec', 'Aleksander Machniak', '*****@*****.**');
$package->addReplacement('data/pinentry-cli.xml', 'package-info', '@package-version@', 'version');