本文整理汇总了PHP中Utilities::BBExit方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::BBExit方法的具体用法?PHP Utilities::BBExit怎么用?PHP Utilities::BBExit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::BBExit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: file_get_contents
<?php
include './api-config.php';
$data = file_get_contents('php://input');
$data = json_decode($data);
$data = (array) $data;
$data['region'] = strtolower($data['region']);
if (!isset($data['id']) && !isset($data['region']) && !isset($data['partial'])) {
Utilities::BBExit('69', 'bb_api');
}
if (!Utilities::verifyRequestVars($data)) {
Utilities::BBExit('420', 'bb_api');
}
if ($data['partial'] == 'initialize') {
$refresh = isset($data['update']) ? true : false;
if (!DB_Interaction::canUserRefresh($data['id'], $data['region']) && $refresh) {
$timeUntilRefresh = DB_Interaction::getTimeUntilUserCanRefresh($data['id'], $data['region']);
Utilities::bbExit('666', 'bb_api', "You have {$timeUntilRefresh['minutes']} minutes {$timeUntilRefresh['seconds']} seconds until you can refresh.");
}
$api = new BBApi();
$api->appInit($data['id'], $data['region'], $refresh);
} else {
$api = new BBApi($data['id'], $data['region']);
$api->getDataForApi($data['partial']);
}
示例2: getApiDataFromDB
public static function getApiDataFromDB($playerId, $region, $dataType)
{
if (in_array($dataType, self::$dbFields)) {
$sql = "SELECT `{$dataType}` FROM `summoner` WHERE summoner_id={$playerId} AND region='{$region}';";
return self::getResultData($sql, $dataType);
} else {
Utilities::BBExit('42', 'bb_api');
}
}