本文整理汇总了PHP中Info::getCorpName方法的典型用法代码示例。如果您正苦于以下问题:PHP Info::getCorpName方法的具体用法?PHP Info::getCorpName怎么用?PHP Info::getCorpName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Info
的用法示例。
在下文中一共展示了Info::getCorpName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($parameters, $db)
{
$keyID = (int) $parameters[0];
$vCode = $db->queryField("select vCode from zz_api where keyID = :keyID", "vCode", array(":keyID" => $keyID), 0);
if ($keyID == 0 && strlen($vCode) == 0) {
return;
}
// Update lastValidation
$db->execute("update zz_api set lastValidation = now() where keyID = :keyID", array(":keyID" => $keyID));
$pheal = Util::getPheal($keyID, $vCode);
try {
$apiKeyInfo = $pheal->ApiKeyInfo();
} catch (Exception $ex) {
Log::log("Error Validating {$keyID}: " . $ex->getCode() . " " . $ex->getMessage());
Api::handleApiException($keyID, null, $ex);
return;
}
// Clear the error code
$db->execute("update zz_api set errorCode = 0 where keyID = :keyID", array(":keyID" => $keyID));
$key = $apiKeyInfo->key;
$accessMask = $key->accessMask;
$characterIDs = array();
if (Api::hasBits($accessMask)) {
foreach ($apiKeyInfo->key->characters as $character) {
$characterID = $character->characterID;
$characterIDs[] = $characterID;
$corporationID = $character->corporationID;
$isDirector = $apiKeyInfo->key->type == "Corporation" ? "T" : "F";
$count = $db->queryField("select count(*) count from zz_api_characters where keyID = :keyID and isDirector = :isDirector and characterID = :characterID and corporationID = :corporationID", "count", array(":keyID" => $keyID, ":characterID" => $characterID, ":corporationID" => $corporationID, ":isDirector" => $isDirector), 0);
if ($count == 0) {
$db->execute("replace into zz_api_characters (keyID, characterID, corporationID, isDirector, cachedUntil) values (:keyID, :characterID, :corporationID, :isDirector, 0)", array(":keyID" => $keyID, ":characterID" => $characterID, ":corporationID" => $corporationID, ":isDirector" => $isDirector));
$charName = Info::getCharName($characterID, true);
$corpName = Info::getCorpName($corporationID, true);
$allianceID = $db->queryField("select allianceID from zz_corporations where corporationID = :corpID", "allianceID", array(":corpID" => $corporationID));
$alliName = $allianceID > 0 ? "/ " . Info::getAlliName($allianceID) : "";
$type = $isDirector == "T" ? "corp" : "char";
while (strlen($keyID) < 8) {
$keyID = " " . $keyID;
}
Log::log("KeyID: {$keyID} ({$type}) Populating {$charName} / {$corpName} {$alliName}");
}
}
}
// Clear entries that are no longer tied to this account
if (sizeof($characterIDs) == 0) {
$db->execute("delete from zz_api_characters where keyID = :keyID", array(":keyID" => $keyID));
} else {
$db->execute("delete from zz_api_characters where keyID = :keyID and characterID not in (" . implode(",", $characterIDs) . ")", array(":keyID" => $keyID));
}
}
示例2: getWarInfo
public static function getWarInfo($warID)
{
global $mdb;
$warInfo = array();
if ($warID == null) {
return $warInfo;
}
$warInfo = $mdb->findDoc('information', ['type' => 'warID', 'id' => $warID]);
$warInfo['warID'] = $warID;
$agr = $warInfo['aggressor']['id'];
$agrIsAlliance = self::isAlliance($agr);
$agrName = $agrIsAlliance ? Info::getAlliName($agr) : Info::getCorpName($agr);
$warInfo['agrName'] = $agrName;
$warInfo['agrLink'] = ($agrIsAlliance ? '/alliance/' : '/corporation/') . "{$agr}/";
$dfd = $warInfo['defender']['id'];
$dfdIsAlliance = self::isAlliance($dfd);
$dfdName = $dfdIsAlliance ? Info::getAlliName($dfd) : Info::getCorpName($dfd);
$warInfo['dfdName'] = $dfdName;
$warInfo['dfdLink'] = ($dfdIsAlliance ? '/alliance/' : '/corporation/') . "{$dfd}/";
$warInfo['dscr'] = "{$agrName} vs {$dfdName}";
return $warInfo;
}