本文整理汇总了PHP中Status::isOk方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::isOk方法的具体用法?PHP Status::isOk怎么用?PHP Status::isOk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::isOk方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: endStage
/**
* @param string $step
* @param Status $status
*/
public function endStage($step, $status)
{
if ($step == 'extension-tables') {
$this->endLiveBox();
}
$msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed';
$html = wfMessage('word-separator')->escaped() . wfMessage($msg)->escaped();
if (!$status->isOk()) {
$html = "<span class=\"error\">{$html}</span>";
}
$this->addHTML($html . "</li>\n");
if (!$status->isGood()) {
$this->parent->showStatusBox($status);
}
}
示例2: showStatusMessage
public function showStatusMessage(Status $status)
{
$warnings = array_merge($status->getWarningsArray(), $status->getErrorsArray());
if (count($warnings) !== 0) {
foreach ($warnings as $w) {
call_user_func_array(array($this, 'showMessage'), $w);
}
}
if (!$status->isOk()) {
echo "\n";
exit;
}
}
示例3: showStatusBox
/**
* Output an error or warning box using a Status object.
*
* @param Status $status
*/
public function showStatusBox($status)
{
if (!$status->isGood()) {
$text = $status->getWikiText();
if ($status->isOk()) {
$box = $this->getWarningBox($text);
} else {
$box = $this->getErrorBox($text);
}
$this->output->addHTML($box);
}
}
示例4: leaveMessage
/**
* Leave a message on the user talk page or in the session according to
* $params['leaveMessage'].
*
* @param Status $status
*/
protected function leaveMessage($status)
{
if ($this->params['leaveMessage']) {
if ($status->isGood()) {
// @todo FIXME: user->leaveUserMessage does not exist.
$this->user->leaveUserMessage(wfMessage('upload-success-subj')->text(), wfMessage('upload-success-msg', $this->upload->getTitle()->getText(), $this->params['url'])->text());
} else {
// @todo FIXME: user->leaveUserMessage does not exist.
$this->user->leaveUserMessage(wfMessage('upload-failure-subj')->text(), wfMessage('upload-failure-msg', $status->getWikiText(), $this->params['url'])->text());
}
} else {
wfSetupSession($this->params['sessionId']);
if ($status->isOk()) {
$this->storeResultInSession('Success', 'filename', $this->upload->getLocalFile()->getName());
} else {
$this->storeResultInSession('Failure', 'errors', $status->getErrorsArray());
}
session_write_close();
}
}
示例5: leaveMessage
/**
* Leave a message on the user talk page or in the session according to
* $params['leaveMessage'].
*
* @param Status $status
*/
protected function leaveMessage($status)
{
if ($this->params['leaveMessage']) {
if ($status->isGood()) {
// @todo FIXME: user->leaveUserMessage does not exist.
$this->user->leaveUserMessage(wfMessage('upload-success-subj')->text(), wfMessage('upload-success-msg', $this->upload->getTitle()->getText(), $this->params['url'])->text());
} else {
// @todo FIXME: user->leaveUserMessage does not exist.
$this->user->leaveUserMessage(wfMessage('upload-failure-subj')->text(), wfMessage('upload-failure-msg', $status->getWikiText(), $this->params['url'])->text());
}
} else {
$session = MediaWiki\Session\SessionManager::singleton()->getSessionById($this->params['sessionId']);
if ($status->isOk()) {
$this->storeResultInSession($session, 'Success', 'filename', $this->upload->getLocalFile()->getName());
} else {
$this->storeResultInSession($session, 'Failure', 'errors', $status->getErrorsArray());
}
}
}