function _forena_verify_directory in Forena Reports 6
Same name and namespace in other branches
- 8 forena.module \_forena_verify_directory()
- 6.2 forena.admin.inc \_forena_verify_directory()
- 7.5 forena.module \_forena_verify_directory()
- 7 forena.admin.inc \_forena_verify_directory()
- 7.2 forena.admin.inc \_forena_verify_directory()
- 7.3 forena.module \_forena_verify_directory()
- 7.4 forena.module \_forena_verify_directory()
Make sure a drectory exists in the report path prior to save.
Parameters
unknown_type $fullpath:
unknown_type $recursive:
1 call to _forena_verify_directory()
- forena_save_report in ./
forena.admin.inc - Save the report file to disk
File
- ./
forena.admin.inc, line 14
Code
function _forena_verify_directory($fullpath, $recursive = FALSE) {
static $path = '';
if (!$recursive) {
$path = forena_report_path();
}
list($dir, $file) = explode('/', $fullpath, 2);
$path .= '/' . $dir;
// Path
if (!file_exists($path) && $file) {
mkdir($path);
}
// Recurse to next file.
if ($file && strpos($file, '/')) {
watchdog('debug', $file);
_forena_verify_directory($file, TRUE);
}
}