Module
class Module implements Serializable (View source)
Abstraction of a PHP Package. Can be used to retrieve information about SilverStripe modules, and other packages
managed via composer, by reading their composer.json
file.
Constants
TRIM_CHARS |
|
Methods
Construct a module
Gets name of this module. Used as unique key and identifier for this module.
Get full composer name. Will be null if no composer.json is available
Get list of folders that need to be made available
Gets "short" name of this module. This is the base directory this module is installed in.
Name of the resource directory where vendor resources should be exposed as defined by the extra.resources-dir
key in the composer file. A blank string will will be returned if the key is undefined.
Get base path for this module
Get path relative to base dir.
No description
No description
Activate _config.php for this module, if one exists
Get resource for this module
Details
__construct(string $path, string $basePath)
Construct a module
string
getName()
Gets name of this module. Used as unique key and identifier for this module.
If installed by composer, this will be the full composer name (vendor/name). If not insalled by composer this will default to the basedir()
string|null
getComposerName()
Get full composer name. Will be null if no composer.json is available
array
getExposedFolders()
Get list of folders that need to be made available
string
getShortName()
Gets "short" name of this module. This is the base directory this module is installed in.
If installed in root, this will be generated from the composer name instead
string
getResourcesDir()
Name of the resource directory where vendor resources should be exposed as defined by the extra.resources-dir
key in the composer file. A blank string will will be returned if the key is undefined.
Only applicable when reading the composer file for the main project.
string
getPath()
Get base path for this module
string
getRelativePath()
Get path relative to base dir.
If module path is base this will be empty string
serialize()
unserialize($serialized)
activate()
Activate _config.php for this module, if one exists
ModuleResource
getResource(string $path)
Get resource for this module
string
getRelativeResourcePath(string $path)
deprecated
deprecated
string
getResourcePath(string $path)
deprecated
deprecated
string
getResourceURL(string $path)
deprecated
deprecated
string
hasResource(string $path)
deprecated
deprecated