function _module_builder_check_directory in Module Builder 5
Tediously required helper function to create a full directory that has more than one depth to be created. Filched from CCK.
Parameters
$directory: The directory path under files to check, such as 'photo/path/here'
1 call to _module_builder_check_directory()
- _module_builder_write_file in ./
module_builder.module - Helper function to write files saves moving this code while mucking about with different formsAPI approaches & quicker to shortcircuit
File
- ./
module_builder.module, line 683 - Builds scaffolding for custom modules.
Code
function _module_builder_check_directory($directory) {
foreach (explode('/', $directory) as $dir) {
$dirs[] = $dir;
$path = file_create_path(implode($dirs, '/'));
file_check_directory($path, FILE_CREATE_DIRECTORY);
}
return TRUE;
}