1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage GitHub
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 use Joomla\Registry\Registry;
13
14 /**
15 * HTTP client class for connecting to a GitHub instance.
16 *
17 * @since 11.3
18 * @deprecated 4.0 Use the `joomla/github` package via Composer instead
19 */
20 class JGithubHttp extends JHttp
21 {
22 /**
23 * @const integer Use no authentication for HTTP connections.
24 * @since 11.3
25 */
26 const AUTHENTICATION_NONE = 0;
27
28 /**
29 * @const integer Use basic authentication for HTTP connections.
30 * @since 11.3
31 */
32 const AUTHENTICATION_BASIC = 1;
33
34 /**
35 * @const integer Use OAuth authentication for HTTP connections.
36 * @since 11.3
37 */
38 const AUTHENTICATION_OAUTH = 2;
39
40 /**
41 * Constructor.
42 *
43 * @param Registry $options Client options object.
44 * @param JHttpTransport $transport The HTTP transport object.
45 *
46 * @since 11.3
47 */
48 public function __construct(Registry $options = null, JHttpTransport $transport = null)
49 {
50 // Call the JHttp constructor to setup the object.
51 parent::__construct($options, $transport);
52
53 // Make sure the user agent string is defined.
54 $this->options->def('userAgent', 'JGitHub/2.0');
55
56 // Set the default timeout to 120 seconds.
57 $this->options->def('timeout', 120);
58 }
59 }
60