* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.4
+ * @version Release: 1.10.1
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
* @var PEAR_PackageFile_v1
*/
var $_packagefile;
- function PEAR_PackageFile_Generator_v1(&$packagefile)
+ function __construct(&$packagefile)
{
$this->_packagefile = &$packagefile;
}
function getPackagerVersion()
{
- return '1.9.4';
+ return '1.10.1';
}
/**
// }}}
$packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, 'package.xml', true);
if ($packagexml) {
- $tar =& new Archive_Tar($dest_package, $compress);
+ $tar = new Archive_Tar($dest_package, $compress);
$tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors
// ----- Creates with the package.xml file
$ok = $tar->createModify(array($packagexml), '', $where);
*/
function _fixXmlEncoding($string)
{
- if (version_compare(phpversion(), '5.0.0', 'lt')) {
- $string = utf8_encode($string);
- }
return strtr($string, array(
'&' => '&',
'>' => '>',
);
$ret = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
$ret .= "<!DOCTYPE package SYSTEM \"http://pear.php.net/dtd/package-1.0\">\n";
- $ret .= "<package version=\"1.0\" packagerversion=\"1.9.4\">\n" .
+ $ret .= "<package version=\"1.0\" packagerversion=\"1.10.1\">\n" .
" <name>$pkginfo[package]</name>";
if (isset($pkginfo['extends'])) {
$ret .= "\n<extends>$pkginfo[extends]</extends>";
}
if (count($min)) {
// get the highest minimum
- $min = array_pop($a = array_flip($min));
+ $a = array_flip($min);
+ $min = array_pop($a);
} else {
$min = false;
}
if (count($max)) {
// get the lowest maximum
- $max = array_shift($a = array_flip($max));
+ $a = array_flip($max);
+ $max = array_shift($a);
} else {
$max = false;
}
}
if (count($min)) {
// get the highest minimum
- $min = array_pop($a = array_flip($min));
+ $a = array_flip($min);
+ $min = array_pop($a);
} else {
$min = false;
}
if (count($max)) {
// get the lowest maximum
- $max = array_shift($a = array_flip($max));
+ $a = array_flip($max);
+ $max = array_shift($a);
} else {
$max = false;
}
return $ret;
}
}
-?>
\ No newline at end of file
+?>