phpBB API Documentation
Class

phpbb\composer\extension_manager

class extension_manager extends manager

Class to safely manage extensions through composer.

Methods

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

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

Installs (if necessary) a set of packages

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

Updates or installs a set of packages

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

Removes a set of packages

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.

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

{@inheritdoc}

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

{@inheritdoc}

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

{@inheritdoc}

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 66
public __construct(installer $installer, driver_interface $cache, manager $extension_manager, filesystem $filesystem, string $package_type, string $exception_prefix, string $root_path, config $config = null)

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

in manager at line 124
public 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 173
public 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

in manager at line 216
public bool is_managed($package)

Tells whether or not a package is managed by Composer.

Parameters

$package

Return Value

bool

in manager at line 224
public 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
public 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
public 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
public reset_cache()

Reset the cache

at line 226
public 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 290
public bool check_requirements()

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

Return Value

bool

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

{@inheritdoc}

Parameters

array $packages
IOInterface $io

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

{@inheritdoc}

Parameters

array $packages
IOInterface $io

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

{@inheritdoc}

Parameters

array $packages
IOInterface $io

at line 302
public 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 312
public set_purge_on_remove(bool $purge)

Purge the extension when disabling it

Parameters

bool $purge