cvs: pear-core /PEAR/Command Package.php

From: Date: Sat, 12 Jul 2008 14:23:15 +0000
Subject: cvs: pear-core /PEAR/Command Package.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7636@lists.php.net to get a copy of this message
dufuz Sat Jul 12 14:23:15 2008 UTC Modified files: /pear-core/PEAR/Command Package.php Log: Cosmetics http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Package.php?r1=1.129&r2=1.130&diff_format=u Index: pear-core/PEAR/Command/Package.php diff -u pear-core/PEAR/Command/Package.php:1.129 pear-core/PEAR/Command/Package.php:1.130 --- pear-core/PEAR/Command/Package.php:1.129 Fri Jul 11 20:17:38 2008 +++ pear-core/PEAR/Command/Package.php Sat Jul 12 14:23:15 2008 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Package.php,v 1.129 2008/07/11 20:17:38 dufuz Exp $ + * @version CVS: $Id: Package.php,v 1.130 2008/07/12 14:23:15 dufuz Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -317,24 +317,26 @@ $this->output = ''; $pkginfofile = isset($params[0]) ? $params[0] : 'package.xml'; $pkg2 = isset($params[1]) ? $params[1] : null; - if (!$pkg2 && !isset($params[0])) { - if (file_exists('package2.xml')) { - $pkg2 = 'package2.xml'; - } + if (!$pkg2 && !isset($params[0]) && file_exists('package2.xml')) { + $pkg2 = 'package2.xml'; } + $packager = &$this->getPackager(); $compress = empty($options['nocompress']) ? true : false; - $result = $packager->package($pkginfofile, $compress, $pkg2); + $result = $packager->package($pkginfofile, $compress, $pkg2); if (PEAR::isError($result)) { return $this->raiseError($result); } + // Don't want output, only the package file name just created if (isset($options['showname'])) { $this->output = $result; } + if ($this->output) { $this->ui->outputData($this->output, $command); } + return true; } @@ -344,9 +346,10 @@ function doPackageValidate($command, $options, $params) { $this->output = ''; - if (sizeof($params) < 1) { - $params[0] = "package.xml"; + if (count($params) < 1) { + $params[0] = 'package.xml'; } + $obj = &$this->getPackageFile($this->config, $this->_debug); $obj->rawReturn(); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); @@ -361,10 +364,12 @@ $info->getPackage() . '-' . $info->getVersion() . DIRECTORY_SEPARATOR . basename($info->getPackageFile())); } + PEAR::staticPopErrorHandling(); if (PEAR::isError($info)) { return $this->raiseError($info); } + $valid = false; if ($info->getPackagexmlVersion() == '2.0') { if ($valid = $info->validate(PEAR_VALIDATE_NORMAL)) { @@ -374,6 +379,7 @@ } else { $valid = $info->validate(PEAR_VALIDATE_PACKAGING); } + $err = $warn = array(); if ($errors = $info->getValidationWarnings()) { foreach ($errors as $error) { @@ -384,6 +390,7 @@ } } } + $this->_displayValidationResults($err, $warn); $this->ui->outputData($this->output, $command); return true; @@ -396,7 +403,7 @@ { $this->output = ''; $_cmd = $command; - if (sizeof($params) < 1) { + if (count($params) < 1) { $help = $this->getHelp($command); return $this->raiseError("$command: missing parameter: $help[0]"); }

« previous php.pear.core (#7636) next »