class installer

Class to install packages through composer while freezing core dependencies.

Constants

PHPBB_TYPES

Properties

protected array $repositories
protected bool $packagist
protected string $composer_filename
protected string $packages_vendor_dir
protected string $minimum_stability
protected string $root_path

Methods

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

No description

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

Update the current installed set of packages

do_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
do_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

array
do_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.

generate_ext_json_file(array $packages)

Generates and write the json file used to install the set of packages

restore_ext_json_file()

Restore the json file overridden by generate_ext_json_file()

array
get_core_packages(Composer $composer)

Get the core installed packages

string
get_core_php_requirement(Composer $composer)

Get the PHP version required by the core

array
get_composer_repositories()

Generate the repositories entry of the packages json file

string
get_composer_ext_json_filename()

Get the name of the json file used for the packages.

array
get_extra_dependencies()

Get extra dependencies required to install the packages

set_repositories(array $repositories)

Sets the customs repositories

set_packagist(bool $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

move_to_root()

Change the current directory to phpBB root

restore_cwd()

Restore the current working directory if move_to_root() have been called

mixed
wrap(callable $callable)

Wraps a callable in order to adjust the context needed by composer

Details

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

No description

Parameters

string $root_path

phpBB root path

filesystem $filesystem

Filesystem object

request $request

phpBB request object

config $config

Config object

at line 133
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 152
protected do_install(array $packages, array $whitelist, IOInterface $io = null)

Update the current installed set of packages

/!\ Doesn't change the current working directory

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 213
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 229
protected array do_get_installed_packages(string|array $types)

Returns the list of currently installed packages

/!\ Doesn't change the current working directory

Parameters

string|array $types

Returns only the packages with the given type(s)

Return Value

array

The installed packages associated to their version.

at line 273
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 287
protected array do_get_available_packages(string $type)

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

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.

at line 415
bool check_requirements()

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

Return Value

bool

at line 477
protected generate_ext_json_file(array $packages)

Generates and write the json file used to install the set of packages

Parameters

array $packages

Packages to update. Each entry may be a name or an array associating a version constraint to a name

at line 525
protected restore_ext_json_file()

Restore the json file overridden by generate_ext_json_file()

at line 548
protected array get_core_packages(Composer $composer)

Get the core installed packages

Parameters

Composer $composer

Composer object to load the dependencies

Return Value

array

The core packages with their version

at line 569
protected string get_core_php_requirement(Composer $composer)

Get the PHP version required by the core

Parameters

Composer $composer

Composer object to load the dependencies

Return Value

string

The PHP version required by the core

at line 579
protected array get_composer_repositories()

Generate the repositories entry of the packages json file

Return Value

array

repositories entry

at line 608
protected string get_composer_ext_json_filename()

Get the name of the json file used for the packages.

Return Value

string

The json filename

at line 618
protected array get_extra_dependencies()

Get extra dependencies required to install the packages

Return Value

array

Array of composer dependencies

at line 628
set_repositories(array $repositories)

Sets the customs repositories

Parameters

array $repositories

An array of composer repositories to use

at line 638
set_packagist(bool $packagist)

Allow or disallow packagist

Parameters

bool $packagist

at line 648
set_composer_filename(string $composer_filename)

Sets the name of the managed packages' json file

Parameters

string $composer_filename

at line 658
set_packages_vendor_dir(string $packages_vendor_dir)

Sets the location of the managed packages' vendors

Parameters

string $packages_vendor_dir

at line 668
set_root_path(string $root_path)

Sets the phpBB root path

Parameters

string $root_path

at line 676
protected move_to_root()

Change the current directory to phpBB root

at line 688
protected restore_cwd()

Restore the current working directory if move_to_root() have been called

at line 704
protected mixed wrap(callable $callable)

Wraps a callable in order to adjust the context needed by composer

Parameters

callable $callable

Return Value

mixed