Revision 1555
Added by Dietmar almost 13 years ago
functions.php | ||
---|---|---|
401 | 401 |
} |
402 | 402 |
|
403 | 403 |
// Function to create directories |
404 |
function make_dir($dir_name, $dir_mode = OCTAL_DIR_MODE) |
|
404 |
function make_dir($dir_name, $dir_mode = OCTAL_DIR_MODE $recursive=true)
|
|
405 | 405 |
{ |
406 |
$retVal = false; |
|
406 | 407 |
if(!is_dir($dir_name)) |
407 | 408 |
{ |
408 |
$umask = umask(0); |
|
409 |
mkdir($dir_name, $dir_mode); |
|
410 |
umask($umask); |
|
411 |
return true; |
|
412 |
} else { |
|
413 |
return false; |
|
409 |
$retVal = mkdir($dir_name, $dir_mode,$recursive); |
|
414 | 410 |
} |
411 |
return $retVal; |
|
415 | 412 |
} |
416 | 413 |
|
417 | 414 |
// Function to chmod files and directories |
... | ... | |
651 | 648 |
// $admin->print_error($MESSAGE['MEDIA_DIR_EXISTS']); |
652 | 649 |
$retVal[] = basename($sAbsDir).'::'.$MESSAGE['MEDIA_DIR_EXISTS']; |
653 | 650 |
} |
654 |
if ( !make_dir($sAbsDir) ) { |
|
651 |
if (!is_dir($sAbsDir) && !make_dir($sAbsDir) ) {
|
|
655 | 652 |
// $admin->print_error($MESSAGE['MEDIA_DIR_NOT_MADE']); |
656 | 653 |
$retVal[] = basename($sAbsDir).'::'.$MESSAGE['MEDIA_DIR_NOT_MADE']; |
657 | 654 |
} else { |
Also available in: Unified diff
! wb_quickSkin_28.php create _skin folders with folder protect file
! add a 3th parameter to function make_dir to allows the creation of nested directories specified in the pathname. Defaults to TRUE