1 | <?php |
||
16 | class BasicAuth |
||
17 | { |
||
18 | /** |
||
19 | * cURL handle. |
||
20 | * |
||
21 | * @var resource |
||
22 | */ |
||
23 | protected $ch; |
||
24 | |||
25 | /** |
||
26 | * Consumer key. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $consumerKey; |
||
31 | |||
32 | /** |
||
33 | * Consumer secret. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $consumerSecret; |
||
38 | |||
39 | /** |
||
40 | * Do query string auth. |
||
41 | * |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $doQueryString; |
||
45 | |||
46 | /** |
||
47 | * Request parameters. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $parameters; |
||
52 | |||
53 | /** |
||
54 | * Initialize Basic Authentication class. |
||
55 | * |
||
56 | * @param resource $ch cURL handle. |
||
57 | * @param string $consumerKey Consumer key. |
||
58 | * @param string $consumerSecret Consumer Secret. |
||
59 | * @param bool $doQueryString Do or not query string auth. |
||
60 | * @param array $parameters Request parameters. |
||
61 | */ |
||
62 | public function __construct($ch, $consumerKey, $consumerSecret, $doQueryString, $parameters = []) |
||
72 | |||
73 | /** |
||
74 | * Process auth. |
||
75 | */ |
||
76 | protected function processAuth() |
||
85 | |||
86 | /** |
||
87 | * Get parameters. |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function getParameters() |
||
95 | } |
||
96 |