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


PHP Utilities::bbExit方法代码示例

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


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

示例1: appInit

 public function appInit($username, $region, $refresh)
 {
     if (($summonerId = DB_Interaction::userExists($username, $region)) && !$refresh) {
         $response = new Response(array('player_id' => $summonerId, 'region' => $region));
         exit($response->getResponse());
     }
     $riot = new RiotApi($username, $region, $refresh);
     $data = $riot->getApiData();
     $custom = new CustomData($data);
     $custom = $custom->getCustomData();
     if (DB_Interaction::insertRiotData($custom, $refresh)) {
         $response = new Response(array('player_id' => $custom['summoner_id'], 'region' => $custom['region']));
         exit($response->getResponse());
     } else {
         Utilities::bbExit('23', 'bb_api');
     }
 }
开发者ID:jncarlson,项目名称:bluebaron,代码行数:17,代码来源:bb_api_class.php

示例2: 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

示例3: responseHasErrors

 /**
     * @desc checks the status code of the cURL response
     * @params
         $ch     - cURL handle of request
         $type   - the type of api call
     * @return boolean depending on the http status of the request
 */
 private function responseHasErrors($ch, $type, $i)
 {
     $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     $error;
     if ($httpCode === 200) {
         // The response was good
         $error = false;
     } else {
         if ($httpCode === 503 || $httpCode === 500) {
             // possibly an error at the time of the request so we will try again
             $this->errors[$type] = $httpCode;
             error_log("\n\n\nThere was an error with the {$type} call. With error code: {$httpCode}. Calling url: {$this->lastCalledUrl}\n\n\n");
             $error = true;
         } else {
             // something else went wrong log it and don't try again
             error_log("\n\n\nThere was an error with the {$type} call. With error code: {$httpCode}. Calling url: {$this->lastCalledUrl}\n\n\n");
             Utilities::bbExit($httpCode, 'riot_api');
         }
     }
     if ($error && $i == 4) {
         Utilities::bbExit($httpCode, 'riot_api');
     }
     return $error;
 }
开发者ID:jncarlson,项目名称:bluebaron,代码行数:31,代码来源:riot_api_class.php


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