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


PHP Status类代码示例

本文整理汇总了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;
 }
开发者ID:SProjects,项目名称:Bug-Tracker,代码行数:7,代码来源:Status.php

示例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;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:48,代码来源:SharedHelpArticleCreation.php

示例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;
 }
开发者ID:postalservice14,项目名称:php-actuator,代码行数:15,代码来源:OrderedHealthAggregator.php

示例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;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:38,代码来源:SpamBlacklistHooks.php

示例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;
 }
开发者ID:wqx081,项目名称:gearbox,代码行数:7,代码来源:workerTestPhp.php

示例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"));
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:7,代码来源:Status.php

示例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;
 }
开发者ID:camigreen,项目名称:ttop,代码行数:14,代码来源:Status.php

示例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);
 }
开发者ID:reveil,项目名称:CodeTornado,代码行数:7,代码来源:TestController.php

示例9: deserialize

 public function deserialize(&$data)
 {
     parent::deserialize($data);
     $this->stringToBytes($this->username);
     $hash = new Status();
     $hash->deserialize($data);
     $this->status = $hash;
 }
开发者ID:BackupTheBerlios,项目名称:btg-svn,代码行数:8,代码来源:initconnection.php

示例10: __construct

 /**
  * @param integer|Status $status
  */
 public function __construct($status)
 {
     if ($status instanceof self) {
         $this->status = $status->getValue();
     } else {
         $this->status = (int) $status;
     }
 }
开发者ID:afk11,项目名称:transmission-php,代码行数:11,代码来源:Status.php

示例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());
 }
开发者ID:turanct,项目名称:bdsm,代码行数:9,代码来源:StatusTest.php

示例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;
 }
开发者ID:northdakota,项目名称:DiamanteDeskBundle,代码行数:14,代码来源:Status.php

示例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;
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:19,代码来源:Status.php

示例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');
 }
开发者ID:reveil,项目名称:CodeTornado,代码行数:11,代码来源:UserController.php

示例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;
 }
开发者ID:addshore,项目名称:reCaptcha,代码行数:24,代码来源:reCaptcha.hooks.php


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