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 | 4 | public function __construct($secret_token = '', $grant_token = '') |
|
51 | |||
52 | 4 | /** |
|
53 | 4 | * Shutdown function. |
|
54 | * |
||
55 | * Closes the current cURL connection |
||
56 | */ |
||
57 | public function shutdown() |
||
63 | |||
64 | /** |
||
65 | * Create function. |
||
66 | * |
||
67 | * Create cURL connection with authentication |
||
68 | */ |
||
69 | public function create() |
||
81 | 4 | ||
82 | 4 | /** |
|
83 | 4 | * authenticate function. |
|
84 | * |
||
85 | 4 | * Create authentication headers |
|
86 | 4 | */ |
|
87 | 4 | protected function authenticate() |
|
112 | } |
||
113 |