Documentation

Composer
in package
Uses SystemCall

Tags
author

Michael Slusarz slusarz@horde.org

author

Ralf Lang lang@horde.org

category

Horde

copyright

2013-2019 Horde LLC

license

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

Table of Contents

$_composerRepo  : string
$_composerVersion  : string
$_gitRepoBase  : mixed
$_repositories  : array<string|int, mixed>
$_substitutes  : array<string|int, mixed>
$_vendor  : mixed
_setProvides()  : void
Turn a provides: block in yml into a composer.json provide: block
detectComposerBin()  : string
Check some well known locations, fallback to which
generateComposerJson()  : string
Updates the composer.json file.
pretend()  : bool
setDependency()  : void
Make composer add a dependency, dev dependency or suggestion
setMinimumStability()  : mixed
update()  : void
Update the lock file and install dependencies
_addPearRepo()  : void
_handleVersion()  : void
_setAuthors()  : void
_setAutoload()  : void
Configure Autoloading
_setAutoloadDev()  : void
Configure Autoloading
_setConfig()  : void
_setDevRequire()  : void
Handle .horde.yml dev dependencies
_setName()  : void
_setRepositories()  : void
_setRequire()  : void
Convert .horde.yml requirements to composer format
_setSuggest()  : void
Convert .horde.yml suggestions to composer format
_setType()  : void
_setVendorBin()  : void
Build a list of commands which should be exposed to vendor/bin.
_substitute()  : bool
exec()  : SystemCallResult
Run a system call and capture output.
execInDirectory()  : SystemCallResult
Run a system call in a given dir and capture output.
system()  : string
Run a system call.
systemInDirectory()  : string
Run a system call.

Properties

$_composerRepo

protected string $_composerRepo = ''

Govern which repos to add to the composer file use 'vcs' for an individual git repo per horde dependency use 'satis:https://url' for a single composer repo source leave empty for no custom repos

$_composerVersion

protected string $_composerVersion = ''

Amend horde dependency versions

$_gitRepoBase

protected mixed $_gitRepoBase = ''

$_repositories

protected array<string|int, mixed> $_repositories = []

A list of repositories to add as sources for dependencies

$_substitutes

protected array<string|int, mixed> $_substitutes = []

A list of pear packages to replace by known alternatives

Methods

_setProvides()

Turn a provides: block in yml into a composer.json provide: block

public _setProvides(HordeYml $package, stdClass $composerDefinition) : void
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

detectComposerBin()

Check some well known locations, fallback to which

public detectComposerBin() : string
Tags
throws
RuntimeException
Return values
string

Fully qualified location of git command

generateComposerJson()

Updates the composer.json file.

public generateComposerJson(HordeYml $package[, array<string|int, mixed> $options = [] ]) : string
Parameters
$package : HordeYml

The package definition

$options : array<string|int, mixed> = []

The set of options for the operation.

Return values
string

The composer.json file

pretend()

public pretend() : bool
Return values
bool

setDependency()

Make composer add a dependency, dev dependency or suggestion

public setDependency(string $packageDir, string $package[, string $versionConstraint = '*' ][, mixed $type = 'require' ]) : void

This will not install the package or check if it works on the development platform This will not touch the horde metadata file.

Parameters
$packageDir : string
$package : string
$versionConstraint : string = '*'
$type : mixed = 'require'
Return values
void

setMinimumStability()

public setMinimumStability(string $packageDir, string $stability) : mixed
Parameters
$packageDir : string
$stability : string
Return values
mixed

update()

Update the lock file and install dependencies

public update(string $packageDir[, string $constraint = '' ]) : void

Implicitly updates autoloader

Parameters
$packageDir : string
$constraint : string = ''
Return values
void

_addPearRepo()

protected _addPearRepo(mixed $pear) : void
Parameters
$pear : mixed
Return values
void

_handleVersion()

protected _handleVersion(mixed $version, mixed &$stack, mixed $type, mixed $repo, mixed $basename[, mixed $vendor = '' ]) : void
Parameters
$version : mixed
$stack : mixed
$type : mixed
$repo : mixed
$basename : mixed
$vendor : mixed = ''
Return values
void

_setAuthors()

protected _setAuthors(HordeYml $package, stdClass $composerDefinition) : void
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setAutoload()

Configure Autoloading

protected _setAutoload(HordeYml $package, stdClass $composerDefinition) : void

The default is to autoload both PSR-0 and PSR-4 if no rule is found

Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setAutoloadDev()

Configure Autoloading

protected _setAutoloadDev(HordeYml $package, stdClass $composerDefinition) : void

The default is to autoload both PSR-0 and PSR-4 if no rule is found

Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setConfig()

protected _setConfig(HordeYml $package, stdClass $composerDefinition) : void
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setDevRequire()

Handle .horde.yml dev dependencies

protected _setDevRequire(HordeYml $package, stdClass $composerDefinition) : void

No known pear equivalent, this is composer-only We still require the composer: key for consistency with optional

Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setName()

protected _setName(HordeYml $package, stdClass $composerDefinition) : void
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setRepositories()

protected _setRepositories(HordeYml $package, stdClass $composerDefinition) : void
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setRequire()

Convert .horde.yml requirements to composer format

protected _setRequire(HordeYml $package, stdClass $composerDefinition) : void

References to the horde pear channel will be changed to composer Depending on options, assume horde packages live on either

  • packagist/default repo
  • a satis repo
  • individual git repos
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setSuggest()

Convert .horde.yml suggestions to composer format

protected _setSuggest(HordeYml $package, stdClass $composerDefinition) : void

References to the horde pear channel will be changed to composer vcs/github

Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setType()

protected _setType(HordeYml $package, stdClass $composerDefinition) : void
Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_setVendorBin()

Build a list of commands which should be exposed to vendor/bin.

protected _setVendorBin(HordeYml $package, stdClass $composerDefinition) : void

Default to all direct executable files of bindir Otherwise use provided whitelist "commands" and blacklist "nocommands" (blacklist wins)

Parameters
$package : HordeYml
$composerDefinition : stdClass
Return values
void

_substitute()

protected _substitute(mixed $pear, mixed $version, mixed &$stack) : bool
Parameters
$pear : mixed
$version : mixed
$stack : mixed
Return values
bool

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.

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