| 1 | <?php |
||
| 17 | class HttpClientAuthentication |
||
| 18 | { |
||
| 19 | const AUTH_BASIC = CURLAUTH_BASIC; |
||
| 20 | const AUTH_DIGEST = CURLAUTH_DIGEST; |
||
| 21 | const AUTH_NTLM = CURLAUTH_NTLM; |
||
| 22 | const AUTH_ANY = CURLAUTH_ANY; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | private $username; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | private $password; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var int |
||
| 36 | */ |
||
| 37 | private $type; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Creates an HTTP Client Authentication |
||
| 41 | * |
||
| 42 | * @param string $username |
||
| 43 | * @param string $password |
||
| 44 | * @param int $type |
||
| 45 | */ |
||
| 46 | public function __construct($username, $password, $type = self::AUTH_ANY) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * User's name |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function username() |
||
| 62 | |||
| 63 | /** |
||
| 64 | * User's password |
||
| 65 | * |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | public function password() |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Authentication type |
||
| 75 | * |
||
| 76 | * @return int |
||
| 77 | */ |
||
| 78 | public function type() |
||
| 82 | } |