Composer API
Class

Composer\Installer\InstallationManager

class InstallationManager

Package operation manager.

Methods

reset()

addInstaller(InstallerInterface $installer)

Adds installer

removeInstaller(InstallerInterface $installer)

Removes installer

disablePlugins()

Disables plugins.

InstallerInterface getInstaller(string $type)

Returns installer for a specific package type.

bool isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)

Checks whether provided package is installed in one of the registered installers.

ensureBinariesPresence(PackageInterface $package)

Install binary for the given package.

execute(RepositoryInterface $repo, OperationInterface $operation)

Executes solver operation.

install(RepositoryInterface $repo, InstallOperation $operation)

Executes install operation.

update(RepositoryInterface $repo, UpdateOperation $operation)

Executes update operation.

uninstall(RepositoryInterface $repo, UninstallOperation $operation)

Uninstalls package.

markAliasInstalled(RepositoryInterface $repo, MarkAliasInstalledOperation $operation)

Executes markAliasInstalled operation.

markAliasUninstalled(RepositoryInterface $repo, MarkAliasUninstalledOperation $operation)

Executes markAlias operation.

string getInstallPath(PackageInterface $package)

Returns the installation path of a package

notifyInstalls(IOInterface $io)

Details

at line 41
public reset()

at line 51
public addInstaller(InstallerInterface $installer)

Adds installer

Parameters

InstallerInterface $installer installer instance

at line 62
public removeInstaller(InstallerInterface $installer)

Removes installer

Parameters

InstallerInterface $installer installer instance

at line 77
public disablePlugins()

Disables plugins.

We prevent any plugins from being instantiated by simply deactivating the installer for them. This ensure that no third-party code is ever executed.

at line 96
public InstallerInterface getInstaller(string $type)

Returns installer for a specific package type.

Parameters

string $type package type

Return Value

InstallerInterface

Exceptions

InvalidArgumentException if installer for provided type is not registered

at line 121
public bool isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)

Checks whether provided package is installed in one of the registered installers.

Parameters

InstalledRepositoryInterface $repo repository in which to check
PackageInterface $package package instance

Return Value

bool

at line 136
public ensureBinariesPresence(PackageInterface $package)

Install binary for the given package.

If the installer associated to this package doesn't handle that function, it'll do nothing.

Parameters

PackageInterface $package Package instance

at line 157
public execute(RepositoryInterface $repo, OperationInterface $operation)

Executes solver operation.

Parameters

RepositoryInterface $repo repository in which to check
OperationInterface $operation operation instance

at line 169
public install(RepositoryInterface $repo, InstallOperation $operation)

Executes install operation.

Parameters

RepositoryInterface $repo repository in which to check
InstallOperation $operation operation instance

at line 183
public update(RepositoryInterface $repo, UpdateOperation $operation)

Executes update operation.

Parameters

RepositoryInterface $repo repository in which to check
UpdateOperation $operation operation instance

at line 207
public uninstall(RepositoryInterface $repo, UninstallOperation $operation)

Uninstalls package.

Parameters

RepositoryInterface $repo repository in which to check
UninstallOperation $operation operation instance

at line 220
public markAliasInstalled(RepositoryInterface $repo, MarkAliasInstalledOperation $operation)

Executes markAliasInstalled operation.

Parameters

RepositoryInterface $repo repository in which to check
MarkAliasInstalledOperation $operation operation instance

at line 235
public markAliasUninstalled(RepositoryInterface $repo, MarkAliasUninstalledOperation $operation)

Executes markAlias operation.

Parameters

RepositoryInterface $repo repository in which to check
MarkAliasUninstalledOperation $operation operation instance

at line 248
public string getInstallPath(PackageInterface $package)

Returns the installation path of a package

Parameters

PackageInterface $package

Return Value

string path

at line 255
public notifyInstalls(IOInterface $io)

Parameters

IOInterface $io