PHP Interface Puli\Manager\Api\Module\ModuleManager

Since: 1.0
Author: Bernhard Schussek ([email protected])
Afficher le fichier Open project: puli/manager Interface Usage Examples

Méthodes publiques

Méthode Description
clearModules ( ) Removes all modules.
findModules ( Webmozart\Expression\Expression $expr ) : ModuleList Returns all modules matching the given expression.
getContext ( ) : Puli\Manager\Api\Context\ProjectContext Returns the manager's context.
getModule ( string $name ) : Puli\Manager\Api\Module\Module Returns a module by name.
getModules ( ) : ModuleList Returns all installed modules.
getRootModule ( ) : Puli\Manager\Api\Module\RootModule Returns the root module.
hasModule ( string $name ) : boolean Returns whether the manager has the module with the given name.
hasModules ( Webmozart\Expression\Expression $expr = null ) : boolean Returns whether the manager has any modules.
installModule ( string $installPath, string | null $name = null, string $installerName = InstallInfo::DEFAULT_INSTALLER_NAME, string $env = Environment::PROD ) Installs the module at the given path in the repository.
removeModule ( string $name ) Removes the module with the given name.
removeModules ( Webmozart\Expression\Expression $expr ) Removes all modules matching the given expression.
renameModule ( string $name, string $newName ) Renames the module with the given name.

Method Details

clearModules() public méthode

If matching modules are found, this method does nothing.
public clearModules ( )

findModules() public méthode

Returns all modules matching the given expression.
public findModules ( Webmozart\Expression\Expression $expr ) : ModuleList
$expr Webmozart\Expression\Expression The search criteria.
Résultat ModuleList The modules matching the expression.

getContext() public méthode

Returns the manager's context.
public getContext ( ) : Puli\Manager\Api\Context\ProjectContext
Résultat Puli\Manager\Api\Context\ProjectContext The project context.

getModule() public méthode

Returns a module by name.
public getModule ( string $name ) : Puli\Manager\Api\Module\Module
$name string The module name.
Résultat Puli\Manager\Api\Module\Module The module.

getModules() public méthode

Returns all installed modules.
public getModules ( ) : ModuleList
Résultat ModuleList The installed modules.

getRootModule() public méthode

Returns the root module.
public getRootModule ( ) : Puli\Manager\Api\Module\RootModule
Résultat Puli\Manager\Api\Module\RootModule The root module.

hasModule() public méthode

Returns whether the manager has the module with the given name.
public hasModule ( string $name ) : boolean
$name string The module name.
Résultat boolean Whether the manager has a module with that name.

hasModules() public méthode

You can optionally pass an expression to check whether the manager has modules matching the expression.
public hasModules ( Webmozart\Expression\Expression $expr = null ) : boolean
$expr Webmozart\Expression\Expression The search criteria.
Résultat boolean Returns `true` if the manager has modules and `false` otherwise. If an expression was passed, this method only returns `true` if the manager has modules matching the expression.

installModule() public méthode

Installs the module at the given path in the repository.
public installModule ( string $installPath, string | null $name = null, string $installerName = InstallInfo::DEFAULT_INSTALLER_NAME, string $env = Environment::PROD )
$installPath string The path to the module.
$name string | null The module name or `null` if the name should be read from the module's puli.json.
$installerName string The name of the installer.
$env string The environment to install the module in.

removeModule() public méthode

Removes the module with the given name.
public removeModule ( string $name )
$name string The module name.

removeModules() public méthode

If no matching modules are found, this method does nothing.
public removeModules ( Webmozart\Expression\Expression $expr )
$expr Webmozart\Expression\Expression The search criteria.

renameModule() public méthode

Renames the module with the given name.
public renameModule ( string $name, string $newName )
$name string The module name.
$newName string The new module name.