Changeset 2478

Show
Ignore:
Timestamp:
06/02/08 06:31:26 (21 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.

Location:
branches/release-39/php/lib
Files:
2 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?> 
  • branches/release-39/php/lib/function.mtinclude.php

    r2196 r2478  
    231231        $include_dir = dirname($include_file); 
    232232        if (!file_exists($include_dir) && !is_dir($include_dir)) { 
    233             mkdir($include_dir, 0777, true); 
     233            mkpath($include_dir, 0777); 
    234234        } 
    235235        if (is_writable($include_dir)) {