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