PHP Class Puli\Manager\Api\Module\RootModuleFile

You can pass a base configuration to the constructor that the module's configuration will inherit.
Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: extends ModuleFile
Show file Open project: puli/manager Class Usage Examples

Public Methods

Method Description
__construct ( string | null $moduleName = null, string | null $path = null, Puli\Manager\Api\Config\Config $baseConfig = null ) Creates a new root module file.
addInstallInfo ( Puli\Manager\Api\Module\InstallInfo $installInfo ) Adds install info for an installed module.
addPluginClass ( string $pluginClass ) Adds a plugin class.
addPluginClasses ( array $pluginClasses ) Adds multiple plugin classes.
clearInstallInfos ( ) Removes all install infos.
clearPluginClasses ( ) Removes all plugin classes.
getConfig ( ) : Puli\Manager\Api\Config\Config Returns the configuration of the module.
getInstallInfo ( string $moduleName ) : Puli\Manager\Api\Module\InstallInfo Returns the install info of an installed module.
getInstallInfos ( ) : Puli\Manager\Api\Module\InstallInfo[] Returns the install infos of all installed modules.
getModuleOrder ( ) : string[] Returns the order in which modules should be loaded.
getPluginClasses ( ) : string[] Returns the plugin classes.
hasInstallInfo ( string $moduleName ) : boolean Returns whether an install info with a given name exists.
hasInstallInfos ( ) : boolean Returns whether the module file contains any install infos.
hasPluginClass ( string $pluginClass ) : boolean Returns whether the configuration contains a plugin class.
hasPluginClasses ( ) : boolean Returns whether the configuration contains any plugin classes.
removeInstallInfo ( string $moduleName ) Removes the install info of an installed module.
removePluginClass ( string $pluginClass ) Removes a plugin class.
setInstallInfos ( array $installInfos ) Sets the install infos of all installed modules.
setModuleOrder ( array $moduleOrder ) Sets the order in which modules should be loaded.
setPluginClasses ( array $pluginClasses ) Sets the plugin classes.

Method Details

__construct() public method

The file's configuration will inherit its settings from the base configuration passed to the constructor.
public __construct ( string | null $moduleName = null, string | null $path = null, Puli\Manager\Api\Config\Config $baseConfig = null )
$moduleName string | null The module name. Optional.
$path string | null The path where the configuration is stored or `null` if this configuration is not stored on the file system.
$baseConfig Puli\Manager\Api\Config\Config The configuration that the module will inherit its configuration values from.

addInstallInfo() public method

Adds install info for an installed module.
public addInstallInfo ( Puli\Manager\Api\Module\InstallInfo $installInfo )
$installInfo Puli\Manager\Api\Module\InstallInfo The install info.

addPluginClass() public method

The plugin class must be a fully-qualified class name that implements {@link PuliPlugin}. If the class is not found or does not implement that interface, an exception is thrown. The plugin class must not have required parameters in its constructor so that it can be successfully instantiate. If the constructor has required parameters, an exception is thrown. Leading backslashes are removed from the fully-qualified class name.
public addPluginClass ( string $pluginClass )
$pluginClass string The fully qualified plugin class name.

addPluginClasses() public method

The plugin classes must be fully-qualified class names that implement {@link Puli\Manager\Api\PuliPlugin}. If a class is not found or does not implement that interface, an exception is thrown. The plugin classes must not have required parameters in their constructor so that they can be successfully instantiated. If a constructor has required parameters, an exception is thrown. Leading backslashes are removed from the fully-qualified class names.
public addPluginClasses ( array $pluginClasses )
$pluginClasses array The fully qualified plugin class names.

clearInstallInfos() public method

Removes all install infos.
public clearInstallInfos ( )

clearPluginClasses() public method

Removes all plugin classes.
public clearPluginClasses ( )

getConfig() public method

Returns the configuration of the module.
public getConfig ( ) : Puli\Manager\Api\Config\Config
return Puli\Manager\Api\Config\Config The configuration.

getInstallInfo() public method

Returns the install info of an installed module.
public getInstallInfo ( string $moduleName ) : Puli\Manager\Api\Module\InstallInfo
$moduleName string The module name.
return Puli\Manager\Api\Module\InstallInfo The install info.

getInstallInfos() public method

Returns the install infos of all installed modules.
public getInstallInfos ( ) : Puli\Manager\Api\Module\InstallInfo[]
return Puli\Manager\Api\Module\InstallInfo[] The install infos.

getModuleOrder() public method

If modules contain path mappings for the same resource paths, this setting can be used to specify in which order these modules should be loaded. Alternatively, you can use {@link setOverriddenModules()} to mark one of the modules to override the other one.
public getModuleOrder ( ) : string[]
return string[] A list of module names.

getPluginClasses() public method

Returns the plugin classes.
See also: setPluginClasses()
public getPluginClasses ( ) : string[]
return string[] The fully qualified plugin class names.

hasInstallInfo() public method

Returns whether an install info with a given name exists.
public hasInstallInfo ( string $moduleName ) : boolean
$moduleName string The name of the module.
return boolean Whether install info with that name exists.

hasInstallInfos() public method

Returns whether the module file contains any install infos.
public hasInstallInfos ( ) : boolean
return boolean Returns `true` if the file contains install infos and `false` otherwise.

hasPluginClass() public method

Returns whether the configuration contains a plugin class.
public hasPluginClass ( string $pluginClass ) : boolean
$pluginClass string The fully qualified plugin class name.
return boolean Whether the configuration contains the plugin class.

hasPluginClasses() public method

Returns whether the configuration contains any plugin classes.
public hasPluginClasses ( ) : boolean
return boolean Whether the configuration contains any plugin classes.

removeInstallInfo() public method

Removes the install info of an installed module.
public removeInstallInfo ( string $moduleName )
$moduleName string The module name.

removePluginClass() public method

If the plugin class has not been added, this method does nothing. This method also does not validate whether the passed value is actually a plugin class. Leading backslashes are removed from the fully-qualified class name.
public removePluginClass ( string $pluginClass )
$pluginClass string The fully qualified plugin class name.

setInstallInfos() public method

Sets the install infos of all installed modules.
public setInstallInfos ( array $installInfos )
$installInfos array

setModuleOrder() public method

If modules contain path mappings for the same resource paths, this setting can be used to specify in which order these modules should be loaded. Alternatively, you can use {@link setOverriddenModules()} to mark one of the modules to override the other one.
public setModuleOrder ( array $moduleOrder )
$moduleOrder array A list of module names.

setPluginClasses() public method

The plugin classes must be fully-qualified class names that implement {@link Puli\Manager\Api\PuliPlugin}. If a class is not found or does not implement that interface, an exception is thrown. The plugin classes must not have required parameters in their constructor so that they can be successfully instantiated. If a constructor has required parameters, an exception is thrown. Leading backslashes are removed from the fully-qualified class names.
public setPluginClasses ( array $pluginClasses )
$pluginClasses array The fully qualified plugin class names.