You are here

function textimage_directory_check in Textimage 5.2

Same name and namespace in other branches
  1. 5 textimage.module \textimage_directory_check()
  2. 6.2 textimage.module \textimage_directory_check()
  3. 7.2 textimage.module \textimage_directory_check()

Create the image directory relative to the 'files' dir - if user specified one Won't allow form submit unless the directory exists & is writable

Parameters

$directory_path: String containing the path of the directory to check.

1 call to textimage_directory_check()
textimage_build_image in ./textimage.module

File

./textimage.module, line 557

Code

function textimage_directory_check($directory_path) {

  // create each directory necessary if it doesn't exist
  foreach (explode('/', $directory_path) as $dir) {
    $dirs[] = $dir;
    if (!file_check_directory(implode($dirs, '/'), FILE_CREATE_DIRECTORY)) {
      return FALSE;
    }
  }
  return TRUE;
}