本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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');
}
示例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";
}
}
示例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());
}
示例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();
}
示例8: assertGoodStatus
public function assertGoodStatus(\Status $status)
{
if (!$status->isGood()) {
$msg = wfMessage("email-error-bad-status", $status->getMessage())->escaped();
throw new Fatal($msg);
}
}
示例9: __construct
public function __construct(Status $status)
{
parent::__construct('actionfailed', $status->getMessage());
}
示例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');
}