* @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: v2.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
*/
/**
* The constructor merely sets up the private error stack
*/
- function PEAR_PackageFile_v2()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v2', false, null);
$this->_isValid = false;
}
+ /**
+ * PHP 4 style constructor for backwards compatibility.
+ * Used by PEAR_PackageFileManager2
+ */
+ public function PEAR_PackageFile_v2()
+ {
+ $this->__construct();
+ }
+
/**
* To make unit-testing easier
* @param PEAR_Frontend_*
*/
function &getPEARDownloader(&$i, $o, &$c)
{
- $z = &new PEAR_Downloader($i, $o, $c);
+ $z = new PEAR_Downloader($i, $o, $c);
return $z;
}
if (!class_exists('PEAR_Dependency2')) {
require_once 'PEAR/Dependency2.php';
}
- $z = &new PEAR_Dependency2($c, $o, $p, $s);
+ $z = new PEAR_Dependency2($c, $o, $p, $s);
return $z;
}
$atts = $filelist[$name];
foreach ($tasks as $tag => $raw) {
$task = $this->getTask($tag);
- $task = &new $task($this->_config, $common, PEAR_TASK_INSTALL);
+ $task = new $task($this->_config, $common, PEAR_TASK_INSTALL);
if ($task->isScript()) {
$ret[] = $filelist[$name]['installed_as'];
}
$atts = $filelist[$name];
foreach ($tasks as $tag => $raw) {
$taskname = $this->getTask($tag);
- $task = &new $taskname($this->_config, $common, PEAR_TASK_INSTALL);
+ $task = new $taskname($this->_config, $common, PEAR_TASK_INSTALL);
if (!$task->isScript()) {
continue; // scripts are only handled after installation
}
$contents['dir']['file'] = array($contents['dir']['file']);
}
foreach ($contents['dir']['file'] as $file) {
+ if (!isset($file['attribs']['name'])) {
+ continue;
+ }
$name = $file['attribs']['name'];
if (!$preserve) {
$file = $file['attribs'];
return implode('', file($file));
}
} else { // tgz
- $tar = &new Archive_Tar($this->_archiveFile);
+ $tar = new Archive_Tar($this->_archiveFile);
$tar->pushErrorHandling(PEAR_ERROR_RETURN);
if ($file != 'package.xml' && $file != 'package2.xml') {
$file = $this->getPackage() . '-' . $this->getVersion() . '/' . $file;
if (!class_exists('PEAR_PackageFile_Generator_v2')) {
require_once 'PEAR/PackageFile/Generator/v2.php';
}
- $a = &new PEAR_PackageFile_Generator_v2($this);
+ $a = new PEAR_PackageFile_Generator_v2($this);
return $a;
}