本文整理汇总了PHP中Status类的典型用法代码示例。如果您正苦于以下问题:PHP Status类的具体用法?PHP Status怎么用?PHP Status使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Status类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __equal
public function __equal(Status $_status)
{
if ($this->id == $_status->getId() && strcmp($this->name, $_status->getName()) == 0 && strcmp($this->number, $_status->getNumber()) == 0) {
return TRUE;
}
return FALSE;
}
示例2: efSharedHelpArticleCreation
/**
* @param WikiPage $article
* @param $user
* @param $text
* @param $summary
* @param $minoredit
* @param $watchthis
* @param $sectionanchor
* @param $flags
* @param $revision
* @param Status $status
* @param $baseRevId
* @return bool
*/
function efSharedHelpArticleCreation(&$article, &$user, $text, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, $baseRevId)
{
global $wgCityId, $wgHelpWikiId;
// only run on help wikis
if ($wgCityId !== $wgHelpWikiId) {
return true;
}
// not likely if we got here, but... healthy paranoia ;)
if (wfReadOnly()) {
return true;
}
if ($article->mTitle->getNamespace() !== NS_HELP) {
return true;
}
if (!$status->isOK()) {
return true;
}
if (!($flags & EDIT_NEW)) {
return true;
}
$talkTitle = Title::newFromText($article->mTitle->getText(), NS_HELP_TALK);
if ($talkTitle->exists()) {
return true;
}
$talkArticle = new Article($talkTitle);
$redir = $article->getRedirectTarget();
if ($redir) {
$target = $redir->getTalkNsText() . ':' . $redir->getText();
$talkArticle->doEdit("#REDIRECT [[{$target}]]", wfMsgForContent('sharedhelp-autotalkcreate-summary'));
} else {
$talkArticle->doEdit('{{talkheader}}', wfMsgForContent('sharedhelp-autotalkcreate-summary'));
}
return true;
}
示例3: statusComparator
/**
* Callable used to order Status.
*
* @param Status $s1
* @param Status $s2
*
* @return int
*/
private function statusComparator($s1, $s2)
{
if (array_search($s1->getCode(), $this->statusOrder) === array_search($s2->getCode(), $this->statusOrder)) {
return 0;
}
return array_search($s1->getCode(), $this->statusOrder) < array_search($s2->getCode(), $this->statusOrder) ? -1 : 1;
}
示例4: filterMergedContent
/**
* Hook function for EditFilterMergedContent
*
* @param IContextSource $context
* @param Content $content
* @param Status $status
* @param string $summary
* @param User $user
* @param bool $minoredit
*
* @return bool
*/
static function filterMergedContent(IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
{
$title = $context->getTitle();
if (isset($title->spamBlackListFiltered) && $title->spamBlackListFiltered) {
// already filtered
return true;
}
// get the link from the not-yet-saved page content.
// no need to generate html to get external links
$pout = $content->getParserOutput($title, null, null, false);
$links = array_keys($pout->getExternalLinks());
// HACK: treat the edit summary as a link
if ($summary !== '') {
$links[] = $summary;
}
$spamObj = BaseBlacklist::getInstance('spam');
$matches = $spamObj->filter($links, $title);
if ($matches !== false) {
$status->fatal('spamprotectiontext');
foreach ($matches as $match) {
$status->fatal('spamprotectionmatch', $match);
}
}
// Always return true, EditPage will look at $status->isOk().
return true;
}
示例5: do_post_testphp_example_v1
function do_post_testphp_example_v1($job, $resp)
{
$status = new Status($resp->status());
$status->add_message("this is a status message!");
throw new ERR_INTERNAL_SERVER_ERROR("uh oh");
return Worker::WORKER_SUCCESS;
}
示例6: insertComments
protected function insertComments(User $aUser)
{
$status = new Status();
$status->insert(array("user_id" => $aUser->id, "comment" => "comment1", "created_at" => "2008-01-01 00:00:00"));
$status->insert(array("user_id" => $aUser->id, "comment" => "comment2", "created_at" => "2008-02-01 00:00:00"));
$status->insert(array("user_id" => $aUser->id, "comment" => "comment3", "created_at" => "2008-03-01 00:00:00"));
}
示例7: fromXml
/**
* @internal
*
* @param \SimpleXMLElement $xml
*
* @return Status
*/
public static function fromXml(\SimpleXMLElement $xml)
{
$status = new Status();
$status->setIsResponse();
$status->setCode($xml->Code)->setDescription($xml->Description);
return $status;
}
示例8: indexAction
public function indexAction()
{
$status = new Status();
$status->setUid($this->_user->loggedIn->uid);
$status->addStatus("test");
$this->_logger->log($status->getStatusMessages(), Zend_Log::INFO);
}
示例9: deserialize
public function deserialize(&$data)
{
parent::deserialize($data);
$this->stringToBytes($this->username);
$hash = new Status();
$hash->deserialize($data);
$this->status = $hash;
}
示例10: __construct
/**
* @param integer|Status $status
*/
public function __construct($status)
{
if ($status instanceof self) {
$this->status = $status->getValue();
} else {
$this->status = (int) $status;
}
}
示例11: test_it_gets_current_status_data
function test_it_gets_current_status_data()
{
$locater = $this->getMockBuilder('\\Bdsm\\Locater\\Locater')->getMock();
$locater->method('findMigrations')->willReturn(array(new DoneMigration1(), new DoneMigration2(), new NewMigration(), new SkippedMigration()));
$log = $this->getMockBuilder('\\Bdsm\\Log\\Log')->getMock();
$log->method('get')->willReturn(array('Bdsm\\Query\\DoneMigration1' => 'done', 'Bdsm\\Query\\DoneMigration2' => 'done', 'Bdsm\\Query\\SkippedMigration' => 'skipped'));
$query = new Status($locater, $log);
$this->assertEquals(array('Bdsm\\Query\\DoneMigration1' => 'done', 'Bdsm\\Query\\DoneMigration2' => 'done', 'Bdsm\\Query\\NewMigration' => 'new', 'Bdsm\\Query\\SkippedMigration' => 'skipped'), $query->getResult());
}
示例12: equals
/**
* @param Status $status
* @return bool
*/
public function equals(Status $status)
{
if ($this == $status) {
return true;
}
if ($this->status == $status->getValue()) {
return true;
}
return false;
}
示例13: remove
/**
* @userCache
*
* @param int $userId ユーザID
* @param int $statusId ステータスID
*
* @return Logics_Result
*/
public function remove($userId, $statusId)
{
$result = new Logics_Result();
$aStatus = new Status($statusId);
if ($aStatus->isSelected() && $aStatus->user_id === $userId) {
$aStatus->delete();
} else {
$result->failure();
}
return $result;
}
示例14: logoutAction
public function logoutAction()
{
if (isset($this->_user->loggedIn->uid)) {
$status = new Status();
$status->setUid($this->_user->loggedIn->uid);
$status->addStatus('logout');
}
$this->_user->logout();
$this->view->loginMsg = self::LOGOUT;
$this->_forward('login');
}
示例15: onPageContentSave
/**
* @param $wikiPage
* @param \User $user
* @param $content
* @param $summary
* @param $isMinor
* @param $isWatch
* @param $section
* @param $flags
* @param \Status $status
*
* @return bool
*/
public function onPageContentSave($wikiPage, $user, $content, $summary, $isMinor, $isWatch, $section, $flags, $status)
{
if ($user && !$user->isEmailConfirmed()) {
if (!$this->testResponse()) {
$status->setResult(false);
$status->error("recaptcha-failed");
return false;
}
}
return true;
}