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


PHP SpecialPageFactory::getLocalNameFor方法代码示例

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


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

示例1: testGetAliasListRecursion

 public function testGetAliasListRecursion()
 {
     $called = false;
     $this->mergeMwGlobalArrayValue('wgHooks', array('SpecialPage_initList' => array(function () use(&$called) {
         SpecialPageFactory::getLocalNameFor('Specialpages');
         $called = true;
     })));
     SpecialPageFactory::resetList();
     SpecialPageFactory::getLocalNameFor('Specialpages');
     $this->assertTrue($called, 'Recursive call succeeded');
 }
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:11,代码来源:SpecialPageFactoryTest.php

示例2: fixSpecialName

 /**
  * If the Title refers to a special page alias which is not the local default, resolve
  * the alias, and localise the name as necessary.  Otherwise, return $this
  *
  * @return Title
  */
 public function fixSpecialName()
 {
     if ($this->isSpecialPage()) {
         list($canonicalName, $par) = SpecialPageFactory::resolveAlias($this->mDbkeyform);
         if ($canonicalName) {
             $localName = SpecialPageFactory::getLocalNameFor($canonicalName, $par);
             if ($localName != $this->mDbkeyform) {
                 return Title::makeTitle(NS_SPECIAL, $localName);
             }
         }
     }
     return $this;
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:19,代码来源:Title.php

示例3: getSpecialPageTitleText

 /**
  * Gets the title text for the types special page.
  * Takes care of compatibility changes in MW 1.17 and 1.18.
  * 1.17 introduces SpecialPageFactory
  * 1.18 deprecates SpecialPage::getLocalNameFor
  *
  * @since 1.6
  *
  * @return string
  */
 protected function getSpecialPageTitleText()
 {
     return is_callable(array('SpecialPageFactory', 'getLocalNameFor')) ? SpecialPageFactory::getLocalNameFor('Types', $this->m_realLabel) : SpecialPage::getLocalNameFor('Types', $this->m_realLabel);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:14,代码来源:SMW_DV_Types.php

示例4: getLocalName

 /**
  * Get the localised name of the special page
  */
 function getLocalName()
 {
     if (!isset($this->mLocalName)) {
         $this->mLocalName = SpecialPageFactory::getLocalNameFor($this->mName);
     }
     return $this->mLocalName;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:10,代码来源:SpecialPage.php

示例5: testConflictResolution

 /**
  * @dataProvider provideTestConflictResolution
  */
 public function testConflictResolution($test, $aliasesList, $alias, $expectedName, $expectedAlias, $expectWarnings)
 {
     global $wgContLang;
     $lang = clone $wgContLang;
     $lang->mExtendedSpecialPageAliases = $aliasesList;
     $this->setMwGlobals('wgContLang', $lang);
     $this->setMwGlobals('wgSpecialPages', array_combine(array_keys($aliasesList), array_keys($aliasesList)));
     SpecialPageFactory::resetList();
     // Catch the warnings we expect to be raised
     $warnings = array();
     $this->setMwGlobals('wgDevelopmentWarnings', true);
     set_error_handler(function ($errno, $errstr) use(&$warnings) {
         if (preg_match('/First alias \'[^\']*\' for .*/', $errstr) || preg_match('/Did not find a usable alias for special page .*/', $errstr)) {
             $warnings[] = $errstr;
             return true;
         }
         return false;
     });
     $reset = new ScopedCallback('restore_error_handler');
     list($name, ) = SpecialPageFactory::resolveAlias($alias);
     $this->assertEquals($expectedName, $name, "{$test}: Alias to name");
     $result = SpecialPageFactory::getLocalNameFor($name);
     $this->assertEquals($expectedAlias, $result, "{$test}: Alias to name to alias");
     $gotWarnings = count($warnings);
     if ($gotWarnings !== $expectWarnings) {
         $this->fail("Expected {$expectWarnings} warning(s), but got {$gotWarnings}:\n" . join("\n", $warnings));
     }
 }
开发者ID:rploaiza,项目名称:dbpedia-latinoamerica,代码行数:31,代码来源:SpecialPageFactoryTest.php

示例6: onPostLoginRedirect

 /**
  * Handler for PostLoginRedirect
  * @param string $returnTo The page to return to
  * @param array $returnToQuery Url parameters
  * @param string $type Type of login redirect
  */
 public static function onPostLoginRedirect(&$returnTo, &$returnToQuery, &$type)
 {
     global $wgCentralAuthCheckSULMigration, $wgUser;
     if ($wgCentralAuthCheckSULMigration && $wgUser->getRequest()->getSessionData('CentralAuthForcedRename') === true && ($type == 'success' || $type == 'successredirect')) {
         wfDebugLog('SUL', 'Redirecting user to Special:SulRenameWarning');
         // Store current redirect target in session so we can provide a link
         // later.
         $wgUser->getRequest()->setSessionData('SulRenameWarning', array('returnTo' => $returnTo, 'returnToQuery' => $returnToQuery));
         $returnTo = SpecialPageFactory::getLocalNameFor('Special:SulRenameWarning');
         $returnToQuery = array();
         return false;
     }
     return true;
 }
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:20,代码来源:CentralAuthHooks.php

示例7: getSpecialPageTitleText

 /**
  * Gets the title text for the types special page.
  *
  * @since 1.6
  *
  * @return string
  */
 protected function getSpecialPageTitleText()
 {
     return SpecialPageFactory::getLocalNameFor('Types', $this->m_realLabel);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:11,代码来源:SMW_DV_Types.php


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