PHP Class ElggPluginManifest, Elgg

Normalizes the values from the \ElggManifestParser object. This requires an \ElggPluginManifestParser class implementation as $this->parser. To add new parser versions, name them \ElggPluginManifestParserXX where XX is the version specified in the top-level tag's XML namespace.
Since: 1.8
Show file Open project: elgg/elgg Class Usage Examples

Protected Properties

Property Type Description
$apiVersion integer The API version of the manifest.
$namespace_root This is in the format http://www.elgg.org/plugin_manifest/
$parser ElggPluginManifestParser18 The parser object
$pluginID string The optional plugin id this manifest belongs to.

Public Methods

Method Description
__construct ( mixed $manifest, string $plugin_id = null ) Load a manifest file, XmlElement or path to manifest.xml file
getActivateOnInstall ( ) : boolean Should this plugin be activated when Elgg is installed
getApiVersion ( ) : integer Returns the API version in use.
getAuthor ( ) : string Returns the plugin author.
getBlurb ( ) : string Return the short description
getBugTrackerURL ( ) : string Returns the bug tracker page
getCategories ( ) : array Return the categories listed for this plugin
getConflicts ( ) : array Returns the conflicts listed
getContributors ( ) : array Return the contributors listed.
getCopyright ( ) : string Return the copyright
getDescription ( ) : string Return the description
getDonationsPageURL ( ) : string Returns the donations page
getFriendlyCategory ( string $category ) : string Returns a category's friendly name. This can be localized by defining the string 'admin:plugins:category:'. If no localization is found, returns the category with _ and - converted to ' ' and then ucwords()'d.
getID ( ) : string Return the plugin ID required by the author. If getPluginID() does not match this, the plugin should not be started.
getLicense ( ) : string Returns the license
getManifest ( ) : array Returns the manifest array.
getName ( ) : string Returns the plugin name
getPluginID ( ) : string Returns the plugin ID.
getProvides ( ) : array Return the list of provides by this plugin.
getRepositoryURL ( ) : string Returns the repository url
getRequires ( ) : array Returns the dependencies listed.
getScreenshots ( ) : array Return the screenshots listed.
getSuggests ( ) : array Returns the suggests elements.
getVersion ( ) : float Returns the version of the plugin.
getWebsite ( ) : string Return the website

Protected Methods

Method Description
buildStruct ( array $struct, array $array ) : array Normalizes an array into the structure specified

Private Methods

Method Description
normalizeDep ( array $dep ) : array Normalizes a dependency array using the defined structs.

Method Details

__construct() public method

Load a manifest file, XmlElement or path to manifest.xml file
public __construct ( mixed $manifest, string $plugin_id = null )
$manifest mixed A string, XmlElement, or path of a manifest file.
$plugin_id string Optional ID of the owning plugin. Used to fill in some values automatically.

buildStruct() protected method

Normalizes an array into the structure specified
protected buildStruct ( array $struct, array $array ) : array
$struct array The struct to normalize $element to.
$array array The array
return array

getActivateOnInstall() public method

@return bool
public getActivateOnInstall ( ) : boolean
return boolean

getApiVersion() public method

Returns the API version in use.
public getApiVersion ( ) : integer
return integer

getAuthor() public method

Returns the plugin author.
public getAuthor ( ) : string
return string

getBlurb() public method

Return the short description
public getBlurb ( ) : string
return string

getBugTrackerURL() public method

Returns the bug tracker page
public getBugTrackerURL ( ) : string
return string

getCategories() public method

Return the categories listed for this plugin
public getCategories ( ) : array
return array

getConflicts() public method

Returns the conflicts listed
public getConflicts ( ) : array
return array

getContributors() public method

Return the contributors listed.
public getContributors ( ) : array
return array

getCopyright() public method

Return the copyright
public getCopyright ( ) : string
return string

getDescription() public method

Return the description
public getDescription ( ) : string
return string

getDonationsPageURL() public method

Returns the donations page
public getDonationsPageURL ( ) : string
return string

getFriendlyCategory() public static method

Returns a category's friendly name. This can be localized by defining the string 'admin:plugins:category:'. If no localization is found, returns the category with _ and - converted to ' ' and then ucwords()'d.
public static getFriendlyCategory ( string $category ) : string
$category string The category as defined in the manifest.
return string A human-readable category

getID() public method

Return the plugin ID required by the author. If getPluginID() does not match this, the plugin should not be started.
public getID ( ) : string
return string empty string if not empty/not defined

getLicense() public method

Returns the license
public getLicense ( ) : string
return string

getManifest() public method

Used for backward compatibility. Specific methods should be called instead.
public getManifest ( ) : array
return array

getName() public method

Returns the plugin name
public getName ( ) : string
return string

getPluginID() public method

Returns the plugin ID.
public getPluginID ( ) : string
return string

getProvides() public method

Return the list of provides by this plugin.
public getProvides ( ) : array
return array

getRepositoryURL() public method

Returns the repository url
public getRepositoryURL ( ) : string
return string

getRequires() public method

Returns the dependencies listed.
public getRequires ( ) : array
return array

getScreenshots() public method

Return the screenshots listed.
public getScreenshots ( ) : array
return array

getSuggests() public method

Returns the suggests elements.
public getSuggests ( ) : array
return array

getVersion() public method

Returns the version of the plugin.
public getVersion ( ) : float
return float

getWebsite() public method

Return the website
public getWebsite ( ) : string
return string

Property Details

$apiVersion protected property

The API version of the manifest.
protected int $apiVersion
return integer

$namespace_root protected property

This is in the format http://www.elgg.org/plugin_manifest/
protected $namespace_root

$parser protected property

The parser object
protected ElggPluginManifestParser18 $parser
return ElggPluginManifestParser18

$pluginID protected property

The optional plugin id this manifest belongs to.
protected string $pluginID
return string