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


PHP logger::logKill方法代码示例

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


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

示例1: processKill


//.........这里部分代码省略.........
                         $skip = true;
                         break;
                     }
                 }
                 // Don't post NPC only kills if configured.
                 if ($this->npcOnly && Config::get('post_no_npc_only')) {
                     $errorstring .= " NPC Only mail.";
                     $skip = true;
                 }
                 if (!$skip) {
                     //skipping intensive items processing
                     if (isset($row->rowset[1]->row[0])) {
                         foreach ($row->rowset[1]->row as $item) {
                             $this->processItem($item, $kill);
                         }
                     }
                     $authorized = false;
                     if (config::get('cfg_allianceid') && in_array($kill->getVictimAllianceID(), config::get('cfg_allianceid'))) {
                         $authorized = true;
                     } else {
                         if (config::get('cfg_corpid') && in_array($kill->getVictimCorpID(), config::get('cfg_corpid'))) {
                             $authorized = true;
                         } else {
                             if (config::get('cfg_pilotid') && in_array($kill->getVictimID(), config::get('cfg_pilotid'))) {
                                 $authorized = true;
                             }
                         }
                     }
                     foreach ($kill->getInvolved() as $inv) {
                         if (config::get('cfg_allianceid') && in_array($inv->getAllianceID(), config::get('cfg_allianceid'))) {
                             $authorized = true;
                         } else {
                             if (config::get('cfg_corpid') && in_array($inv->getCorpID(), config::get('cfg_corpid'))) {
                                 $authorized = true;
                             } else {
                                 if (config::get('cfg_pilotid') && in_array($inv->getPilotID(), config::get('cfg_pilotid'))) {
                                     $authorized = true;
                                 }
                             }
                         }
                     }
                     if (!$authorized) {
                         $skip = true;
                     } else {
                         $id = $kill->add();
                         if ($kill->getDupe(true)) {
                             $dup = true;
                         } else {
                             $this->posted[] = array($externalID, $internalID, $id);
                             // Prepare text for the log.
                             if ($this->url) {
                                 $logaddress = "ID:" . $this->url;
                                 if (strpos($logaddress, "?")) {
                                     $logaddress = substr($logaddress, 0, strpos($logaddress, "?"));
                                 }
                                 if ($kill->getExternalID()) {
                                     $logaddress .= "?a=kill_detail&kll_ext_id=" . $kill->getExternalID();
                                 } else {
                                     if ($internalID) {
                                         $logaddress .= "?a=kill_detail&kll_id=" . $internalID;
                                     }
                                 }
                             } else {
                                 if ($this->name) {
                                     $logaddress = $this->name;
                                     if ($kill->getExternalID()) {
                                         $logaddress .= ":kll_ext_id=" . $kill->getExternalID();
                                     } else {
                                         if ($internalID) {
                                             $logaddress .= ":kll_id=" . $internalID;
                                         }
                                     }
                                 } else {
                                     $logaddress = "ID: local input";
                                 }
                             }
                             logger::logKill($id, $logaddress);
                         }
                     }
                 }
             }
         }
     }
     if ($skip) {
         $this->skipped[] = array($externalID, $internalID, $id);
         if ($errorstring) {
             $errorstring .= " Kill not added. killID =  {$externalID}" . ($internalID ? ", killInternalID = {$internalID}." : ".");
             $this->parsemsg[] = $errorstring;
         }
     }
     if ($dup) {
         $this->duplicate[] = array($externalID, $internalID, $id);
     }
     if ($this->lastReturned < $externalID) {
         $this->lastReturned = $externalID;
     }
     if ($this->lastInternalReturned < $internalID) {
         $this->lastInternalReturned = $internalID;
     }
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:101,代码来源:class.idfeed.php

示例2: post

function post()
{
    global $page;
    if (config::get("post_password") == '' || crypt($_POST['password'], config::get("post_password")) == config::get("post_password") || $page->isAdmin()) {
        $parser = new Parser($_POST['killmail']);
        // Filtering
        if (config::get('filter_apply')) {
            $filterdate = config::get('filter_date');
            $year = substr($_POST['killmail'], 0, 4);
            $month = substr($_POST['killmail'], 5, 2);
            $day = substr($_POST['killmail'], 8, 2);
            $killstamp = mktime(0, 0, 0, $month, $day, $year);
            if ($killstamp < $filterdate) {
                $killid = -3;
            } else {
                $killid = $parser->parse(true, null, false);
            }
        } else {
            $killid = $parser->parse(true, null, false);
        }
        if ($killid <= 0) {
            if ($killid == 0) {
                $html = "Killmail is malformed.<br/>";
                if ($errors = $parser->getError()) {
                    foreach ($errors as $error) {
                        $html .= 'Error: ' . $error[0];
                        if ($error[1]) {
                            $html .= ' The text leading to this error was: "' . $error[1] . '"';
                        }
                        $html .= '<br/>';
                    }
                }
            } elseif ($killid == -1) {
                $url = edkURI::page('kill_detail', $parser->getDupeID(), 'kll_id');
                $html = "That killmail has already been posted <a href=\"" . edkURI::page('kill_detail', $parser->getDupeID(), 'kll_id') . "\">here</a>.";
            } elseif ($killid == -2) {
                $html = "You are not authorized to post this killmail.";
            } elseif ($killid == -3) {
                $filterdate = kbdate("j F Y", config::get("filter_date"));
                $html = "You are not allowed to post killmails older than" . " {$filterdate}.";
            } elseif ($killid == -4) {
                $html = "That mail has been deleted. Kill id was " . $parser->getDupeID();
                if ($page->isAdmin()) {
                    $html .= '<br />
<form id="postform" name="postform" class="f_killmail" method="post" action="' . edkURI::page('post') . '">
	<input type="hidden" name="killmail" id="killmail" value = "' . htmlentities($_POST['killmail']) . '"/>
	<input type="hidden" name="kll_id" id="kill_id" value = "' . $parser->getDupeID() . '"/>
	<input type="hidden" name="undelete" id="undelete" value = "1"/>
<input id="submit" name="submit" type="submit" value="Undelete" />
</form>';
                }
            }
        } else {
            if (config::get('post_mailto') != "") {
                $mailer = new PHPMailer();
                $kill = new Kill($killid);
                if (!($server = config::get('post_mailserver'))) {
                    $server = 'localhost';
                }
                $mailer->From = "mailer@" . config::get('post_mailhost');
                $mailer->FromName = config::get('post_mailhost');
                $mailer->Subject = "Killmail #" . $killid;
                $mailer->Host = $server;
                $mailer->Port = 25;
                $mailer->Helo = $server;
                $mailer->Mailer = "smtp";
                $mailer->AddReplyTo("no_reply@" . config::get('post_mailhost'), "No-Reply");
                $mailer->Sender = "mailer@" . config::get('post_mailhost');
                $mailer->Body = $_POST['killmail'];
                $mailer->AddAddress(config::get('post_mailhost'));
                $mailer->Send();
            }
            logger::logKill($killid);
            header("Location: " . htmlspecialchars_decode(edkURI::page('kill_detail', $killid, 'kll_id')));
            exit;
        }
    } else {
        $html = "Invalid password.";
    }
    return $html;
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:81,代码来源:post.php


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