Documentation

Packagist extends Base
in package

Components_Release_Task_Packagist:: Notify Packagist of update

Copyright 2011-2019 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
category

Horde

author

Ralf Lang lang@b1-systems.de

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

link
https://packagist.org/about#how-to-update-packages

Table of Contents

$_component  : Source
The component that should be released
$_deps  : mixed
$_name  : string
The task name.
$_notes  : Notes
$_output  : Output
$_tasks  : Tasks
__construct()  : mixed
Constructor.
askDependencies()  : array<string|int, mixed>
Ask for the \Horde_Http_Client dependency
getDependency()  : object|null
Retrieve a dependency
getName()  : string
Get the name of this task.
postValidate()  : array<string|int, mixed>
Validate the postconditions required for this release task to have succeeded.
pretend()  : bool
preValidate()  : array<string|int, mixed>
Validate if we can make a valid request
run()  : void
Run the task.
setComponent()  : void
Set the component this task should act upon.
setDependencies()  : void
Receive dependencies
setName()  : void
Set the name of this task.
skip()  : bool
Can the task be skipped?
_options()  : array<string|int, mixed>
Ensure default and required options
_verifyPackageExists()  : bool
Ensure packagist has the package we want to nudge an update for
exec()  : SystemCallResult
Run a system call and capture output.
execInDirectory()  : SystemCallResult
Run a system call in a given dir and capture output.
getComponent()  : Source
Get the component this task should act upon.
getNotes()  : Notes
Get the release notes.
getOutput()  : Output
Get the output handler.
getTasks()  : Tasks
Get the tasks handler.
system()  : string
Run a system call.
systemInDirectory()  : string
Run a system call.

Properties

$_component

The component that should be released

protected Source $_component

$_name

The task name.

protected string $_name

Methods

__construct()

Constructor.

public __construct(Tasks $_tasks, Notes $_notes, Output $_output) : mixed
Parameters
$_tasks : Tasks

The task handler.

$_notes : Notes

The release notes.

$_output : Output

Accepts output.

Return values
mixed

askDependencies()

Ask for the \Horde_Http_Client dependency

public askDependencies() : array<string|int, mixed>
Return values
array<string|int, mixed>

The list of dependencies requested

getDependency()

Retrieve a dependency

public getDependency(string $key) : object|null

It must have been registered by askDependencies and the calling code should provide it or null

Parameters
$key : string

The dependency to get.

Return values
object|null

The dependency or null

getName()

Get the name of this task.

public getName() : string
Return values
string

The task name.

postValidate()

Validate the postconditions required for this release task to have succeeded.

public postValidate(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
array<string|int, mixed>

An empty array if all postconditions are met and a list of error messages otherwise.

pretend()

public pretend() : bool
Return values
bool

preValidate()

Validate if we can make a valid request

public preValidate(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
array<string|int, mixed>

An empty array if all preconditions are met and a list of error messages otherwise.

run()

Run the task.

public run(array<string|int, mixed> &$options) : void

Checkout the wanted branch Supports pretend mode

Parameters
$options : array<string|int, mixed>

Additional options by reference.

Return values
void

setComponent()

Set the component this task should act upon.

public setComponent(Source $component) : void
Parameters
$component : Source

The component to be released.

Return values
void

setDependencies()

Receive dependencies

public setDependencies(array<string|int, mixed> $dependencies) : void

The format contains the same keys ad askDependencies, but the values are instances of the requested types or null if unfulfilled.

Parameters
$dependencies : array<string|int, mixed>

The provided dependencies.

Return values
void

setName()

Set the name of this task.

public setName(string $name) : void
Parameters
$name : string

The task name.

Return values
void

skip()

Can the task be skipped?

public skip(array<string|int, mixed> $options) : bool
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
bool

True if it can be skipped.

_options()

Ensure default and required options

protected _options(array<string|int, mixed> $options) : array<string|int, mixed>
  • vendor defaults to horde
  • packagist_api_key defaults to empty
  • packagist_user defaults to empty
  • packagist_url defaults to https://packagist.org
Parameters
$options : array<string|int, mixed>

Additional options.

Return values
array<string|int, mixed>

The processed options

_verifyPackageExists()

Ensure packagist has the package we want to nudge an update for

protected _verifyPackageExists(array<string|int, mixed> $options, Base $package) : bool

Packagist has a published method for receiving update hints but there is no published way of programmatically adding packages

Parameters
$options : array<string|int, mixed>

Additional options.

$package : Base

The package to check

Return values
bool

True if the package exists

execInDirectory()

Run a system call in a given dir and capture output.

protected execInDirectory(string $call, string $target_dir) : SystemCallResult
Parameters
$call : string

The system call to execute.

$target_dir : string

Run the command in the provided target path.

Return values
SystemCallResult

The command output.

getComponent()

Get the component this task should act upon.

protected getComponent() : Source
Return values
Source

The component to be released.

getNotes()

Get the release notes.

protected getNotes() : Notes
Return values
Notes

The release notes.

getOutput()

Get the output handler.

protected getOutput() : Output
Return values
Output

The output handler.

getTasks()

Get the tasks handler.

protected getTasks() : Tasks
Return values
Tasks

The release tasks handler.

system()

Run a system call.

protected system(string $call) : string
Parameters
$call : string

The system call to execute.

Return values
string

The command output.

systemInDirectory()

Run a system call.

protected systemInDirectory(string $call, string $target_dir) : string
Parameters
$call : string

The system call to execute.

$target_dir : string

Run the command in the provided target path.

Return values
string

The command output.

Search results