diff options
| author | Tomas V.V.Cox <cox@php.net> | 2002-01-23 18:53:08 +0000 |
|---|---|---|
| committer | Tomas V.V.Cox <cox@php.net> | 2002-01-23 18:53:08 +0000 |
| commit | 62c923452080a17c25d87cc995b28e69f5deb3bf (patch) | |
| tree | af128223a4be160419b9a464f11c468f20e57f3a /pear/System.php | |
| parent | 2a02754b5240ed59f2b7d53fc0c6e037e265b54c (diff) | |
| download | php-git-62c923452080a17c25d87cc995b28e69f5deb3bf.tar.gz | |
Return false when the directory can not be created in mkDir()
Diffstat (limited to 'pear/System.php')
| -rw-r--r-- | pear/System.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pear/System.php b/pear/System.php index 939692b8a7..fd90901295 100644 --- a/pear/System.php +++ b/pear/System.php @@ -197,6 +197,7 @@ class System extends PEAR $mode = $opt[1]; } } + $ret = true; if (isset($create_parents)) { foreach($opts[1] as $dir) { $dirstack = array(); @@ -206,18 +207,18 @@ class System extends PEAR } 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; } /** |
