Files
librenms-librenms/includes/include-dir.inc.php
T

23 lines
709 B
PHP
Raw Normal View History

2011-09-19 02:27:33 +00:00
<?php
2012-05-25 12:24:34 +00:00
// This is an include so that we don't lose variable scope.
if ($include_dir_regexp == '' || !isset($include_dir_regexp)) {
$include_dir_regexp = '/\.inc\.php$/';
}
2011-09-19 02:27:33 +00:00
if ($handle = opendir($config['install_dir'].'/'.$include_dir)) {
while (false !== ($file = readdir($handle))) {
if (filetype($config['install_dir'].'/'.$include_dir.'/'.$file) == 'file' && preg_match($include_dir_regexp, $file)) {
if ($debug) {
echo 'Including: '.$config['install_dir'].'/'.$include_dir.'/'.$file."\n";
}
2011-09-19 02:27:33 +00:00
include $config['install_dir'].'/'.$include_dir.'/'.$file;
}
2011-09-19 02:27:33 +00:00
}
closedir($handle);
}
2011-09-19 02:27:33 +00:00
unset($include_dir_regexp, $include_dir);