本文整理汇总了PHP中GeSHi::get_language_fullname方法的典型用法代码示例。如果您正苦于以下问题:PHP GeSHi::get_language_fullname方法的具体用法?PHP GeSHi::get_language_fullname怎么用?PHP GeSHi::get_language_fullname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeSHi
的用法示例。
在下文中一共展示了GeSHi::get_language_fullname方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: LoadData
/**
* Loads data for this template
*/
protected function LoadData()
{
$head = $this->GetProject()->GetHeadCommit();
$data = null;
if ($this->params['graphtype'] == 'commitactivity') {
$data = array();
$commits = explode("\n", $this->exe->Execute($this->GetProject()->GetPath(), 'rev-list', array('--format=format:"%H %ct"', $head->GetHash())));
foreach ($commits as $commit) {
if (preg_match('/^([0-9a-fA-F]{40}) ([0-9]+)$/', $commit, $regs)) {
$data[] = array('CommitEpoch' => (int) $regs[2]);
}
}
} else {
if ($this->params['graphtype'] == 'languagedist') {
$data = array();
include_once GITPHP_GESHIDIR . "geshi.php";
$geshi = new GeSHi("", 'php');
$files = explode("\n", $this->exe->Execute($this->GetProject()->GetPath(), 'ls-tree', array('-r', '--name-only', $head->GetTree()->GetHash())));
foreach ($files as $file) {
$filename = GitPHP_Util::BaseName($file);
$lang = GitPHP_Util::GeshiFilenameToLanguage($filename);
if (empty($lang)) {
$lang = $geshi->get_language_name_from_extension(substr(strrchr($filename, '.'), 1));
if (empty($lang)) {
$lang = 'Other';
}
}
if (!empty($lang) && $lang !== 'Other') {
$fulllang = $geshi->get_language_fullname($lang);
if (!empty($fulllang)) {
$lang = $fulllang;
}
}
if (isset($data[$lang])) {
$data[$lang]++;
} else {
$data[$lang] = 1;
}
}
}
}
$this->tpl->assign('data', json_encode($data));
}