private function fetch()
 {
     $response = $this->httpClient->get($this->path, $this->parameters, $this->headers);
     $this->getPagination($response);
     $elements = json_decode($response->getBody());
     return $elements;
 }
Exemplo n.º 2
0
Arquivo: qq.php Projeto: 453111208/bbc
 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);
 }
Exemplo n.º 3
0
 /**
  * 通过调用信任登陆相关用户接口生成用户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);
 }
Exemplo n.º 4
0
 /**
  *
  * 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;
 }
Exemplo n.º 5
0
 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);
     }
 }
 /**
  * Display a listing of the resource.
  * GET /clients
  *
  * @return Response
  */
 public function index()
 {
     return Response::json($this->client->get());
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
<?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';