@param string $region
@param int    $gameId
@param int    $chunkId

@return string|bool
976811
public function getLastChunkInfo($region, $gameId, $chunkId)
    {
        try {
            $chunkInfo = $this->buzz->get(sprintf(
                $this->getUrl($region) . self::URL_CHUNK_INFO,
                $region,
                $gameId,
                $chunkId
            ));
        } catch (TimeoutException $e) {
            return false;
        } catch (RequestException $e) {
            return false;
        }

        return $chunkInfo->getContent();
    }
451680
public function renderChunk( $chunk, $data = []) {
		foreach ( $data as $key => $value ) {
			$data['{' . strtoupper( $key ) . '}'] = $value;
		}
		
		return strtr( $chunk, $data );
	}
82640
public static RegionOperationId of(String region, String operation) {
    return new RegionOperationId(null, region, operation);
  }
1287138
protected function log($gameId, $message)
    {
        if (null != $this->logger) {
            $this->logger->info('Game #' . $gameId . ': ' . $message);
        }
    }
463587
public function createBucket($bucket, $region='z0')
    {
        $bucket = \Qiniu\base64_urlSafeEncode($bucket);
        $path = "/mkbucketv2/".$bucket."/region/".$region;
        list(, $error) = $this->rsPost($path);
        return $error;
    }
920902
public function getEndOfGameStatsPath($region, $gameId)
    {
        $endStatsPath = null;

        try {
            $endStatsPath = $this->observerClient->getEndStats($region, $gameId);
        } catch (ReplayEndStatsNotFoundException $e) {
            // Log
            $this->log($gameId, sprintf('GET /endOfGameStats/%s/%s/null | ERROR: the endstats is not found', $region, $gameId));

            throw $e;
        }

        // Log
        $this->log($gameId, sprintf('GET /endOfGameStats/%s/%s/null', $region, $gameId));

        return $endStatsPath;
    }
1231318
public function scroll(
        $scrollId,
        $scrollDuration = '5m'
    ) {
        $results = $this->getClient()->scroll(['scroll_id' => $scrollId, 'scroll' => $scrollDuration]);

        return $results;
    }
489240
public function getGameDataChunkContent($region, $gameId, $chunkId)
    {
        return file_get_contents($this->getGameDataChunkPath($region, $gameId, $chunkId));
    }
549227
public function downloadKeyframe($region, $gameId, $keyframeId)
    {
        try {
            $keyframe = $this->buzz->get(sprintf(
                $this->getUrl($region) . self::URL_KEYFRAME_DOWNLOAD,
                $region,
                $gameId,
                $keyframeId
            ));
        } catch (TimeoutException $e) {
            return false;
        } catch (RequestException $e) {
            return false;
        }

        // Check if game exists
        $header = $keyframe->getHeaders()[0];
        if ('HTTP/1.1 500 Internal Server Error' == $header || 'HTTP/1.1 404 Not Found' == $header) {
            return false;
        }

        return $keyframe->getContent();
    }
1084471
public function createBucket($bucket, $region='z0'){
        $err = $this->subBucketManager->createBucket($bucket, $region);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功');
    }
1327853
public function transfer($id, $regionSlug)
    {
        $action = $this->adapter->post(sprintf('%s/images/%d/actions', $this->endpoint, $id), ['type' => 'transfer', 'region' => $regionSlug]);

        $action = json_decode($action);

        return new ActionEntity($action->action);
    }
1189953
public function searchRegion($region, $term, $params = array())
    {
        return $this->search($term, array_merge(array('country' => strtoupper($region)), $params));
    }
1175542
public function blocks_for_region($region) {
        $blockcontents = $this->page->blocks->get_content_for_region($region, $this);
        $blocks = $this->page->blocks->get_blocks_for_region($region);
        $lastblock = null;
        $zones = array();
        foreach ($blocks as $block) {
            $zones[] = $block->title;
        }
        $output = '';

        foreach ($blockcontents as $bc) {
            if ($bc instanceof block_contents) {
                $output .= $this->block($bc, $region);
                $lastblock = $bc->title;
            } else if ($bc instanceof block_move_target) {
                $output .= $this->block_move_target($bc, $zones, $lastblock, $region);
            } else {
                throw new coding_exception('Unexpected type of thing (' . get_class($bc) . ') found in list of block contents.');
            }
        }
        return $output;
    }
6167
public function getCD($region, $credential)
    {
        if (!$config = $this->getConfigWithCredentials($region, $credential)) {
            return null;
        }

        return $this->aws->createCodeDeploy($config);
    }
1361583
public OvhRegion serviceName_region_regionId_GET(String serviceName, String regionId) throws IOException {
		String qPath = "/dbaas/queue/{serviceName}/region/{regionId}";
		StringBuilder sb = path(qPath, serviceName, regionId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhRegion.class);
	}
632560
public function fetchConversationWith($gamertag, $region, $sender)
	{
		$gamertag = trim($gamertag);
		$url = 'https://account.xbox.com/' . $region . '/Messages/UserConversation?senderGamerTag=' . $sender;
		$key = $this->version . ':getMessages.' . $gamertag;
	
		$data      = $this->fetch_url($url);
		$doc = new DOMDocument();
		if(!empty($sender) && !empty($gamertag)) {
			$doc->loadHtml($data);
		    $xpath = new DOMXPath($doc); 
		    $postThumbLinks = $xpath->query("//div[@class='messageContent']");

			$i = 0;
			$array = array();
			$last_sender = "";
		    foreach($postThumbLinks as $link) {

				$body = $this->find($link->ownerDocument->saveHTML($link),'<div class="messageBody">','</div>');
				$time = $this->find($link->ownerDocument->saveHTML($link),'<div class="sentDate localTime">','</div>');
				$sender = $this->find($link->ownerDocument->saveHTML($link),'<div class="senderGamertag">','</div>');

				$array[$i]['message'] = $body;
				$array[$i]['time'] = $time;
				if($sender){
					$array[$i]['sender'] = $sender;
					$last_sender = $sender;
				}else{
					$array[$i]['sender'] = $last_sender;
				}

				$i++;
		    }
		} else {
		    return false;
		}

		return $array;
	}
442006
public function contentToRegion($region, $content)
    {
        $regions = $this->contentRegion->findBy(array('content' => $content));

        if (count($regions) === 1 and $regions[0]->getRegion()->getName() === $region->getName()) {
            $this->deleteRegions($content, $regions);
        } else {
            $this->deleteRegions($content, $regions);

            $first = $this->contentRegion->findOneBy(array('back' => null, 'region' => $region));
            $contentRegion = new Content2Region($first);
            $contentRegion->setRegion($region);
            $contentRegion->setContent($content);
            $this->manager->persist($contentRegion);
            $this->manager->flush();
        }
    }