本文整理匯總了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;
}