forked from joomla-framework/github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttp.php
More file actions
69 lines (61 loc) · 1.58 KB
/
Http.php
File metadata and controls
69 lines (61 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Part of the Joomla Framework Github Package
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Github;
use Joomla\Http\Http as BaseHttp;
use Joomla\Http\TransportInterface;
/**
* HTTP client class for connecting to a GitHub instance.
*
* @since 1.0
* @deprecated 2.0 Use Joomla\Http\Http instead
*/
class Http extends BaseHttp
{
/**
* @const integer Use no authentication for HTTP connections.
* @since 1.0
* @deprecated 2.0
*/
const AUTHENTICATION_NONE = 0;
/**
* @const integer Use basic authentication for HTTP connections.
* @since 1.0
* @deprecated 2.0
*/
const AUTHENTICATION_BASIC = 1;
/**
* @const integer Use OAuth authentication for HTTP connections.
* @since 1.0
* @deprecated 2.0
*/
const AUTHENTICATION_OAUTH = 2;
/**
* Constructor.
*
* @param array $options Client options array.
* @param TransportInterface $transport The HTTP transport object.
*
* @since 1.0
* @deprecated 2.0
*/
public function __construct($options = array(), TransportInterface $transport = null)
{
// Call the JHttp constructor to setup the object.
parent::__construct($options, $transport);
// Make sure the user agent string is defined.
if (!isset($this->options['userAgent']))
{
$this->options['userAgent'] = 'JGitHub/2.0';
}
// Set the default timeout to 120 seconds.
if (!isset($this->options['timeout']))
{
$this->options['timeout'] = 120;
}
}
}