You are here

function textimage_directory_check in Textimage 5

Same name and namespace in other branches
  1. 5.2 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_image in ./textimage.module
Menu Callback function converts the current textimage path into an image. On first request, the image is returned to the browser from Drupal and then saved to the disk. On subsequent requests (with Clean URLs enabled), the cached image is loaded directly.

File

./textimage.module, line 922

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;
}