Extension
class Extension (View source)
Defines an extension (file) object.
This class does not implement the Serializable interface since problems occurred when using the serialize method.
Properties
| protected string | $type | The type of the extension (e.g., 'module'). |
|
| protected string | $pathname | The relative pathname of the extension (e.g., 'core/modules/node/node.info.yml'). |
|
| protected string|null | $filename | The filename of the main extension file (e.g., 'node.module'). |
|
| protected SplFileInfo | $splFileInfo | An SplFileInfo instance for the extension's info file. |
|
| protected string | $root | The app root. |
Methods
Constructs a new Extension object.
Returns the type of the extension.
Returns the internal name of the extension.
Returns the relative path of the extension.
Returns the relative path and filename of the extension's info file.
Returns the filename of the extension's info file.
Returns the relative path of the main extension file, if any.
Returns the name of the main extension file, if any.
Loads the main extension file, if any.
Re-routes method calls to SplFileInfo.
Magic method implementation to serialize the extension object.
Magic method implementation to unserialize the extension object.
Details
__construct(string $root, string $type, string $pathname, string $filename = NULL)
Constructs a new Extension object.
string
getType()
Returns the type of the extension.
string
getName()
Returns the internal name of the extension.
string
getPath()
Returns the relative path of the extension.
string
getPathname()
Returns the relative path and filename of the extension's info file.
string
getFilename()
Returns the filename of the extension's info file.
string|null
getExtensionPathname()
Returns the relative path of the main extension file, if any.
string|null
getExtensionFilename()
Returns the name of the main extension file, if any.
bool
load()
Loads the main extension file, if any.
__call($method, array $args)
Re-routes method calls to SplFileInfo.
Offers all SplFileInfo methods to consumers; e.g., $extension->getMTime().
array
__sleep()
Magic method implementation to serialize the extension object.
__wakeup()
Magic method implementation to unserialize the extension object.