本文整理汇总了PHP中SpecialVersion::getExtAuthorsFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecialVersion::getExtAuthorsFileName方法的具体用法?PHP SpecialVersion::getExtAuthorsFileName怎么用?PHP SpecialVersion::getExtAuthorsFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialVersion
的用法示例。
在下文中一共展示了SpecialVersion::getExtAuthorsFileName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendExtensions
protected function appendExtensions($property)
{
global $wgExtensionCredits;
$data = array();
foreach ($wgExtensionCredits as $type => $extensions) {
foreach ($extensions as $ext) {
$ret = array();
$ret['type'] = $type;
if (isset($ext['name'])) {
$ret['name'] = $ext['name'];
}
if (isset($ext['description'])) {
$ret['description'] = $ext['description'];
}
if (isset($ext['descriptionmsg'])) {
// Can be a string or array( key, param1, param2, ... )
if (is_array($ext['descriptionmsg'])) {
$ret['descriptionmsg'] = $ext['descriptionmsg'][0];
$ret['descriptionmsgparams'] = array_slice($ext['descriptionmsg'], 1);
$this->getResult()->setIndexedTagName($ret['descriptionmsgparams'], 'param');
} else {
$ret['descriptionmsg'] = $ext['descriptionmsg'];
}
}
if (isset($ext['author'])) {
$ret['author'] = is_array($ext['author']) ? implode(', ', $ext['author']) : $ext['author'];
}
if (isset($ext['url'])) {
$ret['url'] = $ext['url'];
}
if (isset($ext['version'])) {
$ret['version'] = $ext['version'];
} elseif (isset($ext['svn-revision']) && preg_match('/\\$(?:Rev|LastChangedRevision|Revision): *(\\d+)/', $ext['svn-revision'], $m)) {
$ret['version'] = 'r' . $m[1];
}
if (isset($ext['path'])) {
$extensionPath = dirname($ext['path']);
$gitInfo = new GitInfo($extensionPath);
$vcsVersion = $gitInfo->getHeadSHA1();
if ($vcsVersion !== false) {
$ret['vcs-system'] = 'git';
$ret['vcs-version'] = $vcsVersion;
$ret['vcs-url'] = $gitInfo->getHeadViewUrl();
$vcsDate = $gitInfo->getHeadCommitDate();
if ($vcsDate !== false) {
$ret['vcs-date'] = wfTimestamp(TS_ISO_8601, $vcsDate);
}
} else {
$svnInfo = SpecialVersion::getSvnInfo($extensionPath);
if ($svnInfo !== false) {
$ret['vcs-system'] = 'svn';
$ret['vcs-version'] = $svnInfo['checkout-rev'];
$ret['vcs-url'] = isset($svnInfo['viewvc-url']) ? $svnInfo['viewvc-url'] : '';
}
}
if (SpecialVersion::getExtLicenseFileName($extensionPath)) {
$ret['license-name'] = isset($ext['license-name']) ? $ext['license-name'] : '';
$ret['license'] = SpecialPage::getTitleFor('Version', "License/{$ext['name']}")->getLinkURL();
}
if (SpecialVersion::getExtAuthorsFileName($extensionPath)) {
$ret['credits'] = SpecialPage::getTitleFor('Version', "Credits/{$ext['name']}")->getLinkURL();
}
}
$data[] = $ret;
}
}
$this->getResult()->setIndexedTagName($data, 'ext');
return $this->getResult()->addValue('query', $property, $data);
}
示例2: appendExtensions
protected function appendExtensions($property)
{
$data = [];
foreach ($this->getConfig()->get('ExtensionCredits') as $type => $extensions) {
foreach ($extensions as $ext) {
$ret = [];
$ret['type'] = $type;
if (isset($ext['name'])) {
$ret['name'] = $ext['name'];
}
if (isset($ext['namemsg'])) {
$ret['namemsg'] = $ext['namemsg'];
}
if (isset($ext['description'])) {
$ret['description'] = $ext['description'];
}
if (isset($ext['descriptionmsg'])) {
// Can be a string or array( key, param1, param2, ... )
if (is_array($ext['descriptionmsg'])) {
$ret['descriptionmsg'] = $ext['descriptionmsg'][0];
$ret['descriptionmsgparams'] = array_slice($ext['descriptionmsg'], 1);
ApiResult::setIndexedTagName($ret['descriptionmsgparams'], 'param');
} else {
$ret['descriptionmsg'] = $ext['descriptionmsg'];
}
}
if (isset($ext['author'])) {
$ret['author'] = is_array($ext['author']) ? implode(', ', $ext['author']) : $ext['author'];
}
if (isset($ext['url'])) {
$ret['url'] = $ext['url'];
}
if (isset($ext['version'])) {
$ret['version'] = $ext['version'];
}
if (isset($ext['path'])) {
$extensionPath = dirname($ext['path']);
$gitInfo = new GitInfo($extensionPath);
$vcsVersion = $gitInfo->getHeadSHA1();
if ($vcsVersion !== false) {
$ret['vcs-system'] = 'git';
$ret['vcs-version'] = $vcsVersion;
$ret['vcs-url'] = $gitInfo->getHeadViewUrl();
$vcsDate = $gitInfo->getHeadCommitDate();
if ($vcsDate !== false) {
$ret['vcs-date'] = wfTimestamp(TS_ISO_8601, $vcsDate);
}
}
if (SpecialVersion::getExtLicenseFileName($extensionPath)) {
$ret['license-name'] = isset($ext['license-name']) ? $ext['license-name'] : '';
$ret['license'] = SpecialPage::getTitleFor('Version', "License/{$ext['name']}")->getLinkURL();
}
if (SpecialVersion::getExtAuthorsFileName($extensionPath)) {
$ret['credits'] = SpecialPage::getTitleFor('Version', "Credits/{$ext['name']}")->getLinkURL();
}
}
$data[] = $ret;
}
}
ApiResult::setIndexedTagName($data, 'ext');
return $this->getResult()->addValue('query', $property, $data);
}