class extension_manager extends manager

Class to safely manage extensions through composer.

Properties

protected installer $installer from  manager
protected driver_interface $cache from  manager
protected string $package_type from  manager
protected string $exception_prefix from  manager
protected manager $extension_manager
protected filesystem $filesystem
protected string $root_path

Methods

__construct(installer $installer, driver_interface $cache, manager $extension_manager, filesystem $filesystem, string $package_type, string $exception_prefix, string $root_path, config $config = null)

No description

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

Installs (if necessary) a set of packages

from  manager
pre_install(array $packages, IOInterface $io = null)

Hook called before installing the packages

post_install(array $packages, IOInterface $io = null)

Hook called after installing the packages

update(array $packages, IOInterface $io = null)

Updates or installs a set of packages

from  manager
pre_update(array $packages, IOInterface $io = null)

Hook called before updating the packages

post_update(array $packages, IOInterface $io = null)

Hook called after updating the packages

remove(array $packages, IOInterface $io = null)

Removes a set of packages

pre_remove(array $packages, IOInterface $io = null)

Hook called before removing the packages

post_remove(array $packages, IOInterface $io = null)

Hook called after removing the packages

from  manager
bool
is_managed($package)

Tells whether or not a package is managed by Composer.

from  manager
array
get_managed_packages()

Returns the list of managed packages for the current type

from  manager
array
get_all_managed_packages()

Returns the list of managed packages for all phpBB types

from  manager
array
get_available_packages()

Returns the list of available packages

from  manager
reset_cache()

Reset the cache

from  manager
start_managing(string $package, IOInterface $io)

Start managing a manually installed package

bool
check_requirements()

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

array
normalize_version(array $packages)

Normalize a packages/version array. Every entry can have 3 different forms:

  • $package => $version
  • $indice => $package:$version
  • $indice => $package They are converted to he form:
  • $package => $version ($version is set to '*' for the third form)

from  manager
set_enable_on_install(bool $enable)

Enable the extensions when installing

set_purge_on_remove(bool $purge)

Purge the extension when disabling it

Details

at line 71
__construct(installer $installer, driver_interface $cache, manager $extension_manager, filesystem $filesystem, string $package_type, string $exception_prefix, string $root_path, config $config = null)

No description

Parameters

installer $installer

Installer object

driver_interface $cache

Cache object

manager $extension_manager

phpBB extension manager

filesystem $filesystem

Filesystem object

string $package_type

Composer type of managed packages

string $exception_prefix

Exception prefix to use

string $root_path

phpBB root path

config $config

Config object

in manager at line 77
install(array $packages, IOInterface $io = null)

Installs (if necessary) a 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

IOInterface $io

IO object used for the output

Exceptions

runtime_exception

at line 89
pre_install(array $packages, IOInterface $io = null)

Hook called before installing the packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

at line 101
post_install(array $packages, IOInterface $io = null)

Hook called after installing the packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

in manager at line 124
update(array $packages, IOInterface $io = null)

Updates or installs a 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

IOInterface $io

IO object used for the output

Exceptions

runtime_exception

at line 127
protected pre_update(array $packages, IOInterface $io = null)

Hook called before updating the packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

at line 155
protected post_update(array $packages, IOInterface $io = null)

Hook called after updating the packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

at line 178
remove(array $packages, IOInterface $io = null)

Removes a set of packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

Exceptions

runtime_exception

at line 194
pre_remove(array $packages, IOInterface $io = null)

Hook called before removing the packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

in manager at line 209
protected post_remove(array $packages, IOInterface $io = null)

Hook called after removing the packages

Parameters

array $packages

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

IOInterface $io

IO object used for the output

in manager at line 216
bool is_managed($package)

Tells whether or not a package is managed by Composer.

Parameters

$package

Return Value

bool

in manager at line 224
array get_managed_packages()

Returns the list of managed packages for the current type

Return Value

array

The managed packages associated to their version.

in manager at line 237
array get_all_managed_packages()

Returns the list of managed packages for all phpBB types

Return Value

array

The managed packages associated to their version.

in manager at line 250
array get_available_packages()

Returns the list of available packages

Return Value

array

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

in manager at line 269
reset_cache()

Reset the cache

at line 231
start_managing(string $package, IOInterface $io)

Start managing a manually installed package

Remove a package installed manually and reinstall it using composer.

Parameters

string $package

Package to manage

IOInterface $io

IO object used for the output

Exceptions

runtime_exception

at line 295
bool check_requirements()

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

Return Value

bool

in manager at line 306
protected array normalize_version(array $packages)

Normalize a packages/version array. Every entry can have 3 different forms:

  • $package => $version
  • $indice => $package:$version
  • $indice => $package They are converted to he form:
  • $package => $version ($version is set to '*' for the third form)

Parameters

array $packages

Return Value

array

at line 307
set_enable_on_install(bool $enable)

Enable the extensions when installing

Warning: Only the explicitly required extensions will be enabled

Parameters

bool $enable

at line 317
set_purge_on_remove(bool $purge)

Purge the extension when disabling it

Parameters

bool $purge