本文整理汇总了PHP中GeSHi::getHumanLanguageName方法的典型用法代码示例。如果您正苦于以下问题:PHP GeSHi::getHumanLanguageName方法的具体用法?PHP GeSHi::getHumanLanguageName怎么用?PHP GeSHi::getHumanLanguageName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeSHi
的用法示例。
在下文中一共展示了GeSHi::getHumanLanguageName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSupportedLanguages
/**
* @todo document this function
* @todo This and other methods share a lot of directory traversal
* functionality, which could be split out somehow.
* @todo actually, this should be implemented using a registry
*/
public function getSupportedLanguages($return_human = false)
{
$languages = array();
$ignore = array('.', '..', 'CVS');
$dh = opendir(GESHI_LANGUAGES_ROOT);
while (false !== ($dir = readdir($dh))) {
if (in_array($dir, $ignore) || is_file(GESHI_LANGUAGES_ROOT . $dir)) {
continue;
}
// Check the directory for the dialect files
$ldh = opendir(GESHI_LANGUAGES_ROOT . $dir);
while (false !== ($file = readdir($ldh))) {
if (in_array($file, $ignore) || is_dir(GESHI_LANGUAGES_ROOT . "{$dir}/{$file}") || substr($file, -4) != '.php') {
continue;
}
// Found a language file
$file = substr($file, 0, -4);
if ('common' == $file || 'class' == substr($file, 0, 5)) {
continue;
}
if ($return_human) {
$languages["{$dir}/{$file}"] = GeSHi::getHumanLanguageName("{$dir}/{$file}");
} else {
$languages[] = "{$dir}/{$file}";
}
}
}
return $languages;
}