cvs: php4 /pear System.php

From: Date: Wed, 23 Jan 2002 18:53:08 +0000
Subject: cvs: php4 /pear System.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2062@lists.php.net to get a copy of this message
cox Wed Jan 23 13:53:08 2002 EDT Modified files: /php4/pear System.php Log: Return false when the directory can not be created in mkDir() Index: php4/pear/System.php diff -u php4/pear/System.php:1.7 php4/pear/System.php:1.8 --- php4/pear/System.php:1.7 Tue Dec 25 20:50:08 2001 +++ php4/pear/System.php Wed Jan 23 13:53:08 2002 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: System.php,v 1.7 2001/12/26 01:50:08 ssb Exp $ +// $Id: System.php,v 1.8 2002/01/23 18:53:08 cox Exp $ // // TODO: @@ -41,7 +41,7 @@ * * @package System * @author Tomas V.V.Cox <cox@idecnet.com> -* @version $Revision: 1.7 $ +* @version $Revision: 1.8 $ * @access public */ class System extends PEAR @@ -197,6 +197,7 @@ $mode = $opt[1]; } } + $ret = true; if (isset($create_parents)) { foreach($opts[1] as $dir) { $dirstack = array(); @@ -206,18 +207,18 @@ } while ($newdir = array_shift($dirstack)) { if (!mkdir($newdir, $mode)) { - break; // XXX error + $ret = false; } } } } else { foreach($opts[1] as $dir) { - if (!mkdir($dir, $mode)) { - continue; // XXX error + if (!@is_dir($dir) && !mkdir($dir, $mode)) { + $ret = false; } } } - return true; + return $ret; } /**

« previous php.pear.cvs (#2062) next »