1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Part of the Joomla Framework GitHub Package |
4
|
|
|
* |
5
|
|
|
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. |
6
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Joomla\Github\Package\Repositories; |
10
|
|
|
|
11
|
|
|
use Joomla\Github\AbstractPackage; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* GitHub API Repositories Pages class for the Joomla Framework. |
15
|
|
|
* |
16
|
|
|
* @documentation https://developer.github.com/v3/repos/pages/ |
17
|
|
|
* |
18
|
|
|
* @since 1.4.0 |
19
|
|
|
*/ |
20
|
|
|
class Pages extends AbstractPackage |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Get information about a Pages site. |
24
|
|
|
* |
25
|
|
|
* @param string $owner The name of the owner of the GitHub repository. |
26
|
|
|
* @param string $repo The name of the GitHub repository. |
27
|
|
|
* |
28
|
|
|
* @return object |
29
|
|
|
* |
30
|
|
|
* @since 1.4.0 |
31
|
|
|
*/ |
32
|
|
|
public function getInfo($owner, $repo) |
33
|
|
|
{ |
34
|
|
|
// Build the request path. |
35
|
|
|
$path = "/repos/$owner/$repo/pages"; |
36
|
|
|
|
37
|
|
|
return $this->processResponse( |
38
|
|
|
$this->client->get($this->fetchUrl($path)) |
39
|
|
|
); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* List Pages builds. |
44
|
|
|
* |
45
|
|
|
* @param string $owner The name of the owner of the GitHub repository. |
46
|
|
|
* @param string $repo The name of the GitHub repository. |
47
|
|
|
* @param integer $page The page number from which to get items. |
48
|
|
|
* @param integer $limit The number of items on a page. |
49
|
|
|
* |
50
|
|
|
* @return object |
51
|
|
|
* |
52
|
|
|
* @since 1.4.0 |
53
|
|
|
*/ |
54
|
|
|
public function getList($owner, $repo, $page = 0, $limit = 0) |
55
|
|
|
{ |
56
|
|
|
// Build the request path. |
57
|
|
|
$path = "/repos/$owner/$repo/pages/builds"; |
58
|
|
|
|
59
|
|
|
return $this->processResponse( |
60
|
|
|
$this->client->get($this->fetchUrl($path, $page, $limit)) |
61
|
|
|
); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* List latest Pages build. |
66
|
|
|
* |
67
|
|
|
* @param string $owner The name of the owner of the GitHub repository. |
68
|
|
|
* @param string $repo The name of the GitHub repository. |
69
|
|
|
* |
70
|
|
|
* @return object |
71
|
|
|
* |
72
|
|
|
* @since 1.4.0 |
73
|
|
|
*/ |
74
|
|
|
public function getLatest($owner, $repo) |
75
|
|
|
{ |
76
|
|
|
// Build the request path. |
77
|
|
|
$path = "/repos/$owner/$repo/pages/builds/latest"; |
78
|
|
|
|
79
|
|
|
return $this->processResponse( |
80
|
|
|
$this->client->get($this->fetchUrl($path)) |
81
|
|
|
); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|