本文整理汇总了PHP中SpecialVersion::getSvnRevision方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecialVersion::getSvnRevision方法的具体用法?PHP SpecialVersion::getSvnRevision怎么用?PHP SpecialVersion::getSvnRevision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpecialVersion
的用法示例。
在下文中一共展示了SpecialVersion::getSvnRevision方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: appendGeneralInfo
protected function appendGeneralInfo($property)
{
global $wgContLang;
$data = array();
$mainPage = Title::newMainPage();
$data['mainpage'] = $mainPage->getPrefixedText();
$data['base'] = wfExpandUrl($mainPage->getFullUrl(), PROTO_CURRENT);
$data['sitename'] = $GLOBALS['wgSitename'];
$data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
$data['phpversion'] = phpversion();
$data['phpsapi'] = php_sapi_name();
$data['dbtype'] = $GLOBALS['wgDBtype'];
$data['dbversion'] = $this->getDB()->getServerVersion();
$svn = SpecialVersion::getSvnRevision($GLOBALS['IP']);
if ($svn) {
$data['rev'] = $svn;
}
// 'case-insensitive' option is reserved for future
$data['case'] = $GLOBALS['wgCapitalLinks'] ? 'first-letter' : 'case-sensitive';
if (isset($GLOBALS['wgRightsCode'])) {
$data['rightscode'] = $GLOBALS['wgRightsCode'];
}
$data['rights'] = $GLOBALS['wgRightsText'];
$data['lang'] = $GLOBALS['wgLanguageCode'];
$fallbacks = array();
foreach ($wgContLang->getFallbackLanguages() as $code) {
$fallbacks[] = array('code' => $code);
}
$data['fallback'] = $fallbacks;
$this->getResult()->setIndexedTagName($data['fallback'], 'lang');
if ($wgContLang->isRTL()) {
$data['rtl'] = '';
}
$data['fallback8bitEncoding'] = $wgContLang->fallback8bitEncoding();
if (wfReadOnly()) {
$data['readonly'] = '';
$data['readonlyreason'] = wfReadOnlyReason();
}
if ($GLOBALS['wgEnableWriteAPI']) {
$data['writeapi'] = '';
}
$tz = $GLOBALS['wgLocaltimezone'];
$offset = $GLOBALS['wgLocalTZoffset'];
if (is_null($tz)) {
$tz = 'UTC';
$offset = 0;
} elseif (is_null($offset)) {
$offset = 0;
}
$data['timezone'] = $tz;
$data['timeoffset'] = intval($offset);
$data['articlepath'] = $GLOBALS['wgArticlePath'];
$data['scriptpath'] = $GLOBALS['wgScriptPath'];
$data['script'] = $GLOBALS['wgScript'];
$data['variantarticlepath'] = $GLOBALS['wgVariantArticlePath'];
$data['server'] = $GLOBALS['wgServer'];
$data['wikiid'] = wfWikiID();
$data['time'] = wfTimestamp(TS_ISO_8601, time());
if ($GLOBALS['wgMiserMode']) {
$data['misermode'] = '';
}
wfRunHooks('APIQuerySiteInfoGeneralInfo', array($this, &$data));
return $this->getResult()->addValue('query', $property, $data);
}
示例4: appendGeneralInfo
protected function appendGeneralInfo($property)
{
global $wgContLang, $wgDisableLangConversion, $wgDisableTitleConversion;
$data = array();
$mainPage = Title::newMainPage();
$data['mainpage'] = $mainPage->getPrefixedText();
$data['base'] = wfExpandUrl($mainPage->getFullURL(), PROTO_CURRENT);
$data['sitename'] = $GLOBALS['wgSitename'];
// wgLogo can either be a relative or an absolute path
// make sure we always return an absolute path
$data['logo'] = wfExpandUrl($GLOBALS['wgLogo'], PROTO_RELATIVE);
$data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
$data['phpversion'] = phpversion();
$data['phpsapi'] = PHP_SAPI;
$data['dbtype'] = $GLOBALS['wgDBtype'];
$data['dbversion'] = $this->getDB()->getServerVersion();
$allowFrom = array('');
$allowException = true;
if (!$GLOBALS['wgAllowExternalImages']) {
if ($GLOBALS['wgEnableImageWhitelist']) {
$data['imagewhitelistenabled'] = '';
}
$allowFrom = $GLOBALS['wgAllowExternalImagesFrom'];
$allowException = !empty($allowFrom);
}
if ($allowException) {
$data['externalimages'] = (array) $allowFrom;
$this->getResult()->setIndexedTagName($data['externalimages'], 'prefix');
}
if (!$wgDisableLangConversion) {
$data['langconversion'] = '';
}
if (!$wgDisableTitleConversion) {
$data['titleconversion'] = '';
}
if ($wgContLang->linkPrefixExtension()) {
$linkPrefixCharset = $wgContLang->linkPrefixCharset();
$data['linkprefixcharset'] = $linkPrefixCharset;
// For backwards compatability
$data['linkprefix'] = "/^((?>.*[^{$linkPrefixCharset}]|))(.+)\$/sDu";
} else {
$data['linkprefixcharset'] = '';
$data['linkprefix'] = '';
}
$linktrail = $wgContLang->linkTrail();
if ($linktrail) {
$data['linktrail'] = $linktrail;
} else {
$data['linktrail'] = '';
}
$git = SpecialVersion::getGitHeadSha1($GLOBALS['IP']);
if ($git) {
$data['git-hash'] = $git;
} else {
$svn = SpecialVersion::getSvnRevision($GLOBALS['IP']);
if ($svn) {
$data['rev'] = $svn;
}
}
// 'case-insensitive' option is reserved for future
$data['case'] = $GLOBALS['wgCapitalLinks'] ? 'first-letter' : 'case-sensitive';
$data['lang'] = $GLOBALS['wgLanguageCode'];
$fallbacks = array();
foreach ($wgContLang->getFallbackLanguages() as $code) {
$fallbacks[] = array('code' => $code);
}
$data['fallback'] = $fallbacks;
$this->getResult()->setIndexedTagName($data['fallback'], 'lang');
if ($wgContLang->hasVariants()) {
$variants = array();
foreach ($wgContLang->getVariants() as $code) {
$variants[] = array('code' => $code, 'name' => $wgContLang->getVariantname($code));
}
$data['variants'] = $variants;
$this->getResult()->setIndexedTagName($data['variants'], 'lang');
}
if ($wgContLang->isRTL()) {
$data['rtl'] = '';
}
$data['fallback8bitEncoding'] = $wgContLang->fallback8bitEncoding();
if (wfReadOnly()) {
$data['readonly'] = '';
$data['readonlyreason'] = wfReadOnlyReason();
}
if ($GLOBALS['wgEnableWriteAPI']) {
$data['writeapi'] = '';
}
$tz = $GLOBALS['wgLocaltimezone'];
$offset = $GLOBALS['wgLocalTZoffset'];
if (is_null($tz)) {
$tz = 'UTC';
$offset = 0;
} elseif (is_null($offset)) {
$offset = 0;
}
$data['timezone'] = $tz;
$data['timeoffset'] = intval($offset);
$data['articlepath'] = $GLOBALS['wgArticlePath'];
$data['scriptpath'] = $GLOBALS['wgScriptPath'];
$data['script'] = $GLOBALS['wgScript'];
//.........这里部分代码省略.........
示例5: appendGeneralInfo
protected function appendGeneralInfo($property)
{
global $wgContLang;
$config = $this->getConfig();
$data = array();
$mainPage = Title::newMainPage();
$data['mainpage'] = $mainPage->getPrefixedText();
$data['base'] = wfExpandUrl($mainPage->getFullURL(), PROTO_CURRENT);
$data['sitename'] = $config->get('Sitename');
// wgLogo can either be a relative or an absolute path
// make sure we always return an absolute path
$data['logo'] = wfExpandUrl($config->get('Logo'), PROTO_RELATIVE);
$data['generator'] = "MediaWiki {$config->get('Version')}";
$data['phpversion'] = PHP_VERSION;
$data['phpsapi'] = PHP_SAPI;
if (defined('HHVM_VERSION')) {
$data['hhvmversion'] = HHVM_VERSION;
}
$data['dbtype'] = $config->get('DBtype');
$data['dbversion'] = $this->getDB()->getServerVersion();
$allowFrom = array('');
$allowException = true;
if (!$config->get('AllowExternalImages')) {
$data['imagewhitelistenabled'] = (bool) $config->get('EnableImageWhitelist');
$allowFrom = $config->get('AllowExternalImagesFrom');
$allowException = !empty($allowFrom);
}
if ($allowException) {
$data['externalimages'] = (array) $allowFrom;
ApiResult::setIndexedTagName($data['externalimages'], 'prefix');
}
$data['langconversion'] = !$config->get('DisableLangConversion');
$data['titleconversion'] = !$config->get('DisableTitleConversion');
if ($wgContLang->linkPrefixExtension()) {
$linkPrefixCharset = $wgContLang->linkPrefixCharset();
$data['linkprefixcharset'] = $linkPrefixCharset;
// For backwards compatibility
$data['linkprefix'] = "/^((?>.*[^{$linkPrefixCharset}]|))(.+)\$/sDu";
} else {
$data['linkprefixcharset'] = '';
$data['linkprefix'] = '';
}
$linktrail = $wgContLang->linkTrail();
$data['linktrail'] = $linktrail ?: '';
$data['legaltitlechars'] = Title::legalChars();
global $IP;
$git = SpecialVersion::getGitHeadSha1($IP);
if ($git) {
$data['git-hash'] = $git;
$data['git-branch'] = SpecialVersion::getGitCurrentBranch($GLOBALS['IP']);
} else {
$svn = SpecialVersion::getSvnRevision($IP);
if ($svn) {
$data['rev'] = $svn;
}
}
// 'case-insensitive' option is reserved for future
$data['case'] = $config->get('CapitalLinks') ? 'first-letter' : 'case-sensitive';
$data['lang'] = $config->get('LanguageCode');
$fallbacks = array();
foreach ($wgContLang->getFallbackLanguages() as $code) {
$fallbacks[] = array('code' => $code);
}
$data['fallback'] = $fallbacks;
ApiResult::setIndexedTagName($data['fallback'], 'lang');
if ($wgContLang->hasVariants()) {
$variants = array();
foreach ($wgContLang->getVariants() as $code) {
$variants[] = array('code' => $code, 'name' => $wgContLang->getVariantname($code));
}
$data['variants'] = $variants;
ApiResult::setIndexedTagName($data['variants'], 'lang');
}
$data['rtl'] = $wgContLang->isRTL();
$data['fallback8bitEncoding'] = $wgContLang->fallback8bitEncoding();
$data['readonly'] = wfReadOnly();
if ($data['readonly']) {
$data['readonlyreason'] = wfReadOnlyReason();
}
$data['writeapi'] = (bool) $config->get('EnableWriteAPI');
$tz = $config->get('Localtimezone');
$offset = $config->get('LocalTZoffset');
if (is_null($tz)) {
$tz = 'UTC';
$offset = 0;
} elseif (is_null($offset)) {
$offset = 0;
}
$data['timezone'] = $tz;
$data['timeoffset'] = intval($offset);
$data['articlepath'] = $config->get('ArticlePath');
$data['scriptpath'] = $config->get('ScriptPath');
$data['script'] = $config->get('Script');
$data['variantarticlepath'] = $config->get('VariantArticlePath');
$data[ApiResult::META_BC_BOOLS][] = 'variantarticlepath';
$data['server'] = $config->get('Server');
$data['servername'] = $config->get('ServerName');
$data['wikiid'] = wfWikiID();
$data['time'] = wfTimestamp(TS_ISO_8601, time());
$data['misermode'] = (bool) $config->get('MiserMode');
//.........这里部分代码省略.........
示例6: appendGeneralInfo
protected function appendGeneralInfo($property)
{
global $wgSitename, $wgVersion, $wgCapitalLinks, $wgRightsCode, $wgRightsText, $wgContLang;
global $wgLanguageCode, $IP, $wgEnableWriteAPI, $wgLang, $wgLocaltimezone, $wgLocalTZoffset;
$data = array();
$mainPage = Title::newFromText(wfMsgForContent('mainpage'));
$data['mainpage'] = $mainPage->getPrefixedText();
$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;
if ($wgContLang->isRTL()) {
$data['rtl'] = '';
}
$data['fallback8bitEncoding'] = $wgLang->fallback8bitEncoding();
if (wfReadOnly()) {
$data['readonly'] = '';
}
if ($wgEnableWriteAPI) {
$data['writeapi'] = '';
}
$tz = $wgLocaltimezone;
$offset = $wgLocalTZoffset;
if (is_null($tz)) {
$tz = 'UTC';
$offset = 0;
} elseif (is_null($offset)) {
$offset = 0;
}
$data['timezone'] = $tz;
$data['timeoffset'] = intval($offset);
return $this->getResult()->addValue('query', $property, $data);
}
示例7: __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();
}
示例8: MGVS_hack
/**
* Hack: Run MakeGlobalVariablesScript for backwards compatability.
* The MakeGlobalVariablesScript hook was added to MediaWiki 1.14 in revision 38397:
* http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Skin.php?view=log&pathrev=38397
*/
private static function MGVS_hack(&$script)
{
global $wgVersion, $IP;
if (version_compare($wgVersion, '1.14', '<')) {
$svn = SpecialVersion::getSvnRevision($IP);
// if !$svn, then we must be using 1.13.x (as opposed to 1.14alpha+)
if (!$svn || $svn < 38397) {
$script = "";
$vars = array();
wfRunHooks('MakeGlobalVariablesScript', array(&$vars));
foreach ($vars as $name => $value) {
$script .= "\t\tvar {$name} = " . json_encode($value) . ";\n";
}
return true;
}
}
return false;
}