]> granicus.if.org Git - php/commitdiff
ZE2 fix on calls to mkdir() (thanks Brad Bulger <tater@potatoe.com>)
authorTomas V.V.Cox <cox@php.net>
Sat, 10 Aug 2002 16:33:08 +0000 (16:33 +0000)
committerTomas V.V.Cox <cox@php.net>
Sat, 10 Aug 2002 16:33:08 +0000 (16:33 +0000)
pear/System.php

index ab3a9642e181b5e5463f324de283c737f9fdd091..20196c08f2c850f3dd0a2c4aec01f486a83099bc 100644 (file)
@@ -203,7 +203,8 @@ class System
     }
 
     /**
-    * Make directories
+    * Make directories. Note that we use call_user_func('mkdir') to avoid
+    * a problem with ZE2 calling System::mkDir instead of the native PHP func.
     *
     * @param    string  $args    the name of the director(y|ies) to create
     * @return   bool    True for success
@@ -232,14 +233,14 @@ class System
                     $dir = dirname($dir);
                 }
                 while ($newdir = array_shift($dirstack)) {
-                    if (!mkdir($newdir, $mode)) {
+                    if (!call_user_func('mkdir', $newdir, $mode)) {
                         $ret = false;
                     }
                 }
             }
         } else {
             foreach($opts[1] as $dir) {
-                if (!@is_dir($dir) && !mkdir($dir, $mode)) {
+                if (!@is_dir($dir) && !call_user_func('mkdir', $dir, $mode)) {
                     $ret = false;
                 }
             }
@@ -354,7 +355,7 @@ class System
         $tmp = tempnam($tmpdir, $prefix);
         if (isset($tmp_is_dir)) {
             unlink($tmp); // be careful possible race condition here
-            if (!mkdir($tmp, 0700)) {
+            if (!call_user_func('mkdir', $tmp, 0700)) {
                 return System::raiseError("Unable to create temporary directory $tmpdir");
             }
         }