cvs: pear /PEAR_PackageFileManager PackageFileManager2.php
| From: | Laurent Laville | Date: | Mon, 23 Jan 2006 11:18:50 +0000 |
| Subject: | cvs: pear /PEAR_PackageFileManager PackageFileManager2.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-37712@lists.php.net to get a copy of this message | ||
farell Mon Jan 23 11:18:50 2006 UTC
Modified files:
/pear/PEAR_PackageFileManager PackageFileManager2.php
Log:
As for PFM1, PFM2 has its option "cleardependencies" (set to false by default)
will erase any existing dependencies (on import) in the package.xml (v1 or v2) if set to true
http://cvs.php.net/viewcvs.cgi/pear/PEAR_PackageFileManager/PackageFileManager2.php?r1=1.27&r2=1.28&diff_format=u
Index: pear/PEAR_PackageFileManager/PackageFileManager2.php
diff -u pear/PEAR_PackageFileManager/PackageFileManager2.php:1.27
pear/PEAR_PackageFileManager/PackageFileManager2.php:1.28
--- pear/PEAR_PackageFileManager/PackageFileManager2.php:1.27 Mon Jan 23 09:02:38 2006
+++ pear/PEAR_PackageFileManager/PackageFileManager2.php Mon Jan 23 11:18:49 2006
@@ -14,7 +14,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 2005-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: PackageFileManager2.php,v 1.27 2006/01/23 09:02:38 farell Exp $
+ * @version CVS: $Id: PackageFileManager2.php,v 1.28 2006/01/23 11:18:49 farell Exp $
* @link http://pear.php.net/package/PEAR_PackageFileManager
* @since File available since Release 1.6.0
*/
@@ -289,6 +289,7 @@
'replacements' => array(),
'simpleoutput' => false,
'addhiddenfiles' => false,
+ 'cleardependencies' => false,
);
/**
@@ -496,7 +497,7 @@
ucfirst(strtolower($this->_options['filelistgenerator']));
if (!$internal) {
if (PEAR::isError($res = PEAR_PackageFileManager2::_getExistingPackageXML($path,
- $this->_options['packagefile']))) {
+ $this->_options['packagefile'], array('cleardependencies'
=> true)))) {
return $res;
}
$this->_oldPackageFile = $res;
@@ -696,13 +697,16 @@
$gen = &$packagefile->getDefaultGenerator();
$res = $gen->toV2('PEAR_PackageFileManager2');
$res->setOld();
+ if ($options['cleardependencies']) {
+ $res->clearDeps();
+ }
$res->clearContents();
$packagefile = $packagefile->getPackageFile();
}
if (!isset($res)) {
if (PEAR::isError($res =
&PEAR_PackageFileManager2::_getExistingPackageXML(dirname($packagefile) .
- DIRECTORY_SEPARATOR, basename($packagefile)))) {
+ DIRECTORY_SEPARATOR, basename($packagefile), $options))) {
return $res;
}
}
@@ -1415,7 +1419,7 @@
* @access private
* @static
*/
- function &_getExistingPackageXML($path, $packagefile = 'package.xml')
+ function &_getExistingPackageXML($path, $packagefile = 'package.xml', $options =
array())
{
if (is_string($path) && is_dir($path)) {
$contents = false;
@@ -1449,7 +1453,9 @@
return $pf;
}
$pf->setOld();
- $pf->clearDeps();
+ if ($options['cleardependencies']) {
+ $pf->clearDeps();
+ }
$pf->clearContents();
}
return $pf;