PHP Class Fragen\GitHub_Updater\API

Inheritance: extends Base
Datei anzeigen Open project: afragen/github-updater

Protected Properties

Property Type Description
$response array Variable to hold all repository remote info.

Public Methods

Method Description
construct_download_link ( )
get_language_pack ( $headers )
get_remote_branches ( )
get_remote_changes ( $changes )
get_remote_info ( $file ) * The following functions must be in any repository API.
get_remote_readme ( )
get_remote_tag ( )
get_repo_meta ( )
http_request_args ( array $args, string $url ) : array Adds custom user agent for GitHub Updater.
wp_update_response ( mixed $response, array $args, string $url ) : mixed Shiny updates results in the update transient being reset with only the wp.org data.

Protected Methods

Method Description
add_endpoints ( $git, $endpoint )
api ( string $url ) : boolean | object Call the API and return a json decoded body.
get_dot_org_data ( ) : array | boolean | mixed | string | WP_Error Query wp.org for plugin information.
get_transient ( ) : array | boolean Returns site_transient and checks/stores transient id in array.
make_release_asset_download_link ( ) : string Create release asset download link.
parse_changelog_response ( $response )
parse_meta_response ( $response )
parse_tag_response ( $response )
return_repo_type ( ) : array Return repo data for API calls.
set_transient ( string $id, mixed $response ) : boolean Used to set_site_transient and checks/stores transient id in array.
validate_response ( $response ) : boolean Validate wp_remote_get response.

Private Methods

Method Description
get_api_url ( string $endpoint ) : string Return API url.

Method Details

add_endpoints() abstract protected method

abstract protected add_endpoints ( $git, $endpoint )

api() protected method

Create error messages.
See also: http://developer.github.com/v3/
protected api ( string $url ) : boolean | object
$url string
return boolean | object

get_dot_org_data() protected method

Query wp.org for plugin information.
protected get_dot_org_data ( ) : array | boolean | mixed | string | WP_Error
return array | boolean | mixed | string | WP_Error

get_language_pack() abstract public method

abstract public get_language_pack ( $headers )

get_remote_branches() abstract public method

abstract public get_remote_branches ( )

get_remote_changes() abstract public method

abstract public get_remote_changes ( $changes )

get_remote_info() abstract public method

* The following functions must be in any repository API.
abstract public get_remote_info ( $file )

get_remote_readme() abstract public method

abstract public get_remote_readme ( )

get_remote_tag() abstract public method

abstract public get_remote_tag ( )

get_repo_meta() abstract public method

abstract public get_repo_meta ( )

get_transient() protected method

Returns site_transient and checks/stores transient id in array.
protected get_transient ( ) : array | boolean
return array | boolean

http_request_args() public static method

Adds custom user agent for GitHub Updater.
public static http_request_args ( array $args, string $url ) : array
$args array Existing HTTP Request arguments.
$url string URL being passed.
return array Amended HTTP Request arguments.

parse_changelog_response() abstract protected method

abstract protected parse_changelog_response ( $response )

parse_meta_response() abstract protected method

abstract protected parse_meta_response ( $response )

parse_tag_response() abstract protected method

abstract protected parse_tag_response ( $response )

return_repo_type() protected method

Return repo data for API calls.
protected return_repo_type ( ) : array
return array

set_transient() protected method

Used to set_site_transient and checks/stores transient id in array.
protected set_transient ( string $id, mixed $response ) : boolean
$id string Transient ID.
$response mixed Data to be stored.
return boolean

validate_response() protected method

Validate wp_remote_get response.
protected validate_response ( $response ) : boolean
$response
return boolean true if invalid

wp_update_response() public static method

This catches the response and reloads the transients.
public static wp_update_response ( mixed $response, array $args, string $url ) : mixed
$response mixed HTTP server response.
$args array HTTP response arguments.
$url string URL of HTTP response.
return mixed $response Just a pass through, no manipulation.

Property Details

$response protected_oe property

Variable to hold all repository remote info.
protected array $response
return array