Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
PK�!�[�N&]]
assignees.phpnu�[���<?php
/**
* @package Joomla.Platform
* @subpackage GitHub
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* GitHub API Assignees class for the Joomla Platform.
*
* @documentation https://developer.github.com/v3/issues/assignees/
*
* @since 3.1.4
* @deprecated 4.0 Use the `joomla/github` package via Composer instead
*/
class JGithubPackageIssuesAssignees extends JGithubPackage
{
/**
* List assignees.
*
* This call lists all the available assignees (owner + collaborators) to
which issues may be assigned.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
*
* @return object
*/
public function getList($owner, $repo)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/assignees';
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
/**
* Check assignee.
*
* You may check to see if a particular user is an assignee for a
repository.
* If the given assignee login belongs to an assignee for the repository,
a 204 header
* with no content is returned.
* Otherwise a 404 status code is returned.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $assignee The assignees login name.
*
* @throws DomainException|Exception
* @return boolean
*/
public function check($owner, $repo, $assignee)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/assignees/' . $assignee;
try
{
$response = $this->client->get($this->fetchUrl($path));
if (204 == $response->code)
{
return true;
}
throw new DomainException('Invalid response: ' .
$response->code);
}
catch (DomainException $e)
{
if (isset($response->code) && 404 == $response->code)
{
return false;
}
throw $e;
}
}
}
PK�!�[(bOS
comments.phpnu�[���<?php
/**
* @package Joomla.Platform
* @subpackage GitHub
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* GitHub API Comments class for the Joomla Platform.
*
* The Issue Comments API supports listing, viewing, editing, and creating
comments
* on issues and pull requests.
*
* @documentation https://developer.github.com/v3/issues/comments/
*
* @since 3.1.4
* @deprecated 4.0 Use the `joomla/github` package via Composer instead
*/
class JGithubPackageIssuesComments extends JGithubPackage
{
/**
* Method to get the list of comments on an issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $issueId The issue number.
* @param integer $page The page number from which to get items.
* @param integer $limit The number of items on a page.
*
* @throws DomainException
* @since 1.7.3
*
* @return array
*/
public function getList($owner, $repo, $issueId, $page = 0, $limit = 0)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . (int) $issueId . '/comments';
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path, $page, $limit))
);
}
/**
* Method to get the list of comments in a repository.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $sort The sort field - created or updated.
* @param string $direction The sort order- asc or desc. Ignored
without sort parameter.
* @param JDate $since A timestamp in ISO 8601 format.
*
* @throws UnexpectedValueException
* @throws DomainException
* @since 1.7.3
*
* @return array
*/
public function getRepositoryList($owner, $repo, $sort =
'created', $direction = 'asc', JDate $since = null)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/comments';
if (false == in_array($sort, array('created',
'updated')))
{
throw new UnexpectedValueException(
sprintf(
'%1$s - sort field must be "created" or
"updated"', __METHOD__
)
);
}
if (false == in_array($direction, array('asc',
'desc')))
{
throw new UnexpectedValueException(
sprintf(
'%1$s - direction field must be "asc" or
"desc"', __METHOD__
)
);
}
$path .= '?sort=' . $sort;
$path .= '&direction=' . $direction;
if ($since)
{
$path .= '&since=' . $since->toISO8601();
}
// Send the request.
return
$this->processResponse($this->client->get($this->fetchUrl($path)));
}
/**
* Method to get a single comment.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $id The comment id.
*
* @return mixed
*/
public function get($owner, $repo, $id)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/comments/' . (int) $id;
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
/**
* Method to update a comment on an issue.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $commentId The id of the comment to update.
* @param string $body The new body text for the comment.
*
* @since 1.7.3
* @throws DomainException
*
* @return object
*/
public function edit($user, $repo, $commentId, $body)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/issues/comments/' . (int) $commentId;
// Build the request data.
$data = json_encode(
array(
'body' => $body,
)
);
// Send the request.
return $this->processResponse(
$this->client->patch($this->fetchUrl($path), $data)
);
}
/**
* Method to create a comment on an issue.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $issueId The issue number.
* @param string $body The comment body text.
*
* @throws DomainException
* @since 1.7.3
*
* @return object
*/
public function create($user, $repo, $issueId, $body)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/issues/' . (int) $issueId . '/comments';
// Build the request data.
$data = json_encode(
array(
'body' => $body,
)
);
// Send the request.
return $this->processResponse(
$this->client->post($this->fetchUrl($path), $data),
201
);
}
/**
* Method to delete a comment on an issue.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $commentId The id of the comment to delete.
*
* @throws DomainException
* @since 1.7.3
*
* @return boolean
*/
public function delete($user, $repo, $commentId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/issues/comments/' . (int) $commentId;
// Send the request.
$this->processResponse(
$this->client->delete($this->fetchUrl($path)),
204
);
return true;
}
}
PK�!�[��3Z�
�
events.phpnu�[���<?php
/**
* @package Joomla.Platform
* @subpackage GitHub
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* GitHub API Issues Events class for the Joomla Platform.
*
* Records various events that occur around an Issue or Pull Request.
* This is useful both for display on issue/pull request information pages
and also
* to determine who should be notified of comments.
*
* @documentation https://developer.github.com/v3/issues/events/
*
* @since 3.1.4
* @deprecated 4.0 Use the `joomla/github` package via Composer instead
*/
class JGithubPackageIssuesEvents extends JGithubPackage
{
/**
* List events for an issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $issueNumber The issue number.
* @param integer $page The page number from which to get
items.
* @param integer $limit The number of items on a page.
*
* @return object
*/
public function getList($owner, $repo, $issueNumber, $page = 0, $limit =
0)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . (int) $issueNumber . '/events';
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path, $page, $limit))
);
}
/**
* List events for a repository.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $issueId The issue number.
* @param integer $page The page number from which to get items.
* @param integer $limit The number of items on a page.
*
* @return object
*/
public function getListRepository($owner, $repo, $issueId, $page = 0,
$limit = 0)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . (int) $issueId . '/comments';
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path, $page, $limit))
);
}
/**
* Get a single event.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $id The event number.
*
* @return object
*/
public function get($owner, $repo, $id)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/events/' . (int) $id;
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
}
PK�!�[�l���
labels.phpnu�[���<?php
/**
* @package Joomla.Platform
* @subpackage GitHub
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* GitHub API Milestones class for the Joomla Platform.
*
* @documentation https://developer.github.com/v3/issues/labels/
*
* @since 3.1.4
* @deprecated 4.0 Use the `joomla/github` package via Composer instead
*/
class JGithubPackageIssuesLabels extends JGithubPackage
{
/**
* Method to get the list of labels on a repo.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
*
* @throws DomainException
* @since 3.1.4
*
* @return array
*/
public function getList($owner, $repo)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/labels';
// Send the request.
return $this->processResponse(
$response = $this->client->get($this->fetchUrl($path))
);
}
/**
* Method to get a specific label on a repo.
*
* @param string $user The name of the owner of the GitHub repository.
* @param string $repo The name of the GitHub repository.
* @param string $name The label name to get.
*
* @throws DomainException
* @since 3.1.4
*
* @return object
*/
public function get($user, $repo, $name)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/labels/' . $name;
// Send the request.
return $this->processResponse(
$response = $this->client->get($this->fetchUrl($path))
);
}
/**
* Method to create a label on a repo.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $name The label name.
* @param string $color The label color.
*
* @throws DomainException
* @since 3.1.4
*
* @return object
*/
public function create($owner, $repo, $name, $color)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/labels';
// Build the request data.
$data = json_encode(
array(
'name' => $name,
'color' => $color,
)
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
/**
* Method to update a label on a repo.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $label The label name.
* @param string $name The new label name.
* @param string $color The new label color.
*
* @throws DomainException
* @since 3.1.4
*
* @return object
*/
public function update($user, $repo, $label, $name, $color)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/labels/' . $label;
// Build the request data.
$data = json_encode(
array(
'name' => $name,
'color' => $color,
)
);
// Send the request.
return $this->processResponse(
$this->client->patch($this->fetchUrl($path), $data)
);
}
/**
* Method to delete a label on a repo.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $name The label name.
*
* @throws DomainException
* @return object
*
* @since 3.1.4
*/
public function delete($owner, $repo, $name)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/labels/' . $name;
// Send the request.
return $this->processResponse(
$this->client->delete($this->fetchUrl($path)),
204
);
}
/**
* List labels on an issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $number The issue number.
*
* @since 3.3 (CMS)
*
* @return object
*/
public function getListByIssue($owner, $repo, $number)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . $number . '/labels';
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
/**
* Add labels to an issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $number The issue number.
* @param array $labels An array of labels to add.
*
* @since 3.3 (CMS)
*
* @return object
*/
public function add($owner, $repo, $number, array $labels)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . $number . '/labels';
// Send the request.
return $this->processResponse(
$this->client->post($this->fetchUrl($path),
json_encode($labels))
);
}
/**
* Remove a label from an issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $number The issue number.
* @param string $name The name of the label to remove.
*
* @since 3.3 (CMS)
*
* @return object
*/
public function removeFromIssue($owner, $repo, $number, $name)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . $number . '/labels/' . $name;
// Send the request.
return $this->processResponse(
$this->client->delete($this->fetchUrl($path))
);
}
/**
* Replace all labels for an issue.
*
* Sending an empty array ([]) will remove all Labels from the Issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $number The issue number.
* @param array $labels New labels
*
* @since 3.3 (CMS)
*
* @return object
*/
public function replace($owner, $repo, $number, array $labels)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . $number . '/labels';
// Send the request.
return $this->processResponse(
$this->client->put($this->fetchUrl($path),
json_encode($labels))
);
}
/**
.* Remove all labels from an issue.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $number The issue number.
*
* @since 3.3 (CMS)
*
* @return object
*/
public function removeAllFromIssue($owner, $repo, $number)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/issues/' . $number . '/labels';
// Send the request.
return $this->processResponse(
$this->client->delete($this->fetchUrl($path)),
204
);
}
/**
* Get labels for every issue in a milestone.
*
* @param string $owner The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $number The issue number.
*
* @since 3.3 (CMS)
*
* @return object
*/
public function getListByMilestone($owner, $repo, $number)
{
// Build the request path.
$path = '/repos/' . $owner . '/' . $repo .
'/milestones/' . $number . '/labels';
// Send the request.
return $this->processResponse(
$this->client->get($this->fetchUrl($path))
);
}
}
PK�!�[�W���milestones.phpnu�[���<?php
/**
* @package Joomla.Platform
* @subpackage GitHub
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* GitHub API Milestones class for the Joomla Platform.
*
* @documentation https://developer.github.com/v3/issues/milestones/
*
* @since 3.1.4
* @deprecated 4.0 Use the `joomla/github` package via Composer instead
*/
class JGithubPackageIssuesMilestones extends JGithubPackage
{
/**
* Method to get the list of milestones for a repo.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param string $state The milestone state to retrieved. Open
(default) or closed.
* @param string $sort Sort can be due_date (default) or
completeness.
* @param string $direction Direction is asc or desc (default).
* @param integer $page The page number from which to get items.
* @param integer $limit The number of items on a page.
*
* @throws DomainException
* @since 3.1.4
*
* @return array
*/
public function getList($user, $repo, $state = 'open', $sort =
'due_date', $direction = 'desc', $page = 0, $limit = 0)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/milestones?';
$path .= 'state=' . $state;
$path .= '&sort=' . $sort;
$path .= '&direction=' . $direction;
// Send the request.
$response = $this->client->get($this->fetchUrl($path, $page,
$limit));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
/**
* Method to get a specific milestone.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $milestoneId The milestone id to get.
*
* @throws DomainException
* @return object
*
* @since 3.1.4
*/
public function get($user, $repo, $milestoneId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/milestones/' . (int) $milestoneId;
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
/**
* Method to create a milestone for a repository.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $title The title of the milestone.
* @param string $state Can be open (default) or closed.
* @param string $description Optional description for milestone.
* @param string $dueOn Optional ISO 8601 time.
*
* @throws DomainException
* @return object
*
* @since 3.1.4
*/
public function create($user, $repo, $title, $state = null, $description =
null, $dueOn = null)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/milestones';
// Build the request data.
$data = array(
'title' => $title,
);
if (!is_null($state))
{
$data['state'] = $state;
}
if (!is_null($description))
{
$data['description'] = $description;
}
if (!is_null($dueOn))
{
$data['due_on'] = $dueOn;
}
$data = json_encode($data);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
/**
* Method to update a milestone.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $milestoneId The id of the comment to update.
* @param integer $title Optional title of the milestone.
* @param string $state Can be open (default) or closed.
* @param string $description Optional description for milestone.
* @param string $dueOn Optional ISO 8601 time.
*
* @throws DomainException
* @return object
*
* @since 3.1.4
*/
public function edit($user, $repo, $milestoneId, $title = null, $state =
null, $description = null, $dueOn = null)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/milestones/' . (int) $milestoneId;
// Build the request data.
$data = array();
if (!is_null($title))
{
$data['title'] = $title;
}
if (!is_null($state))
{
$data['state'] = $state;
}
if (!is_null($description))
{
$data['description'] = $description;
}
if (!is_null($dueOn))
{
$data['due_on'] = $dueOn;
}
$data = json_encode($data);
// Send the request.
$response = $this->client->patch($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
/**
* Method to delete a milestone.
*
* @param string $user The name of the owner of the GitHub
repository.
* @param string $repo The name of the GitHub repository.
* @param integer $milestoneId The id of the milestone to delete.
*
* @throws DomainException
* @return void
*
* @since 3.1.4
*/
public function delete($user, $repo, $milestoneId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo .
'/milestones/' . (int) $milestoneId;
// Send the request.
$response = $this->client->delete($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 204)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
}
}
PK�!�[�N&]]
assignees.phpnu�[���PK�!�[(bOS
�comments.phpnu�[���PK�!�[��3Z�
�
�events.phpnu�[���PK�!�[�l���
�)labels.phpnu�[���PK�!�[�W����Hmilestones.phpnu�[���PK{�b