You are here

function boost_mkdir in Boost 7

Create a directory.

Parameters

$directory: relative directory.

2 calls to boost_mkdir()
boost_requirements in ./boost.install
Implements hook_requirements().
boost_write_file in ./boost.module
Write to a file. Ensures write is atomic via rename operation.

File

./boost.module, line 1412
Caches generated output as a static file to be served directly from the webserver.

Code

function boost_mkdir($directory) {
  global $_boost;

  // Only do something if it's not a dir.
  if (!is_dir($directory)) {
    if (!boost_in_cache_dir($directory)) {
      return FALSE;
    }

    // Try to create the directory.
    $mode = variable_get('file_chmod_directory', 0775);
    if (!mkdir($directory, $mode, TRUE)) {
      watchdog('boost', 'Could not create the directory %dir on your system', array(
        '%dir' => $directory,
      ), WATCHDOG_ERROR);
      return FALSE;
    }
    drupal_chmod($directory);
  }
  return TRUE;
}