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


PHP Status::getMessage方法代码示例

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


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

示例1: onSuccess

 public function onSuccess()
 {
     if ($this->getUser()->isAllowed('passwordreset') && $this->email != null) {
         // @todo: Logging
         if ($this->result->isGood()) {
             $this->getOutput()->addWikiMsg('passwordreset-emailsent-capture');
         } else {
             $this->getOutput()->addWikiMsg('passwordreset-emailerror-capture', $this->result->getMessage());
         }
         $this->getOutput()->addHTML(Html::rawElement('pre', array(), $this->email->escaped()));
     }
     $this->getOutput()->addWikiMsg('passwordreset-emailsent');
     $this->getOutput()->returnToMain();
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:14,代码来源:SpecialPasswordReset.php

示例2: onSuccess

 public function onSuccess()
 {
     if ($this->getUser()->isAllowed('passwordreset') && $this->email != null) {
         // @todo Logging
         if ($this->result->isGood()) {
             $this->getOutput()->addWikiMsg('passwordreset-emailsent-capture');
         } else {
             $this->getOutput()->addWikiMsg('passwordreset-emailerror-capture', $this->result->getMessage(), $this->firstUser->getName());
         }
         $this->getOutput()->addHTML(Html::rawElement('pre', [], $this->email->escaped()));
     }
     if ($this->method === 'email') {
         $this->getOutput()->addWikiMsg('passwordreset-emailsentemail');
     } else {
         $this->getOutput()->addWikiMsg('passwordreset-emailsentusername');
     }
     $this->getOutput()->returnToMain();
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:18,代码来源:SpecialPasswordReset.php

示例3: onSuccess

 public function onSuccess()
 {
     if ($this->getUser()->isAllowed('passwordreset') && $this->passwords) {
         // @todo Logging
         if ($this->result->isGood()) {
             $this->getOutput()->addWikiMsg('passwordreset-emailsent-capture2', count($this->passwords));
         } else {
             $this->getOutput()->addWikiMsg('passwordreset-emailerror-capture2', $this->result->getMessage(), key($this->passwords), count($this->passwords));
         }
         $this->getOutput()->addHTML(Html::openElement('ul'));
         foreach ($this->passwords as $username => $pwd) {
             $this->getOutput()->addHTML(Html::rawElement('li', [], htmlspecialchars($username, ENT_QUOTES) . $this->msg('colon-separator')->text() . htmlspecialchars($pwd, ENT_QUOTES)));
         }
         $this->getOutput()->addHTML(Html::closeElement('ul'));
     }
     if ($this->method === 'email') {
         $this->getOutput()->addWikiMsg('passwordreset-emailsentemail');
     } else {
         $this->getOutput()->addWikiMsg('passwordreset-emailsentusername');
     }
     $this->getOutput()->returnToMain();
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:22,代码来源:SpecialPasswordReset.php

示例4: testGetMessage

 /**
  * @dataProvider provideGetMessage
  * @covers Status::getMessage
  * @todo test long and short context messages generated through this method
  */
 public function testGetMessage(Status $status, $expectedParams = array(), $expectedKey)
 {
     $message = $status->getMessage();
     $this->assertInstanceOf('Message', $message);
     $this->assertEquals($expectedParams, $message->getParams(), 'Message::getParams');
     $this->assertEquals($expectedKey, $message->getKey(), 'Message::getKey');
 }
开发者ID:Habatchii,项目名称:wikibase-for-mediawiki,代码行数:12,代码来源:StatusTest.php

示例5: printStatus

/**
 * Print status
 * @global integer $failed
 * @param Status $status
 */
function printStatus($status)
{
    global $failed;
    if ($status->isGood()) {
        echo " ... DONE.\n";
    } else {
        $failed++;
        echo " ... FAILED (" . $status->getMessage() . ").\n";
    }
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:updateWikiFactoryVariable.php

示例6: logError

 /**
  * Log an error
  *
  * @param Status $status
  * @return void
  */
 public function logError($status)
 {
     $key = $this->poolCounter->getKey();
     wfDebugLog('poolcounter', "Pool key '{$key}' ({$this->type}): " . $status->getMessage()->inLanguage('en')->useDatabase(false)->text());
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:11,代码来源:PoolCounterWork.php

示例7: getErrorMessage

 /**
  * Wrapper method for Status Object messages
  * @param Status $oStatus
  * @return String The error message
  */
 private function getErrorMessage(Status $oStatus)
 {
     return $oStatus->getMessage()->plain();
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:9,代码来源:FlexiskinApi.class.php

示例8: assertGoodStatus

 public function assertGoodStatus(\Status $status)
 {
     if (!$status->isGood()) {
         $msg = wfMessage("email-error-bad-status", $status->getMessage())->escaped();
         throw new Fatal($msg);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:7,代码来源:EmailController.class.php

示例9: __construct

 public function __construct(Status $status)
 {
     parent::__construct('actionfailed', $status->getMessage());
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:4,代码来源:LocalFile.php

示例10: testGetMessage

 /**
  * @dataProvider provideGetMessage
  * @covers Status::getMessage
  */
 public function testGetMessage(Status $status, $expectedParams = [], $expectedKey, $expectedWrapper)
 {
     $message = $status->getMessage(null, null, 'qqx');
     $this->assertInstanceOf('Message', $message);
     $this->assertEquals($expectedParams, self::sanitizedMessageParams($message), 'Message::getParams');
     $this->assertEquals($expectedKey, $message->getKey(), 'Message::getKey');
     $message = $status->getMessage('wrapper-short', 'wrapper-long');
     $this->assertInstanceOf('Message', $message);
     $this->assertEquals($expectedWrapper, $message->getKey(), 'Message::getKey with wrappers');
     $this->assertCount(1, $message->getParams(), 'Message::getParams with wrappers');
     $message = $status->getMessage('wrapper');
     $this->assertInstanceOf('Message', $message);
     $this->assertEquals('wrapper', $message->getKey(), 'Message::getKey with wrappers');
     $this->assertCount(1, $message->getParams(), 'Message::getParams with wrappers');
     $message = $status->getMessage(false, 'wrapper');
     $this->assertInstanceOf('Message', $message);
     $this->assertEquals('wrapper', $message->getKey(), 'Message::getKey with wrappers');
     $this->assertCount(1, $message->getParams(), 'Message::getParams with wrappers');
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:23,代码来源:StatusTest.php


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