Show
Ignore:
Timestamp:
06/02/08 06:31:26 (18 months ago)
Author:
takayama
Message:

Fixed BugId:79959
* Created new function that creates directory recursively.
* Changed to new function call instead of mkdir call directly.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-39/php/lib/MTUtil.php

    r2317 r2478  
    13561356        $dir_name = dirname($dest); 
    13571357        if (!file_exists($dir_name)) { 
    1358           mkdir($dir_name, 0777, true); 
     1358          mkpath($dir_name, 0777); 
    13591359        } 
    13601360        if (!is_writable($dir_name)) { 
     
    16241624} 
    16251625 
     1626function mkpath($path, $mode = 0777) { 
     1627    // PHP5 supports recursive param 
     1628    if (version_compare(PHP_VERSION, '5.0.0', ">=")) 
     1629        return mkdir($path, $mode, true); 
     1630 
     1631    // for php4 
     1632    is_dir(dirname($path)) || mkpath(dirname($path), $mode); 
     1633    return is_dir($path) || @mkdir($path, $mode); 
     1634} 
     1635 
    16261636?>