本文整理汇总了PHP中client::get方法的典型用法代码示例。如果您正苦于以下问题:PHP client::get方法的具体用法?PHP client::get怎么用?PHP client::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client
的用法示例。
在下文中一共展示了client::get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetch
private function fetch()
{
$response = $this->httpClient->get($this->path, $this->parameters, $this->headers);
$this->getPagination($response);
$elements = json_decode($response->getBody());
return $elements;
}
示例2: generateUserInfo
public function generateUserInfo()
{
$args = ['access_token' => $this->getAccessToken(), 'oauth_consumer_key' => $this->getAppKey(), 'openid' => $this->getOpenId()];
$msg = client::get($this->getUrl('userinfo'), ['query' => $args])->json();
if ($msg['ret'] !== 0) {
throw new \LogicException(app::get('sysuser')->_('参数错误!'));
}
return $this->convertStandardUserInfo($msg);
}
示例3: generateUserInfo
/**
* 通过调用信任登陆相关用户接口生成用户info
*
* @param string $code
* @return string
*/
public function generateUserInfo()
{
$args = ['access_token' => $this->getAccessToken()];
$msg = client::get($this->getUrl('userinfo'), ['query' => $args])->json();
if ($msg['error']) {
throw new \LogicException("error :" . $msg['error_code'] . "msg :" . $msg['error']);
}
return $this->convertStandardUserInfo($msg);
}
示例4: getCoordinatesForQuery
/**
*
* Get the coordinates for a query
*
* @param string $query
* @return array
* @throws \Exception
*/
public function getCoordinatesForQuery($query)
{
if ($query == '') {
return false;
}
$request = $this->client->get('http://maps.googleapis.com/maps/api/geocode/json');
$request->getQuery()->set('address', $query)->set('sensor', 'false');
$response = $request->send();
if ($response->getStatusCode() != 200) {
throw new \Exception('could not connect to googleapis.com/maps/api');
}
$fullResponse = $response->json();
if (count($fullResponse['results'])) {
$geocoderResult = ['lat' => $fullResponse['results'][0]['geometry']['location']['lat'], 'lng' => $fullResponse['results'][0]['geometry']['location']['lng'], 'accuracy' => $fullResponse['results'][0]['geometry']['location_type']];
} else {
$geocoderResult = ['lat' => 0, 'lng' => 0, 'accuracy' => self::RESULT_NOT_FOUND];
}
return $geocoderResult;
}
示例5: download
static function download($ver)
{
$url = 'http://sitecake.com/dl/upgrade/sitecake-' . $ver . '-upgrade.zip';
$resp = client::get($url);
if ($resp->isSuccess()) {
$file = TEMP_DIR . '/' . 'sitecake-' . $ver . '-upgrade.zip';
io::file_put_contents($file, $resp->getBody());
return $file;
} else {
return array('status' => -1, 'errorMessage' => 'Unable to download upgrade from ' . $url);
}
}
示例6: index
/**
* Display a listing of the resource.
* GET /clients
*
* @return Response
*/
public function index()
{
return Response::json($this->client->get());
}
示例7: escalateSend
static function escalateSend($parent, $param, $fullmess)
{
global $gbl, $sgbl, $login, $ghtml;
$action = 'escalate';
$obj = new client(null, null, 'admin');
$obj->get();
$extra = null;
$from = "helpdesk";
if ($sgbl->__var_program_name === 'lxlabsclient') {
$ip = "lxlabs.com";
if ($parent->isOn('escalate')) {
$extra .= "X-escalate: Escalated\n";
}
/*
if ($parent->used->vps_num > 100) {
$subject = "P:100: $subject";
} else if ($parent->used->vps_num > 50) {
$subject = "P:50: $subject";
} else {
$subject = "P:10: $subject";
}
*/
} else {
$ip = getFQDNforServer('localhost');
}
$pass = $parent->realpass;
$ticktid = $parent->nname;
$extram = base64_encode(serialize(array('ticket_c' => $obj->getClName())));
$urllink = "Click here to login to the Ticket: http://{$ip}:{$sgbl->__var_prog_port}/htmllib/phplib/?frm_clientname={$ticktid}&frm_class=ticket&frm_password={$pass}";
$actxt = "has been escalated";
$extra = "Message-ID: {$parent->mail_messageid}\n";
$message = $fullmess;
ticketHistory::ticketSendNotification($from, $parent->nname, $category, $obj, $action, $actxt, $param['made_by'], $parent->subject, $message, $extra);
}
示例8:
<?php
include 'template/blankStart.php';
include_once '../model/profiles/client.php';
?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"> </h3>
</div>
<div class="panel-body">
<?php
$client = client::get($_GET['client']);
echo "<h1>নাম :{$_GET['client']}</h1><br>";
echo "<h1>ফোন :{$client['address']}</h1><br>";
echo "<h1>ফোন :{$client['phone']}</h1><br>";
echo "<h1>ফোন :{$client['email']}</h1><br>";
?>
</div>
</div>
</div>
</div>
<?php
include 'template/blankEnd.php';