cvs: pear-core / System.php

From: Date: Sun, 05 Mar 2006 21:18:08 +0000
Subject: cvs: pear-core / System.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4609@lists.php.net to get a copy of this message
cellog Sun Mar 5 21:18:08 2006 UTC Modified files: /pear-core System.php Log: remove err suppression @ # some have to be left in here because # 1) no fatal errors are possible # 2) warnings are triggered and we don't want them http://cvs.php.net/viewcvs.cgi/pear-core/System.php?r1=1.53&r2=1.54&diff_format=u Index: pear-core/System.php diff -u pear-core/System.php:1.53 pear-core/System.php:1.54 --- pear-core/System.php:1.53 Fri Jan 6 04:47:36 2006 +++ pear-core/System.php Sun Mar 5 21:18:08 2006 @@ -15,7 +15,7 @@ * @author Tomas V.V.Cox <cox@idecnet.com> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: System.php,v 1.53 2006/01/06 04:47:36 cellog Exp $ + * @version CVS: $Id: System.php,v 1.54 2006/03/05 21:18:08 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -35,7 +35,9 @@ * Unix and Windows. The names and usage has been taken from its respectively * GNU commands. The functions will return (bool) false on error and will * trigger the error with the PHP trigger_error() function (you can silence -* the error by prefixing a '@' sign after the function call). +* the error by prefixing a '@' sign after the function call, but this +* is not recommended practice. Instead use an error handler with +* {@link set_error_handler()}). * * Documentation on this class you can find in: * http://pear.php.net/manual/ @@ -248,7 +250,8 @@ if (isset($create_parents)) { foreach($opts[1] as $dir) { $dirstack = array(); - while (!@is_dir($dir) && $dir != DIRECTORY_SEPARATOR) { + while ((!file_exists($dir) || !is_dir($dir)) && + $dir != DIRECTORY_SEPARATOR) { array_unshift($dirstack, $dir); $dir = dirname($dir); } @@ -264,7 +267,7 @@ } } else { foreach($opts[1] as $dir) { - if (!@is_dir($dir) && !mkdir($dir, $mode)) { + if ((@file_exists($dir) || !is_dir($dir)) && !mkdir($dir, $mode)) { $ret = false; } } @@ -306,6 +309,7 @@ $files[] = $args[$i]; } } + $outputfd = false; if (isset($mode)) { if (!$outputfd = fopen($outputfile, $mode)) { $err = System::raiseError("Could not open $outputfile"); @@ -319,7 +323,7 @@ continue; } while ($cont = fread($fd, 2048)) { - if (isset($outputfd)) { + if (is_resource($outputfd)) { fwrite($outputfd, $cont); } else { $ret .= $cont; @@ -327,7 +331,7 @@ } fclose($fd); } - if (@is_resource($outputfd)) { + if (is_resource($outputfd)) { fclose($outputfd); } return $ret;

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