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
Afficher le fichier Open project: puli/manager Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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 méthode

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 méthode

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 méthode

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 méthode

Removes all install infos.
public clearInstallInfos ( )

clearPluginClasses() public méthode

Removes all plugin classes.
public clearPluginClasses ( )

getConfig() public méthode

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

getInstallInfo() public méthode

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

getInstallInfos() public méthode

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

getModuleOrder() public méthode

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[]
Résultat string[] A list of module names.

getPluginClasses() public méthode

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

hasInstallInfo() public méthode

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

hasInstallInfos() public méthode

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

hasPluginClass() public méthode

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

hasPluginClasses() public méthode

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

removeInstallInfo() public méthode

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

removePluginClass() public méthode

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 méthode

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

setModuleOrder() public méthode

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 méthode

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.