Module
class Module implements Serializable
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
at line 56
__construct(string $path, string $basePath)
Construct a module
at line 71
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()
at line 81
string|null
getComposerName()
Get full composer name. Will be null if no composer.json is available
at line 94
array
getExposedFolders()
Get list of folders that need to be made available
at line 110
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
at line 138
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.
at line 150
string
getPath()
Get base path for this module
at line 161
string
getRelativePath()
Get path relative to base dir.
If module path is base this will be empty string
at line 169
serialize()
at line 174
unserialize($serialized)
at line 183
activate()
Activate _config.php for this module, if one exists
at line 215
ModuleResource
getResource(string $path)
Get resource for this module
at line 232
string
getRelativeResourcePath(string $path)
deprecated
deprecated 4.0.0:5.0.0 Use getResource($path)->getRelativePath() instead
at line 245
string
getResourcePath(string $path)
deprecated
deprecated 4.0.0:5.0.0 Use ->getResource($path)->getPath() instead
at line 258
string
getResourceURL(string $path)
deprecated
deprecated 4.0.0:5.0.0 Use ->getResource($path)->getURL() instead
at line 271
string
hasResource(string $path)
deprecated
deprecated 4.0.0:5.0.0 Use ->getResource($path)->exists() instead