You are here

function _boost_mkdir_p in Boost 5

Same name and namespace in other branches
  1. 6 boost.module \_boost_mkdir_p()

Recursive version of mkdir(), compatible with PHP4.

1 call to _boost_mkdir_p()
boost_cache_set in ./boost.api.inc
Replaces the cached contents of the specified page, if stale.

File

./boost.helpers.inc, line 13
Various helper functions for the Boost module, to make life a bit easier.

Code

function _boost_mkdir_p($pathname, $mode = 0775, $recursive = TRUE) {
  if (is_dir($pathname)) {
    return TRUE;
  }
  if ($recursive && !_boost_mkdir_p(dirname($pathname), $mode)) {
    return FALSE;
  }
  if ($result = @mkdir($pathname, $mode)) {
    @chmod($pathname, $mode);
  }
  return $result;
}