function lmb_glob($path) { if (lmb_is_path_absolute($path)) { return glob($path); } $result = array(); foreach (lmb_get_include_path_items() as $dir) { if ($res = glob("{$dir}/{$path}")) { foreach ($res as $item) { $result[] = $item; } } } return $result; }
function locateSourceTemplate($file_name) { if (lmb_is_path_absolute($file_name)) { return $file_name; } $dirs = $this->config->tpl_scan_dirs; foreach ($dirs as $dir) { $file_path = $dir . '/' . $file_name; if (lmb_is_path_absolute($file_path) && file_exists($file_path)) { return $file_path; } if ($full_path = lmb_resolve_include_path($file_path)) { return $full_path; } } throw new lmbMacroException('template file not found', array('template' => $file_path)); }