1 | <?php |
||
18 | class Requests_Auth_Basic implements Requests_Auth { |
||
19 | /** |
||
20 | * Username |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | public $user; |
||
25 | |||
26 | /** |
||
27 | * Password |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | public $pass; |
||
32 | |||
33 | /** |
||
34 | * Constructor |
||
35 | * |
||
36 | * @throws Requests_Exception On incorrect number of arguments (`authbasicbadargs`) |
||
37 | * @param array|null $args Array of user and password. Must have exactly two elements |
||
38 | */ |
||
39 | public function __construct($args = null) { |
||
48 | |||
49 | /** |
||
50 | * Register the necessary callbacks |
||
51 | * |
||
52 | * @see curl_before_send |
||
53 | * @see fsockopen_header |
||
54 | * @param Requests_Hooks $hooks Hook system |
||
55 | */ |
||
56 | public function register(Requests_Hooks &$hooks) { |
||
60 | |||
61 | /** |
||
62 | * Set cURL parameters before the data is sent |
||
63 | * |
||
64 | * @param resource $handle cURL resource |
||
65 | */ |
||
66 | public function curl_before_send(&$handle) { |
||
70 | |||
71 | /** |
||
72 | * Add extra headers to the request before sending |
||
73 | * |
||
74 | * @param string $out HTTP header string |
||
75 | */ |
||
76 | public function fsockopen_header(&$out) { |
||
79 | |||
80 | /** |
||
81 | * Get the authentication string (user:pass) |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getAuthString() { |
||
88 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.