PHP Class Fragen\GitHub_Updater\GitLab_API

Get remote data from a GitLab repo.
Author: Andy Fragen
Inheritance: extends API
Show file Open project: afragen/github-updater

Protected Properties

Property Type Description
$method null Holds loose class method name.

Public Methods

Method Description
__construct ( object $type ) Constructor.
construct_download_link ( boolean $rollback = false, boolean $branch_switch = false ) : string Construct $this->type->download_link using GitLab API.
get_gitlab_id ( ) : string | integer Get GitLab project ID and project meta.
get_language_pack ( array $headers ) : boolean Get/process Language Packs.
get_remote_branches ( ) : boolean Create array of branches and download links as array.
get_remote_changes ( $changes ) : boolean Read the remote CHANGES.md file.
get_remote_info ( $file ) : boolean Read the remote file and parse headers.
get_remote_readme ( ) : boolean Read and parse remote readme.txt.
get_remote_tag ( ) : boolean Get remote info for tags.
get_repo_meta ( ) : boolean Read the repository meta from API.

Protected Methods

Method Description
add_endpoints ( $git, $endpoint ) : string Create GitLab API endpoints.
parse_changelog_response ( object $response ) : array | object Parse API response and return array with changelog in base64.
parse_meta_response ( object $response ) : array Parse API response and return array of meta variables.
parse_tag_response ( object | array $response ) : object | array Parse API response call and return only array of tag numbers.

Private Methods

Method Description
add_access_token_endpoint ( $git, $endpoint ) : string Add appropriate access token to endpoint.

Method Details

__construct() public method

Constructor.
public __construct ( object $type )
$type object

add_endpoints() protected method

Create GitLab API endpoints.
protected add_endpoints ( $git, $endpoint ) : string
$git object
$endpoint string
return string

get_gitlab_id() public method

Get GitLab project ID and project meta.
public get_gitlab_id ( ) : string | integer
return string | integer

get_language_pack() public method

Language Packs cannot reside on GitLab CE/Enterprise.
public get_language_pack ( array $headers ) : boolean
$headers array Array of headers of Language Pack.
return boolean When invalid response.

get_remote_branches() public method

Create array of branches and download links as array.
public get_remote_branches ( ) : boolean
return boolean

get_remote_changes() public method

Read the remote CHANGES.md file.
public get_remote_changes ( $changes ) : boolean
$changes
return boolean

get_remote_info() public method

Read the remote file and parse headers.
public get_remote_info ( $file ) : boolean
$file
return boolean

get_remote_readme() public method

Read and parse remote readme.txt.
public get_remote_readme ( ) : boolean
return boolean

get_remote_tag() public method

Get remote info for tags.
public get_remote_tag ( ) : boolean
return boolean

get_repo_meta() public method

Read the repository meta from API.
public get_repo_meta ( ) : boolean
return boolean

parse_changelog_response() protected method

Parse API response and return array with changelog in base64.
protected parse_changelog_response ( object $response ) : array | object
$response object Response from API call.
return array | object $arr Array of changes in base64, object if error.

parse_meta_response() protected method

Parse API response and return array of meta variables.
protected parse_meta_response ( object $response ) : array
$response object Response from API call.
return array $arr Array of meta variables.

parse_tag_response() protected method

Parse API response call and return only array of tag numbers.
protected parse_tag_response ( object | array $response ) : object | array
$response object | array Response from API call for tags.
return object | array Array of tag numbers, object is error.

Property Details

$method protected static property

Holds loose class method name.
protected static null $method
return null