Commit 241ace96 authored by Penny Leach's avatar Penny Leach
Browse files

added check for template dir in check_sanity, added helper

get_dir_contents function
parent fde8ff42
......@@ -121,8 +121,9 @@ function ensure_sanity() {
}
// @todo the results of these should be checked
check_dir_exists(get_config('dataroot').'smarty/compile');
check_dir_exists(get_config('dataroot').'smarty/cache');
check_dir_exists(get_config('dataroot') . 'smarty/compile');
check_dir_exists(get_config('dataroot') . 'smarty/cache');
check_dir_exists(get_config('dataroot') . 'templates');
}
......@@ -1531,4 +1532,16 @@ function can_view_view($view_id, $user_id=null) {
return false;
}
function get_dir_contents($directory) {
$contents = array();
$dirhandle = opendir($directory);
while (false !== ($dir = readdir($dirhandle))) {
if (strpos($dir, '.') === 0) {
continue;
}
$contents[] = $dir;
}
return $contents;
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment