Menu

## ComposerManager
in package

ComposerManager.php : 19

Helps perform tasks with the composer configuration.

### Table of Contents

$composer : Composer|null
$cwd : string
__construct() : mixed
  Construct a manager with an optional working directory where composer.json lives.
findAutoloader() : string
  Returns a path (could be relative) to the proper autoload.php file in the current setup.
getComposer() : Composer
  Returns a Composer instance to perform underlying operations on. Be careful.
getModulePackages() : array<string|int, PackageInterface>
  Return a list of the configured packages which are LotGD modules (type = 'lotgd-module').
getPackageForLibrary() : CompletePackageInterface
  Return the Composer package for the corresponding library, in vendor/module format.
getPackages() : array<string|int, PackageInterface>
  Return all the packages installed in the current setup.
translateNamespaceToPath() : string|null
  Find the filesystem path where the code for a namespace can be found.

### Properties

#### $composer

ComposerManager.php : 21
`private Composer|null $composer = null`

#### $cwd

ComposerManager.php : 28
`private string $cwd`

### Methods

#### __construct()

ComposerManager.php : 28

Construct a manager with an optional working directory where composer.json lives.

`public __construct(string $cwd) : mixed`

##### Parameters

$cwd : string

##### Return values

mixed —

#### findAutoloader()

ComposerManager.php : 150

Returns a path (could be relative) to the proper autoload.php file in the current setup.

`public findAutoloader() : string`

##### Return values

string —

#### getComposer()

ComposerManager.php : 34

Returns a Composer instance to perform underlying operations on. Be careful.

`public getComposer() : Composer`

##### Return values

Composer —

An instance of Composer.

#### getModulePackages()

ComposerManager.php : 84

Return a list of the configured packages which are LotGD modules (type = 'lotgd-module').

`public getModulePackages() : array<string|int, PackageInterface>`

##### Return values

array<string|int, PackageInterface> —

#### getPackageForLibrary()

ComposerManager.php : 56

Return the Composer package for the corresponding library, in vendor/module format.

`public getPackageForLibrary(string $library) : CompletePackageInterface`

##### Parameters

$library : string

##### Tags

throws
  LibraryDoesNotExistException

##### Return values

CompletePackageInterface —

Package corresponding to this library.

#### getPackages()

ComposerManager.php : 72

Return all the packages installed in the current setup.

`public getPackages() : array<string|int, PackageInterface>`

##### Return values

array<string|int, PackageInterface> —

#### translateNamespaceToPath()

ComposerManager.php : 103

Find the filesystem path where the code for a namespace can be found.

`public translateNamespaceToPath(string $namespace) : string|null`

##### Parameters

$namespace : string

  The namespace to translate.

##### Return values

string|null —

Path representing $namespace or null if $namespace cannot be found or if the path does not exist.

## Search results