Get connected client data(
@return Client|null
@throws \Exception
502087
private function initClient() {
		if(isset($_COOKIE[self::CLIENT_INFO_COOKIE])) {
			$clientData = @json_decode(base64_decode($_COOKIE[self::CLIENT_INFO_COOKIE], true), true);
			if(!$clientData) {
				throw new \Exception('Wrong format of response cookie data: ' . $_COOKIE[self::CLIENT_INFO_COOKIE]);
			}

			$client = new Client($clientData);
			if(isset($clientData['auth'])) {
				$client->auth = new ClientAuth($clientData['auth']);
			}
			return $client;
		}
	}
99741
public function getConn()
    {
        if ($this->conn === null) {
            $this->conn = Connection::connect($this->req->getUrlParam('conn'), $this);
            if ($this->conn === false) {
                $this->res->error = Connection::getLastError();
                $this->finish();
            } else {
                if ($this->conn !== null) {
                    $this->conn->addWriteData($this->getRequestBuf());
                }
            }
        }
        return $this->conn;
    }
429462
public function getInternalRequestClient()
	{
		// if we didnt find one lets make one
		if (!$client = $this->findInternalClient())
		{
			if ($this->createInternalRequestClient())
			{
				$client = $this->findInternalClient();
			}
		}

		// return client
		return ($client) ? $client : null;
	}
932680
public function getEntityData()
    {
        $entity = null;
        try {
            $entity = $this->getEntity(
                    $this->getRequest()->getParameter('id')
            );
        } catch (NotFoundException $exception) {
            // The entity does not exist, create a new one from the data in the
            // request.
            $entity = $this->getEntityClass()->newInstanceArgs(
                    $this->getEntityDataFromRequest()
            );
        }

        return $entity->getFieldsData();
    }
356555
public function get($name)
    {
        // get from cache
        if (isset($this->pool[$name])) {
            return $this->pool[$name];
        }
        
        // check if connection exists
        if (!isset($this->configuration[$name])) {
            throw new Exception('Connection with name ' . $name . ' not found');
        }
        
        // check if dsn exists
        if (!isset($this->configuration[$name]['dsn'])) {
            $this->configuration[$name]['dsn'] = null;
        }
        
        // check if connect options exists
        if (empty($this->configuration[$name]['connectOptions'])) {
            $this->configuration[$name]['connectOptions'] = null;
        }
        
        // init client
        $client = new Client(
            $this->configuration[$name]['dsn'],
            $this->configuration[$name]['connectOptions']
        );
        
        if (isset($this->configuration[$name]['mapping'])) {
            $client->map($this->configuration[$name]['mapping']);
        }
        
        if (isset($this->configuration[$name]['defaultDatabase'])) {
            $client->useDatabase($this->configuration[$name]['defaultDatabase']);
        }
        
        $this->pool[$name] = $client;
        
        return $client;
    }
852438
public function getClientConnection()
    {
        if (!$this->serviceClient) {
            $this->createClient();
        }

        if (!$this->serviceClient->isAlive()) {
            $this->serviceClient->connect();
        }

        return $this->serviceClient;
    }
265285
public function getUserClient()
    {
        if (!$this->userClient) {
            $this->userClient = Factory::getUserClient(
                null, $this->configuration->getApiKey(), [Factory::API_BASE_URL => $this->configuration->getApiUri()]
            );
        }

        return $this->userClient;
    }
874086
public function getConnection() {
        if (is_null($this->conn) || !($this->conn)) {
            $dsn = 'dblib:host=' . $this->host . ':1433;dbname=' . $this->db . ';charset=utf8';
            $this->conn = new \PDO($dsn, $this->user, $this->pass);

            if (is_bool($this->conn)) {
                throw new \Exception('unable to connect to db with provided credentials');
            }
        }

        return $this->conn;
    }
1278637
protected function getClient() {
        if ($this->client === null) {
            $this->client = new Client($this->getParam('accountId'), $this->getParam('applicationKey'));
        }

        return $this->client;
    }
863913
public function getClient()
    {
        $options = [
            'base_uri' => $this->base_url . 'rest/api/',
            'auth' => [$this->user, $this->pass],
        ];

        return new Client($options);
    }
572991
public function getData()
    {
        $this->validate(
            'partner',
            'notify_id'
        );

        $data            = $this->parameters->all();
        $data['service'] = $this->service;

        return $data;
    }
987852
public static function getOssClient()
    {
        try {
            $ossClient = new OssClient(self::accessKeyId, self::accessKeySecret, self::endpoint, false);
        } catch (OssException $e) {
            printf(__FUNCTION__ . "creating OssClient instance: FAILED\n");
            printf($e->getMessage() . "\n");
            return null;
        }
        return $ossClient;
    }
1335895
public function connect()
    {
        if ($this->connection != null) {
            $this->disconnect();
        }

        if ($this->config['persistent'] == true) {
            $tmp = null;
            $this->connection = @pfsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
        } else {
            $this->connection = fsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
        }

        if (!empty($errNum) || !empty($errStr)) {
            $this->error($errStr, $errNum);
        }

        $this->connected = is_resource($this->connection);

        return $this->connected;
    }
18588
public function getConnection() {
		try {
			$pdo = null;

			switch($this->driver){
				case "pdo_mysql": // MySQL Database
					$pdo = new PDO("mysql:host=".$this->host.";dbname=".$this->database.";charset=utf8", $this->user, $this->password);
					break;
				case "pdo_sqlserver": // SQL Server Database
					$pdo = new PDO("sqlsrv:Server=".$this->host.";Database=".$this->database, $this->user, $this->password);
					break;
				case "pdo_sqlite": // SQLite Database
				    $pdo = new PDO("sqlite:{$this->database}");
					break;
				case "pdo_pgsql": // PostgreSQL Database
				    $pdo = new PDO("pgsql:dbname={$this->database};host={$this->host}", $this->user, $this->password);
				    break;
				case "pdo_oci": // Oracle Database
					$tns = "oci:dbname=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = {$this->host}) (Port = {$this->port}))) (CONNECT_DATA = (SERVICE_NAME = {$this->database})))";
					$pdo = new PDO($tns, $this->user, $this->password);
					break;
				default:
					throw new  Exception("Database driver not defined");
				}

				if (count($this->attributes) > 0) {
					foreach ($this->attributes as $key => $value) {
						$pdo->setAttribute($key, $value);
					}
				}

				$this->pdo = $pdo;

				return $pdo;

		} catch (PDOException $e) {
			throw new PDOException('Unable to connect to database, errorMessage = '.$e->getMessage());
		} catch (Exception $e) {
			throw new Exception('Internal error, errorMessage = '.$e->getMessage());
		}
	}
1366658
public function getData()
    {
        if ($this->data instanceof Arrayable) {
            $this->data = $this->data->toArray();
        }

        if (!is_array($this->data)) {
            $this->data = null;
        }

        return $this->data;
    }
196957
public function getClient() {
		if ( $this->client === null ) {
			$this->client = $this->newClient();
		}
		return $this->client;
	}
901738
public function clientIp()
    {
        $keys = [
            'REMOTE_ADDR',
            'HTTP_CLIENT_IP',
            'HTTP_X_FORWARDED_FOR',
        ];

        foreach ($keys as $offset) {
            if ($this->server->has($offset)) {
                return $this->server->get($offset);
            }
        }

        return null;
    }