1 | <?php |
||
8 | class Client |
||
9 | { |
||
10 | /** |
||
11 | * Contains cURL instance. |
||
12 | */ |
||
13 | public $ch; |
||
14 | |||
15 | /** |
||
16 | * Contains the authentication string. |
||
17 | */ |
||
18 | protected $secret_token; |
||
19 | |||
20 | protected $grant_token; |
||
21 | |||
22 | /** |
||
23 | * __construct function. |
||
24 | * |
||
25 | * Instantiate object |
||
26 | * |
||
27 | * @param string $secret_token |
||
28 | * @param string $grant_token |
||
29 | * |
||
30 | * @throws Exception |
||
31 | */ |
||
32 | 19 | public function __construct($secret_token = '', $grant_token = '') |
|
52 | |||
53 | /** |
||
54 | * Shutdown function. |
||
55 | * |
||
56 | * Closes the current cURL connection |
||
57 | */ |
||
58 | 12 | public function shutdown() |
|
64 | |||
65 | /** |
||
66 | * Create function. |
||
67 | * |
||
68 | * Create cURL connection with authentication |
||
69 | */ |
||
70 | 12 | public function create() |
|
84 | |||
85 | /** |
||
86 | * authenticate function. |
||
87 | * |
||
88 | * Create authentication headers |
||
89 | */ |
||
90 | 12 | protected function authenticate() |
|
115 | } |
||
116 |