function textimage_directory_check in Textimage 6.2
Same name and namespace in other branches
- 5.2 textimage.module \textimage_directory_check()
- 5 textimage.module \textimage_directory_check()
- 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()
File
- ./
textimage.module, line 582
Code
function textimage_directory_check($directory_path) {
// create each directory necessary if it doesn't exist
$directory_path = drupal_substr($directory_path, drupal_strlen(file_directory_path()) + 1);
foreach (explode('/', $directory_path) as $dir) {
$dirs[] = $dir;
$dir = file_directory_path() . '/' . implode($dirs, '/');
if (!file_check_directory($dir, FILE_CREATE_DIRECTORY)) {
return FALSE;
}
}
return TRUE;
}