# PHP

{% hint style="info" %}
Hackle PHP SDK는 PHP 7.1.33 버전 이상을 지원합니다.

PHP SDK는 1.0.0 버전부터 적용하시길 바랍니다.
{% endhint %}

## SDK 의존성 추가

SDK 의존성을 추가 합니다.

[![](https://img.shields.io/packagist/v/hackle/hackle-php-sdk)](https://packagist.org/packages/hackle/hackle-php-sdk)

```php
php composer.phar require hackle/hackle-php-sdk:{sdk_version}

//OR
composer require hackle/hackle-php-sdk:{sdk_version}
```

그 다음 autoload 시킵니다.

```php
require 'vendor/autoload.php';
```

## SDK 초기화

`HackleClient`는 SDK 기능을 사용하기 위한 메소드들을 제공하는 클래스입니다.\
SDK 를 사용하기 위해서는 `HackleClient` 초기화가 필요합니다.

#### 인스턴스화

SDK 키를 전달하여 `HackleClient`를 인스턴스화 합니다.

`HackleClient`는 필요한 정보들을 얻기 위해, 핵클에서 제공하는 메소드를 사용할 때마다 주기적으로 데이터를 파일로 캐시합니다.

* SDK 키는 핵클 서비스의 대시보드 안에 위치한 [SDK 연동 정보](https://dashboard.hackle.io/config/sdk-setting)에서 확인하실 수 있습니다.
* 캐시 정보는 `/tmp/hackle/`에 저장됩니다.

```php
$client = \Hackle\HackleClients::create("YOUR_SERVER_SDK_KEY");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/development-guide/php.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
