当前位置: 首页>>代码示例>>PHP>>正文


PHP SpecialVersion::getGitHeadSha1方法代码示例

本文整理汇总了PHP中SpecialVersion::getGitHeadSha1方法的典型用法代码示例。如果您正苦于以下问题:PHP SpecialVersion::getGitHeadSha1方法的具体用法?PHP SpecialVersion::getGitHeadSha1怎么用?PHP SpecialVersion::getGitHeadSha1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SpecialVersion的用法示例。


在下文中一共展示了SpecialVersion::getGitHeadSha1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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'];
//.........这里部分代码省略.........
开发者ID:Tarendai,项目名称:spring-website,代码行数:101,代码来源:ApiQuerySiteinfo.php

示例2: getVersion

 /**
  * Returns a string that identifies the version of the class.
  * Includes the class name, the svn revision, timestamp, and
  * last author.
  *
  * @return string
  */
 function getVersion()
 {
     global $sfgIP;
     $gitSha1 = SpecialVersion::getGitHeadSha1($sfgIP);
     return __CLASS__ . '-' . SF_VERSION . ($gitSha1 !== false) ? ' (' . substr($gitSha1, 0, 7) . ')' : '';
 }
开发者ID:paladox,项目名称:mediawiki-extensions-SemanticForms,代码行数:13,代码来源:SF_AutoeditAPI.php

示例3: 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');
//.........这里部分代码省略.........
开发者ID:spicy-tmw,项目名称:wiki-raw,代码行数:101,代码来源:ApiQuerySiteinfo.php

示例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'];
     $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
     $data['phpversion'] = phpversion();
     $data['phpsapi'] = PHP_SAPI;
     $data['dbtype'] = $GLOBALS['wgDBtype'];
     $data['dbversion'] = $this->getDB()->getServerVersion();
     if (!$wgDisableLangConversion) {
         $data['langconversion'] = '';
     }
     if (!$wgDisableTitleConversion) {
         $data['titleconversion'] = '';
     }
     if ($wgContLang->linkPrefixExtension()) {
         $data['linkprefix'] = wfMessage('linkprefix')->inContentLanguage()->text();
     } else {
         $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';
     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->hasVariants()) {
         $variants = array();
         foreach ($wgContLang->getVariants() as $code) {
             $variants[] = array('code' => $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'];
     $data['variantarticlepath'] = $GLOBALS['wgVariantArticlePath'];
     $data['server'] = $GLOBALS['wgServer'];
     $data['wikiid'] = wfWikiID();
     $data['time'] = wfTimestamp(TS_ISO_8601, time());
     if ($GLOBALS['wgMiserMode']) {
         $data['misermode'] = '';
     }
     $data['maxuploadsize'] = UploadBase::getMaxUploadSize();
     wfRunHooks('APIQuerySiteInfoGeneralInfo', array($this, &$data));
     return $this->getResult()->addValue('query', $property, $data);
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:95,代码来源:ApiQuerySiteinfo.php


注:本文中的SpecialVersion::getGitHeadSha1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。