PHP Класс Fragen\GitHub_Updater\Rest_Update

Updates a single plugin or theme, in a way suitable for rest requests. This class inherits from Base in order to be able to call the set_defaults function.
Наследование: extends Base
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$upgrader_skin Rest_Upgrader_Skin Holds REST Upgrader Skin.

Открытые методы

Метод Описание
__construct ( ) Constructor.
get_messages ( ) Get messages during update.
is_error ( ) Is there an error?
process_request ( ) Process request.
show_updates ( $response ) : mixed Return listing of available updates.
update_plugin ( string $plugin_slug, string $tag = 'master' ) Update plugin.
update_theme ( string $theme_slug, string $tag = 'master' ) Update a single theme.

Приватные методы

Метод Описание
get_webhook_data ( ) : boolean | array Checks the headers of the request and sends webhook data to be parsed.
parse_bitbucket_webhook ( array $request_data ) : boolean | array Parses Bitbucket webhook data.
parse_github_webhook ( array $request_data ) : array Parses GitHub webhook data.
parse_gitlab_webhook ( array $request_data ) : array Parses GitLab webhook data.

Описание методов

__construct() публичный метод

Constructor.
public __construct ( )

get_messages() публичный метод

Get messages during update.
public get_messages ( )

is_error() публичный метод

Is there an error?
public is_error ( )

process_request() публичный метод

Relies on data in $_REQUEST, prints out json and exits. If the request came through a webhook, and if the branch in the webhook matches the branch specified by the url, use the latest update available as specified in the webhook payload.
public process_request ( )

show_updates() публичный метод

Return listing of available updates.
public show_updates ( $response ) : mixed
$response
Результат mixed

update_plugin() публичный метод

Update plugin.
public update_plugin ( string $plugin_slug, string $tag = 'master' )
$plugin_slug string
$tag string

update_theme() публичный метод

Update a single theme.
public update_theme ( string $theme_slug, string $tag = 'master' )
$theme_slug string
$tag string

Описание свойств

$upgrader_skin защищенное свойство

Holds REST Upgrader Skin.
protected Rest_Upgrader_Skin,Fragen\GitHub_Updater $upgrader_skin
Результат Rest_Upgrader_Skin