cvs: pear /PEAR_PackageFileManager/examples updatepackage.php
| From: | Laurent Laville | Date: | Tue, 15 Aug 2006 18:54:57 +0000 |
| Subject: | cvs: pear /PEAR_PackageFileManager/examples updatepackage.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-41610@lists.php.net to get a copy of this message | ||
farell Tue Aug 15 18:54:57 2006 UTC
Added files:
/pear/PEAR_PackageFileManager/examples updatepackage.php
Log:
new example to keep up-to-date an existing package
http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager/examples/updatepackage.php?view=markup&rev=1.1
Index: pear/PEAR_PackageFileManager/examples/updatepackage.php
+++ pear/PEAR_PackageFileManager/examples/updatepackage.php
<?php
/**
* Here is a sample file that demonstrates how to keep up-to-date
* an existing package xml (2.0 and also 1.0) with only the require-function-calls
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt. If you
did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category pear
* @package PEAR_PackageFileManager
* @author Laurent Laville <pear@laurent-laville.org>
* @copyright 2006 The PHP Group
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
* @version CVS: $Id: updatepackage.php,v 1.1 2006/08/15 18:54:57 farell Exp $
* @link http://pear.php.net/package/PEAR_PackageFileManager
* @since File available since Release 1.6.0
* @ignore
*/
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagefile = 'c:/php/pear/HTML_Progress2/package2.xml';
$options = array('filelistgenerator' => 'cvs',
'baseinstalldir' => 'HTML',
'outputdirectory' => 'c:/php/pear',
'simpleoutput' => true,
'changelogoldtonew' => false
);
$p2 = &PEAR_PackageFileManager2::importOptions($packagefile, $options);
$p2->setPackageType('php');
$p2->addRelease();
$p2->generateContents();
$p2->setReleaseVersion('2.2.0');
$p2->setAPIVersion('2.2.0');
$p2->setReleaseStability('alpha');
$p2->setAPIStability('stable');
$p2->setNotes('bugfixe for dupplicates entry in package xml 1.0 export');
// Avoid to define again what is already defined unless you want to give new values
//$p2->setPhpDep('4.2.0');
//$p2->setPearinstallerDep('1.4.3');
// get a compatible version 1.0 of package xml
$pkg = &$p2->exportCompatiblePackageFile1();
if (isset($_GET['make']) || (isset($_SERVER['argv']) &&
@$_SERVER['argv'][1] == 'make')) {
$pkg->writePackageFile();
$p2->writePackageFile();
} else {
$pkg->debugPackageFile();
$p2->debugPackageFile();
}
?>