function _zenophile_populate_files in Zenophile 6.2
Same name and namespace in other branches
- 7 zenophile.module \_zenophile_populate_files()
Recursively create a list of files in a directory.
Parameters
$dir: Directory to add files from
$cur_path: Path to start from
Return value
An array of file names.
2 calls to _zenophile_populate_files()
- zenophile_create_submit in ./
zenophile.module - Submit function for zenophile_create().
- zenophile_midnight_zenophile_alter in zenophile_midnight/
zenophile_midnight.module - Implementation of hook_zenophile_alter() (a Zenophile hook).
File
- ./
zenophile.module, line 450 - Creates Zen subthemes quickly and easily.
Code
function _zenophile_populate_files($dir, $cur_path) {
$files = array();
if ($cur_path !== '') {
$cur_path .= '/';
}
/* die("{$dir}/{$cur_path}"); */
$h = opendir("{$dir}/{$cur_path}");
while (($file = readdir($h)) !== FALSE) {
if ($file !== 'CVS' && $file !== 'images-source' && $file[0] !== '.') {
// Don't copy CVS directories, hidden files, or the images-source
// directory - perhaps the latter should be a user-controllable option.
if (is_dir("{$dir}/{$cur_path}{$file}")) {
$files["{$cur_path}{$file}"] = 'dir';
$files = array_merge($files, _zenophile_populate_files($dir, "{$cur_path}{$file}"));
}
else {
$files["{$cur_path}{$file}"] = 'file';
}
}
}
return $files;
}