本文整理汇总了PHP中SpecialVersion类的典型用法代码示例。如果您正苦于以下问题:PHP SpecialVersion类的具体用法?PHP SpecialVersion怎么用?PHP SpecialVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SpecialVersion类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param $main ApiMain
* @param $action string
*/
public function __construct($main, $action)
{
parent::__construct($main, $action);
// Allow custom modules to be added in LocalSettings.php
global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules, $wgMemc, $wgAPICacheHelpTimeout;
self::appendUserModules($this->mQueryPropModules, $wgAPIPropModules);
self::appendUserModules($this->mQueryListModules, $wgAPIListModules);
self::appendUserModules($this->mQueryMetaModules, $wgAPIMetaModules);
$this->mPropModuleNames = array_keys($this->mQueryPropModules);
$this->mListModuleNames = array_keys($this->mQueryListModules);
$this->mMetaModuleNames = array_keys($this->mQueryMetaModules);
// Get array of query generators from cache if present
$key = wfMemcKey('apiquerygenerators', SpecialVersion::getVersion('nodb'));
if ($wgAPICacheHelpTimeout > 0) {
$cached = $wgMemc->get($key);
if ($cached) {
$this->mAllowedGenerators = $cached;
return;
}
}
$this->makeGeneratorList($this->mQueryPropModules);
$this->makeGeneratorList($this->mQueryListModules);
if ($wgAPICacheHelpTimeout > 0) {
$wgMemc->set($key, $this->mAllowedGenerators, $wgAPICacheHelpTimeout);
}
}
开发者ID:seedbank,项目名称:old-repo,代码行数:30,代码来源:ApiQuery.php
示例2: heading
function heading()
{
$version = SpecialVersion::getVersion('nodb');
echo "'''Statistics are based on:''' <code>" . $version . "</code>\n\n";
echo "'''Note:''' These statistics can be generated by running <code>php maintenance/language/transstat.php</code>.\n\n";
echo "For additional information on specific languages (the message names, the actual problems, etc.), run <code>php maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
echo '{| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;" width="100%"' . "\n";
}
开发者ID:GodelDesign,项目名称:Godel,代码行数:8,代码来源:StatOutputs.php
示例3: formatCredits
function formatCredits($extension)
{
$out = '';
$name = isset($extension['name']) ? $extension['name'] : '[no name]';
if (isset($extension['path'])) {
$svnInfo = SpecialVersion::getSvnInfo(dirname($extension['path']));
$directoryRev = isset($svnInfo['directory-rev']) ? $svnInfo['directory-rev'] : null;
$checkoutRev = isset($svnInfo['checkout-rev']) ? $svnInfo['checkout-rev'] : null;
$viewvcUrl = isset($svnInfo['viewvc-url']) ? $svnInfo['viewvc-url'] : null;
} else {
$directoryRev = null;
$checkoutRev = null;
$viewvcUrl = null;
}
# Make main link (or just the name if there is no URL)
if (isset($extension['url'])) {
$mainLink = "[{$extension['url']} {$name}]";
} else {
$mainLink = $name;
}
# Version
if (isset($extension['version'])) {
$versionText = '<span class="mw-version-ext-version"><em>' . wfMsg('version-version', $extension['version']) . '</em></span> | ';
} else {
$versionText = '';
}
/*
if ( $checkoutRev ) {
$svnText = wfMsg( 'version-svn-revision', $directoryRev, $checkoutRev );
$svnText = isset( $viewvcUrl ) ? "[$viewvcUrl $svnText]" : $svnText;
} else {
$svnText = false;
}*/
# Make description text
$description = isset($extension['description']) ? $extension['description'] : '';
if (isset($extension['descriptionmsg'])) {
# Look for a localized description
$descriptionMsg = $extension['descriptionmsg'];
if (is_array($descriptionMsg)) {
$descriptionMsgKey = $descriptionMsg[0];
// Get the message key
array_shift($descriptionMsg);
// Shift out the message key to get the parameters only
array_map("htmlspecialchars", $descriptionMsg);
// For sanity
$msg = wfMsg($descriptionMsgKey, $descriptionMsg);
} else {
$msg = wfMsg($descriptionMsg);
}
if (!wfEmptyMsg($descriptionMsg, $msg) && $msg != '') {
$description = $msg;
}
}
$author = isset($extension['author']) ? $extension['author'] : array();
$extDescAuthor = "<td>{$description} <br />" . $versionText . $this->listToText((array) $author, false) . "</td>\n\t\t\t</tr>\n";
$extNameVer = "<tr>\n\t\t\t\t<td><em>{$mainLink}</em></td>";
return $extNameVer . $extDescAuthor;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:58,代码来源:SpecialExtensionManagement.php
示例4: efAddShoutWikiInfo
/**
* Adds ShoutWiki component into Special:Version and sets MW's version to $wgVersion
*
* @param $software Array: array of software information
* @return Boolean: true
*/
function efAddShoutWikiInfo( &$software ) {
global $wgVersion, $IP;
// Set MW version to $wgVersion
$software['[http://www.mediawiki.org/ MediaWiki]'] = $wgVersion;
// Add ShoutWiki component (release branch name) and its revision number
$software['[http://www.shoutwiki.com/ ShoutWiki]'] = efGetSvnURL( $IP ) . ' (r' . SpecialVersion::getSvnRevision( $IP ) . ')';
return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:17,代码来源:SoftwareVersion.php
示例5: execute
/**
* @return string
*/
public function execute()
{
if ($this->parent->request->wasPosted()) {
if ($this->getVar('_Environment')) {
return 'continue';
}
}
$this->parent->output->addWikiText(wfMessage('config-welcome')->plain());
$status = $this->parent->doEnvironmentChecks();
if ($status->isGood()) {
$this->parent->output->addHTML('<span class="success-message">' . wfMessage('config-env-good')->escaped() . '</span>');
$this->parent->output->addWikiText(wfMessage('config-copyright', SpecialVersion::getCopyrightAndAuthorList())->plain());
$this->startForm();
$this->endForm();
} else {
$this->parent->showStatusMessage($status);
}
return '';
}
开发者ID:claudinec,项目名称:galan-wiki,代码行数:22,代码来源:WebInstallerWelcome.php
示例6: heading
function heading()
{
global $wgDummyLanguageCodes;
$version = SpecialVersion::getVersion('nodb');
echo "'''Statistics are based on:''' <code>" . $version . "</code>\n\n";
echo "'''Note:''' These statistics can be generated by running " . "<code>php maintenance/language/transstat.php</code>.\n\n";
echo "For additional information on specific languages (the message names, the actual " . "problems, etc.), run <code>php maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
echo 'English (en) is excluded because it is the default localization';
if (is_array($wgDummyLanguageCodes)) {
$dummyCodes = array();
foreach ($wgDummyLanguageCodes as $dummyCode => $correctCode) {
$dummyCodes[] = Language::fetchLanguageName($dummyCode) . ' (' . $dummyCode . ')';
}
echo ', as well as the following languages that are not intended for ' . 'system message translations, usually because they redirect to other ' . 'language codes: ' . implode(', ', $dummyCodes);
}
echo ".\n\n";
# dot to end sentence
echo '{| class="sortable wikitable" border="2" style="background-color: #F9F9F9; ' . 'border: 1px #AAAAAA solid; border-collapse: collapse; clear:both; width:100%;"' . "\n";
}
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:19,代码来源:StatOutputs.php
示例7: register
function register()
{
global $wgContLang, $wgNamespaceAliases, $wgNonincludableNamespaces;
$lib = array('loadSiteStats' => array($this, 'loadSiteStats'), 'getNsIndex' => array($this, 'getNsIndex'), 'pagesInCategory' => array($this, 'pagesInCategory'), 'pagesInNamespace' => array($this, 'pagesInNamespace'), 'usersInGroup' => array($this, 'usersInGroup'));
$info = array('siteName' => $GLOBALS['wgSitename'], 'server' => $GLOBALS['wgServer'], 'scriptPath' => $GLOBALS['wgScriptPath'], 'stylePath' => $GLOBALS['wgStylePath'], 'currentVersion' => SpecialVersion::getVersion());
if (!self::$namespacesCache) {
$namespaces = array();
$namespacesByName = array();
foreach ($wgContLang->getFormattedNamespaces() as $ns => $title) {
$canonical = MWNamespace::getCanonicalName($ns);
$namespaces[$ns] = array('id' => $ns, 'name' => $title, 'canonicalName' => strtr($canonical, '_', ' '), 'hasSubpages' => MWNamespace::hasSubpages($ns), 'hasGenderDistinction' => MWNamespace::hasGenderDistinction($ns), 'isCapitalized' => MWNamespace::isCapitalized($ns), 'isContent' => MWNamespace::isContent($ns), 'isIncludable' => !($wgNonincludableNamespaces && in_array($ns, $wgNonincludableNamespaces)), 'isMovable' => MWNamespace::isMovable($ns), 'isSubject' => MWNamespace::isSubject($ns), 'isTalk' => MWNamespace::isTalk($ns), 'aliases' => array());
if ($ns >= NS_MAIN) {
$namespaces[$ns]['subject'] = MWNamespace::getSubject($ns);
$namespaces[$ns]['talk'] = MWNamespace::getTalk($ns);
$namespaces[$ns]['associated'] = MWNamespace::getAssociated($ns);
} else {
$namespaces[$ns]['subject'] = $ns;
}
$namespacesByName[strtr($title, ' ', '_')] = $ns;
if ($canonical) {
$namespacesByName[$canonical] = $ns;
}
}
$aliases = array_merge($wgNamespaceAliases, $wgContLang->getNamespaceAliases());
foreach ($aliases as $title => $ns) {
if (!isset($namespacesByName[$title])) {
$ct = count($namespaces[$ns]['aliases']);
$namespaces[$ns]['aliases'][$ct + 1] = $title;
$namespacesByName[$title] = $ns;
}
}
$namespaces[NS_MAIN]['displayName'] = wfMessage('blanknamespace')->text();
self::$namespacesCache = $namespaces;
}
$info['namespaces'] = self::$namespacesCache;
if (self::$siteStatsLoaded) {
$stats = $this->loadSiteStats();
$info['stats'] = $stats[0];
}
$this->getEngine()->registerInterface('mw.site.lua', $lib, $info);
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:41,代码来源:SiteLibrary.php
示例8: register
function register()
{
global $wgContLang, $wgNamespaceAliases, $wgDisableCounters;
$lib = array('getNsIndex' => array($this, 'getNsIndex'), 'pagesInCategory' => array($this, 'pagesInCategory'), 'pagesInNamespace' => array($this, 'pagesInNamespace'), 'usersInGroup' => array($this, 'usersInGroup'), 'interwikiMap' => array($this, 'interwikiMap'));
$info = array('siteName' => $GLOBALS['wgSitename'], 'server' => $GLOBALS['wgServer'], 'scriptPath' => $GLOBALS['wgScriptPath'], 'stylePath' => $GLOBALS['wgStylePath'], 'currentVersion' => SpecialVersion::getVersion());
if (!self::$namespacesCache || self::$namespacesCacheLang !== $wgContLang->getCode()) {
$namespaces = array();
$namespacesByName = array();
foreach ($wgContLang->getFormattedNamespaces() as $ns => $title) {
$canonical = MWNamespace::getCanonicalName($ns);
$namespaces[$ns] = array('id' => $ns, 'name' => $title, 'canonicalName' => strtr($canonical, '_', ' '), 'hasSubpages' => MWNamespace::hasSubpages($ns), 'hasGenderDistinction' => MWNamespace::hasGenderDistinction($ns), 'isCapitalized' => MWNamespace::isCapitalized($ns), 'isContent' => MWNamespace::isContent($ns), 'isIncludable' => !MWNamespace::isNonincludable($ns), 'isMovable' => MWNamespace::isMovable($ns), 'isSubject' => MWNamespace::isSubject($ns), 'isTalk' => MWNamespace::isTalk($ns), 'defaultContentModel' => MWNamespace::getNamespaceContentModel($ns), 'aliases' => array());
if ($ns >= NS_MAIN) {
$namespaces[$ns]['subject'] = MWNamespace::getSubject($ns);
$namespaces[$ns]['talk'] = MWNamespace::getTalk($ns);
$namespaces[$ns]['associated'] = MWNamespace::getAssociated($ns);
} else {
$namespaces[$ns]['subject'] = $ns;
}
$namespacesByName[strtr($title, ' ', '_')] = $ns;
if ($canonical) {
$namespacesByName[$canonical] = $ns;
}
}
$aliases = array_merge($wgNamespaceAliases, $wgContLang->getNamespaceAliases());
foreach ($aliases as $title => $ns) {
if (!isset($namespacesByName[$title]) && isset($namespaces[$ns])) {
$ct = count($namespaces[$ns]['aliases']);
$namespaces[$ns]['aliases'][$ct + 1] = $title;
$namespacesByName[$title] = $ns;
}
}
$namespaces[NS_MAIN]['displayName'] = wfMessage('blanknamespace')->inContentLanguage()->text();
self::$namespacesCache = $namespaces;
self::$namespacesCacheLang = $wgContLang->getCode();
}
$info['namespaces'] = self::$namespacesCache;
$info['stats'] = array('pages' => (int) SiteStats::pages(), 'articles' => (int) SiteStats::articles(), 'files' => (int) SiteStats::images(), 'edits' => (int) SiteStats::edits(), 'views' => $wgDisableCounters ? null : (int) SiteStats::views(), 'users' => (int) SiteStats::users(), 'activeUsers' => (int) SiteStats::activeUsers(), 'admins' => (int) SiteStats::numberingroup('sysop'));
return $this->getEngine()->registerInterface('mw.site.lua', $lib, $info);
}
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:39,代码来源:SiteLibrary.php
示例9: appendGeneralInfo
protected function appendGeneralInfo($property)
{
global $wgSitename, $wgVersion, $wgCapitalLinks, $wgRightsCode, $wgRightsText, $wgLanguageCode, $IP;
$data = array();
$mainPage = Title::newFromText(wfMsgForContent('mainpage'));
$data['mainpage'] = $mainPage->getText();
$data['base'] = $mainPage->getFullUrl();
$data['sitename'] = $wgSitename;
$data['generator'] = "MediaWiki {$wgVersion}";
$svn = SpecialVersion::getSvnRevision($IP);
if ($svn) {
$data['rev'] = $svn;
}
$data['case'] = $wgCapitalLinks ? 'first-letter' : 'case-sensitive';
// 'case-insensitive' option is reserved for future
if (isset($wgRightsCode)) {
$data['rightscode'] = $wgRightsCode;
}
$data['rights'] = $wgRightsText;
$data['lang'] = $wgLanguageCode;
$this->getResult()->addValue('query', $property, $data);
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:22,代码来源:ApiQuerySiteinfo.php
示例10: getVariableValue
//.........这里部分代码省略.........
// *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONYEAR}} used, setting vary-revision...\n");
return substr($this->getRevisionTimestamp(), 0, 4);
case 'revisiontimestamp':
// Let the edit saving system know we should parse the page
// *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONTIMESTAMP}} used, setting vary-revision...\n");
return $this->getRevisionTimestamp();
case 'revisionuser':
// Let the edit saving system know we should parse the page
// *after* a revision ID has been assigned. This is for null edits.
$this->mOutput->setFlag('vary-revision');
wfDebug(__METHOD__ . ": {{REVISIONUSER}} used, setting vary-revision...\n");
return $this->getRevisionUser();
case 'namespace':
return str_replace('_', ' ', $wgContLang->getNsText($this->mTitle->getNamespace()));
case 'namespacee':
return wfUrlencode($wgContLang->getNsText($this->mTitle->getNamespace()));
case 'talkspace':
return $this->mTitle->canTalk() ? str_replace('_', ' ', $this->mTitle->getTalkNsText()) : '';
case 'talkspacee':
return $this->mTitle->canTalk() ? wfUrlencode($this->mTitle->getTalkNsText()) : '';
case 'subjectspace':
return $this->mTitle->getSubjectNsText();
case 'subjectspacee':
return wfUrlencode($this->mTitle->getSubjectNsText());
case 'currentdayname':
return $this->mVarCache[$index] = $wgContLang->getWeekdayName(gmdate('w', $ts) + 1);
case 'currentyear':
return $this->mVarCache[$index] = $wgContLang->formatNum(gmdate('Y', $ts), true);
case 'currenttime':
return $this->mVarCache[$index] = $wgContLang->time(wfTimestamp(TS_MW, $ts), false, false);
case 'currenthour':
return $this->mVarCache[$index] = $wgContLang->formatNum(gmdate('H', $ts), true);
case 'currentweek':
// @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
// int to remove the padding
return $this->mVarCache[$index] = $wgContLang->formatNum((int) gmdate('W', $ts));
case 'currentdow':
return $this->mVarCache[$index] = $wgContLang->formatNum(gmdate('w', $ts));
case 'localdayname':
return $this->mVarCache[$index] = $wgContLang->getWeekdayName($localDayOfWeek + 1);
case 'localyear':
return $this->mVarCache[$index] = $wgContLang->formatNum($localYear, true);
case 'localtime':
return $this->mVarCache[$index] = $wgContLang->time($localTimestamp, false, false);
case 'localhour':
return $this->mVarCache[$index] = $wgContLang->formatNum($localHour, true);
case 'localweek':
// @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
// int to remove the padding
return $this->mVarCache[$index] = $wgContLang->formatNum((int) $localWeek);
case 'localdow':
return $this->mVarCache[$index] = $wgContLang->formatNum($localDayOfWeek);
case 'numberofarticles':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::articles());
case 'numberoffiles':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::images());
case 'numberofusers':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::users());
case 'numberofactiveusers':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::activeUsers());
case 'numberofpages':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::pages());
case 'numberofadmins':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::numberingroup('sysop'));
case 'numberofedits':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::edits());
case 'numberofviews':
return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::views());
case 'currenttimestamp':
return $this->mVarCache[$index] = wfTimestamp(TS_MW, $ts);
case 'localtimestamp':
return $this->mVarCache[$index] = $localTimestamp;
case 'currentversion':
return $this->mVarCache[$index] = SpecialVersion::getVersion();
case 'sitename':
return $wgSitename;
case 'server':
return $wgServer;
case 'servername':
return $wgServerName;
case 'scriptpath':
return $wgScriptPath;
case 'directionmark':
return $wgContLang->getDirMark();
case 'contentlanguage':
global $wgContLanguageCode;
return $wgContLanguageCode;
default:
$ret = null;
if (wfRunHooks('ParserGetVariableValueSwitch', array(&$this, &$this->mVarCache, &$index, &$ret))) {
return $ret;
} else {
return null;
}
}
}
开发者ID:josephdye,项目名称:wikireader,代码行数:101,代码来源:Parser.php
示例11: tests
[--help]
Options:
--quick Suppress diff output of failed tests
--quiet Suppress notification of passed tests (shows only failed tests)
--show-output Show expected and actual output
--color Override terminal detection and force color output on or off
'light' option is similar to 'yes' but with color for dark backgrounds
--regex Only run tests whose descriptions which match given regex
--file Run test cases from a custom file instead of parserTests.txt
--help Show this help message
ENDS;
exit(0);
}
# There is a convention that the parser should never
# refer to $wgTitle directly, but instead use the title
# passed to it.
$wgTitle = Title::newFromText('Parser test script do not use');
$tester = new ParserTest();
if (isset($options['file'])) {
$files = array($options['file']);
} else {
// Default parser tests and any set from extensions or local config
$files = $wgParserTestFiles;
}
# Print out software version to assist with locating regressions
$version = SpecialVersion::getVersion();
echo "This is MediaWiki version {$version}.\n";
$ok = $tester->runTestsFromFiles($files);
exit($ok ? 0 : -1);
开发者ID:negabaro,项目名称:alfresco,代码行数:31,代码来源:parserTests.php
示例12: getVersion
/**
* Returns the version information of this file, plus it includes
* the versions for all files that are not callable proper API modules
*/
public function getVersion()
{
$vers = array();
$vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
$vers[] = __CLASS__ . ': $Id: ApiMain.php 70066 2010-07-28 05:52:32Z tstarling $';
$vers[] = ApiBase::getBaseVersion();
$vers[] = ApiFormatBase::getBaseVersion();
$vers[] = ApiQueryBase::getBaseVersion();
return $vers;
}
开发者ID:rocLv,项目名称:conference,代码行数:14,代码来源:ApiMain.php
示例13: getVariableValue
//.........这里部分代码省略.........
$value = $pageLang->formatNum(gmdate('Y', $ts), true);
break;
case 'currenttime':
$value = $pageLang->time(wfTimestamp(TS_MW, $ts), false, false);
break;
case 'currenthour':
$value = $pageLang->formatNum(gmdate('H', $ts), true);
break;
case 'currentweek':
# @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
# int to remove the padding
$value = $pageLang->formatNum((int) gmdate('W', $ts));
break;
case 'currentdow':
$value = $pageLang->formatNum(gmdate('w', $ts));
break;
case 'localdayname':
$value = $pageLang->getWeekdayName($localDayOfWeek + 1);
break;
case 'localyear':
$value = $pageLang->formatNum($localYear, true);
break;
case 'localtime':
$value = $pageLang->time($localTimestamp, false, false);
break;
case 'localhour':
$value = $pageLang->formatNum($localHour, true);
break;
case 'localweek':
# @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
# int to remove the padding
$value = $pageLang->formatNum((int) $localWeek);
break;
case 'localdow':
$value = $pageLang->formatNum($localDayOfWeek);
break;
case 'numberofarticles':
$value = $pageLang->formatNum(SiteStats::articles());
break;
case 'numberoffiles':
$value = $pageLang->formatNum(SiteStats::images());
break;
case 'numberofusers':
$value = $pageLang->formatNum(SiteStats::users());
break;
case 'numberofactiveusers':
$value = $pageLang->formatNum(SiteStats::activeUsers());
break;
case 'numberofpages':
$value = $pageLang->formatNum(SiteStats::pages());
break;
case 'numberofadmins':
$value = $pageLang->formatNum(SiteStats::numberingroup('sysop'));
break;
case 'numberofedits':
$value = $pageLang->formatNum(SiteStats::edits());
break;
case 'numberofviews':
$value = $pageLang->formatNum(SiteStats::views());
break;
case 'currenttimestamp':
$value = wfTimestamp(TS_MW, $ts);
break;
case 'localtimestamp':
$value = $localTimestamp;
break;
case 'currentversion':
$value = SpecialVersion::getVersion();
break;
case 'articlepath':
return $wgArticlePath;
case 'sitename':
return $wgSitename;
case 'server':
return $wgServer;
case 'servername':
$serverParts = wfParseUrl($wgServer);
return $serverParts && isset($serverParts['host']) ? $serverParts['host'] : $wgServer;
case 'scriptpath':
return $wgScriptPath;
case 'stylepath':
return $wgStylePath;
case 'directionmark':
return $pageLang->getDirMark();
case 'contentlanguage':
global $wgLanguageCode;
return $wgLanguageCode;
default:
$ret = null;
if (wfRunHooks('ParserGetVariableValueSwitch', array(&$this, &$this->mVarCache, &$index, &$ret, &$frame))) {
return $ret;
} else {
return null;
}
}
if ($index) {
$this->mVarCache[$index] = $value;
}
return $value;
}
开发者ID:laiello,项目名称:media-wiki-law,代码行数:101,代码来源:Parser.php
示例14: makeHelpMsg
/**
* Override the parent to generate help messages for all available modules.
*
* @deprecated since 1.25
* @return string
*/
public function makeHelpMsg()
{
wfDeprecated(__METHOD__, '1.25');
global $wgMemc;
$this->setHelp();
// Get help text from cache if present
$key = wfMemcKey('apihelp', $this->getModuleName(), str_replace(' ', '_', SpecialVersion::getVersion('nodb')));
$cacheHelpTimeout = $this->getConfig()->get('APICacheHelpTimeout');
if ($cacheHelpTimeout > 0) {
$cached = $wgMemc->get($key);
if ($cached) {
return $cached;
}
}
$retval = $this->reallyMakeHelpMsg();
if ($cacheHelpTimeout > 0) {
$wgMemc->set($key, $retval, $cacheHelpTimeout);
}
return $retval;
}
开发者ID:soumyag213,项目名称:mediawiki,代码行数:26,代码来源:ApiMain.php
示例15: __construct
/**
* @param $view CodeView
*
*/
function __construct($view)
{
global $IP;
$this->mView = $view;
$this->mRepo = $view->mRepo;
$this->mDefaultDirection = true;
$this->mCurSVN = SpecialVersion::getSvnRevision($IP);
parent::__construct();
}
开发者ID:yusufchang,项目名称:app,代码行数:13,代码来源:CodeView.php
示例16: getExtensionTypes
/**
* Returns an array with the base extension types.
* Type is stored as array key, the message as array value.
*
* TODO: ideally this would return all extension types, including
* those added by SpecialVersionExtensionTypes. This is not possible
* since this hook is passing along $this though.
*
* @since 1.17
*
* @return array
*/
public static function getExtensionTypes()
{
if (self::$extensionTypes === false) {
self::$extensionTypes = array('specialpage' => wfMessage('version-specialpages')->text(), 'parserhook' => wfMessage('version-parserhooks')->text(), 'variable' => wfMessage('version-variables')->text(), 'media' => wfMessage('version-mediahandlers')->text(), 'antispam' => wfMessage('version-antispam')->text(), 'skin' => wfMessage('version-skins')->text(), 'api' => wfMessage('version-api')->text(), 'other' => wfMessage('version-other')->text());
wfRunHooks('ExtensionTypes', array(&self::$extensionTypes));
}
return self::$extensionTypes;
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:20,代码来源:SpecialVersion.php
示例17: getVersion
/**
* Returns the version information of this file, plus it includes
* the versions for all files that are not callable proper API modules
*
* @return array
*/
public function getVersion()
{
$vers = array();
$vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
$vers[] = __CLASS__ . ': $Id$';
$vers[] = ApiBase::getBaseVersion();
$vers[] = ApiFormatBase::getBaseVersion();
$vers[] = ApiQueryBase::getBaseVersion();
return $vers;
}
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:16,代码来源:ApiMain.php
示例18: displayFilterControl
/**
* Creates and outputs the filter control.
*
* @since 0.1
*/
protected function displayFilterControl()
{
global $wgOut, $wgExtensionCredits;
$extensionAmount = 0;
$filterSegments = array();
$extensionTypes = SpecialVersion::getExtensionTypes();
foreach ($extensionTypes as $type => $message) {
if (!array_key_exists($type, $wgExtensionCredits)) {
continue;
}
$amount = count($wgExtensionCredits[$type]);
if ($amount > 0) {
$filterSegments[] = $this->getTypeLink($type, $message, $amount);
$extensionAmount += $amount;
}
}
$all = array($this->getTypeLink('all', wfMsg('extension-type-all'), $extensionAmount));
$wgOut->addHTML(implode(' | ', array_merge($all, $filterSegments)));
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:24,代码来源:SpecialExtensions.php
示例19: getVersion
/**
* Returns the version information of this file, plus it includes
* the versions for all files that are not callable proper API modules
*/
public function getVersion()
{
$vers = array();
$vers[] = 'MediaWiki ' . SpecialVersion::getVersion();
$vers[] = __CLASS__ . ': $Id: ApiMain.php 24494 2007-07-31 17:53:37Z yurik $';
$vers[] = ApiBase::getBaseVersion();
$vers[] = ApiFormatBase::getBaseVersion();
$vers[] = ApiQueryBase::getBaseVersion();
$vers[] = ApiFormatFeedWrapper::getVersion();
// not accessible with format=xxx
return $vers;
}
开发者ID:mediawiki-extensions,项目名称:bizzwiki,代码行数:16,代码来源:ApiMain.php
示例20: tests
--run-disabled run disabled tests
--run-parsoid run parsoid tests (normally disabled)
ENDS;
exit(0);
}
# Cases of weird db corruption were encountered when running tests on earlyish
# versions of SQLite
if ($wgDBtype == 'sqlite') {
$db = wfGetDB(DB_MASTER);
$version = $db->getServerVersion();
if (version_compare($version, '3.6') < 0) {
die("Parser tests require SQLite version 3.6 or later, you have {$version}\n");
}
}
$tester = new ParserTest($options);
if (isset($options['file'])) {
$files = array($options['file']);
} else {
// Default parser tests and any set from extensions or local config
$files = $wgParserTestFiles;
}
# Print out software version to assist with locating regressions
$version = SpecialVersion::getVersion('nodb');
echo "This is MediaWiki version {$version}.\n\n";
if (isset($options['fuzz'])) {
$tester->fuzzTest($files);
} else {
$ok = $tester->runTestsFromFiles($files);
exit($ok ? 0 : 1);
}
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:31,代码来源:parserTests.php
注:本文中的SpecialVersion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论