cvs: pear-core /PEAR/Command Package.php Registry.php Remote.php Test.php

From: Date: Mon, 27 Mar 2006 05:00:12 +0000
Subject: cvs: pear-core /PEAR/Command Package.php Registry.php Remote.php Test.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4675@lists.php.net to get a copy of this message
cellog Mon Mar 27 05:00:12 2006 UTC Modified files: /pear-core/PEAR/Command Package.php Registry.php Remote.php Test.php Log: remove as many @ as possible

http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Package.php?r1=1.120&r2=1.121&diff_format=u Index: pear-core/PEAR/Command/Package.php diff -u pear-core/PEAR/Command/Package.php:1.120 pear-core/PEAR/Command/Package.php:1.121 --- pear-core/PEAR/Command/Package.php:1.120 Sat Mar 25 20:53:26 2006 +++ pear-core/PEAR/Command/Package.php Mon Mar 27 05:00:12 2006 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Package.php,v 1.120 2006/03/25 20:53:26 cellog Exp $ + * @version CVS: $Id: Package.php,v 1.121 2006/03/27 05:00:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -511,8 +511,11 @@ $cmd .= ' diff'; // the rest of the options are passed right on to "cvs diff" foreach ($options as $option => $optarg) { - $arg = @$this->commands[$command]['options'][$option]['arg']; - $short = @$this->commands[$command]['options'][$option]['shortopt']; + $arg = $short = false; + if (isset($this->commands[$command]['options'][$option])) { + $arg = $this->commands[$command]['options'][$option]['arg']; + $short = $this->commands[$command]['options'][$option]['shortopt']; + } $cmd .= $short ? " -$short" : " --$option"; if ($arg && $optarg) { $cmd .= ($short ? '' : '=') . escapeshellarg($optarg); @@ -701,7 +704,9 @@ if (file_exists("$tmpdir/package2.xml")) { $packagexml = 'package2.xml'; } - @unlink("$tmpdir/package.sig"); + if (file_exists("$tmpdir/package.sig")) { + unlink("$tmpdir/package.sig"); + } $input = $this->ui->userDialog($command, array('GnuPG Passphrase'), array('password')); http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Registry.php?r1=1.70&r2=1.71&diff_format=u Index: pear-core/PEAR/Command/Registry.php diff -u pear-core/PEAR/Command/Registry.php:1.70 pear-core/PEAR/Command/Registry.php:1.71 --- pear-core/PEAR/Command/Registry.php:1.70 Fri Jan 6 04:47:36 2006 +++ pear-core/PEAR/Command/Registry.php Mon Mar 27 05:00:12 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Registry.php,v 1.70 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: Registry.php,v 1.71 2006/03/27 05:00:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -197,9 +197,12 @@ return $this->raiseError('list-files expects 1 parameter'); } $reg = &$this->config->getRegistry(); + $fp = false; if (!is_dir($params[0]) && (file_exists($params[0]) || $fp = @fopen($params[0], 'r'))) { - @fclose($fp); + if ($fp) { + fclose($fp); + } if (!class_exists('PEAR_PackageFile')) { require_once 'PEAR/PackageFile.php'; } @@ -356,10 +359,12 @@ if (count($params) != 1) { return $this->raiseError('pear info expects 1 parameter'); } - $info = false; + $info = $fp = false; $reg = &$this->config->getRegistry(); - if ((@is_file($params[0]) && !is_dir($params[0])) || $fp = @fopen($params[0], 'r')) { - @fclose($fp); + if ((file_exists($params[0]) && is_file($params[0]) && !is_dir($params[0])) || $fp = @fopen($params[0], 'r')) { + if ($fp) { + fclose($fp); + } if (!class_exists('PEAR_PackageFile')) { require_once 'PEAR/PackageFile.php'; } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Remote.php?r1=1.92&r2=1.93&diff_format=u Index: pear-core/PEAR/Command/Remote.php diff -u pear-core/PEAR/Command/Remote.php:1.92 pear-core/PEAR/Command/Remote.php:1.93 --- pear-core/PEAR/Command/Remote.php:1.92 Thu Mar 23 05:46:08 2006 +++ pear-core/PEAR/Command/Remote.php Mon Mar 27 05:00:12 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Remote.php,v 1.92 2006/03/23 05:46:08 cellog Exp $ + * @version CVS: $Id: Remote.php,v 1.93 2006/03/27 05:00:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -375,10 +375,10 @@ } $data['data'][$info['category']][] = array( $reg->channelAlias($channel) . '/' . $name, - @$info['stable'], - @$installed['version'], - @$desc, - @$info['deps'], + isset($info['stable']) ? $info['stable'] : null, + isset($installed['version']) ? $installed['version'] : null, + isset($desc) ? $desc : null, + isset($info['deps']) ? $info['deps'] : null, ); } @@ -634,6 +634,9 @@ $cache_dir = $this->config->get('cache_dir'); $verbose = $this->config->get('verbose'); $output = ''; + if (!file_exists($cache_dir) || !is_dir($cache_dir)) { + return $this->raiseError("$cache_dir does not exist or is not a directory"); + } if (!($dp = @opendir($cache_dir))) { return $this->raiseError("opendir($cache_dir) failed: $php_errormsg"); } @@ -645,14 +648,19 @@ if (preg_match('/^xmlrpc_cache_[a-z0-9]{32}$/', $ent) || preg_match('/rest.cache(file|id)$/', $ent)) { $path = $cache_dir . DIRECTORY_SEPARATOR . $ent; - $ok = @unlink($path); + if (file_exists($path)) { + $ok = @unlink($path); + } else { + $ok = false; + $php_errormsg = ''; + } if ($ok) { if ($verbose >= 2) { $output .= "deleted $path\n"; } $num++; } elseif ($verbose >= 1) { - $output .= "failed to delete $path\n"; + $output .= "failed to delete $path $php_errormsg\n"; } } } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Test.php?r1=1.9&r2=1.10&diff_format=u Index: pear-core/PEAR/Command/Test.php diff -u pear-core/PEAR/Command/Test.php:1.9 pear-core/PEAR/Command/Test.php:1.10 --- pear-core/PEAR/Command/Test.php:1.9 Fri Feb 3 22:28:08 2006 +++ pear-core/PEAR/Command/Test.php Mon Mar 27 05:00:12 2006 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Test.php,v 1.9 2006/02/03 22:28:08 cellog Exp $ + * @version CVS: $Id: Test.php,v 1.10 2006/03/27 05:00:12 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -173,7 +173,7 @@ } $tests[] = $p; } else { - if (!@file_exists($p)) { + if (!file_exists($p)) { if (!preg_match('/\.phpt$/', $p)) { $p .= '.phpt'; } @@ -201,7 +201,9 @@ $this->ui->outputData('Running ' . count($tests) . ' tests', $command); $start = time(); if (isset($options['realtimelog'])) { - @unlink('run-tests.log'); + if (file_exists('run-tests.log')) { + unlink('run-tests.log'); + } } foreach ($tests as $t) { if (isset($options['realtimelog'])) { @@ -254,7 +256,7 @@ fclose($fp); $this->ui->outputData('wrote log to "' . realpath('run-tests.log') . '"', $command); } - } elseif (@file_exists('run-tests.log') && !@is_dir('run-tests.log')) { + } elseif (file_exists('run-tests.log') && !is_dir('run-tests.log')) { @unlink('run-tests.log'); } $this->ui->outputData('TOTAL TIME: ' . $total);
« previous php.pear.core (#4675) next »