phpBB API Documentation
Class

phpbb\composer\installer

class installer

Class to install packages through composer while freezing core dependencies.

Constants

PHPBB_TYPES

Methods

__construct(string $root_path, filesystem $filesystem, request $request, config $config = null)

install(array $packages, array $whitelist, IOInterface $io = null)

Update the current installed set of packages

array get_installed_packages(string|array $types)

Returns the list of currently installed packages

array get_available_packages(string $type)

Gets the list of the available packages of the configured type in the configured repositories

bool check_requirements()

Checks the requirements of the manager and returns true if it can be used.

set_repositories(array $repositories)

Sets the customs repositories

set_packagist(boolean $packagist)

Allow or disallow packagist

set_composer_filename(string $composer_filename)

Sets the name of the managed packages' json file

set_packages_vendor_dir(string $packages_vendor_dir)

Sets the location of the managed packages' vendors

set_root_path(string $root_path)

Sets the phpBB root path

Details

at line 92
public __construct(string $root_path, filesystem $filesystem, request $request, config $config = null)

Parameters

string $root_path phpBB root path
filesystem $filesystem Filesystem object
request $request phpBB request object
config $config Config object

at line 125
public install(array $packages, array $whitelist, IOInterface $io = null)

Update the current installed set of packages

Parameters

array $packages Packages to install. Each entry may be a name or an array associating a version constraint to a name
array $whitelist White-listed packages (packages that can be installed/updated/removed)
IOInterface $io IO object used for the output

Exceptions

runtime_exception

at line 201
public array get_installed_packages(string|array $types)

Returns the list of currently installed packages

Parameters

string|array $types Returns only the packages with the given type(s)

Return Value

array The installed packages associated to their version.

Exceptions

runtime_exception

at line 261
public array get_available_packages(string $type)

Gets the list of the available packages of the configured type in the configured repositories

/!\ Doesn't change the current working directory

Parameters

string $type Returns only the packages with the given type

Return Value

array The name of the available packages, associated to their definition. Ordered by name.

Exceptions

runtime_exception

at line 403
public bool check_requirements()

Checks the requirements of the manager and returns true if it can be used.

Return Value

bool

at line 617
public set_repositories(array $repositories)

Sets the customs repositories

Parameters

array $repositories An array of composer repositories to use

at line 627
public set_packagist(boolean $packagist)

Allow or disallow packagist

Parameters

boolean $packagist

at line 637
public set_composer_filename(string $composer_filename)

Sets the name of the managed packages' json file

Parameters

string $composer_filename

at line 647
public set_packages_vendor_dir(string $packages_vendor_dir)

Sets the location of the managed packages' vendors

Parameters

string $packages_vendor_dir

at line 657
public set_root_path(string $root_path)

Sets the phpBB root path

Parameters

string $root_path