當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utilities::BBExit方法代碼示例

本文整理匯總了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']);
}
開發者ID:jncarlson,項目名稱:bluebaron,代碼行數:25,代碼來源:api-internal.php

示例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');
     }
 }
開發者ID:jncarlson,項目名稱:bluebaron,代碼行數:9,代碼來源:db_interaction_class.php


注:本文中的Utilities::BBExit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。