Elgg  Version 2.3
Public Member Functions | Public Attributes | Protected Attributes | List of all members
ElggPluginPackage Class Reference

Public Member Functions

 __construct ($plugin, $validate=true)
 Load a plugin package from mod/$id or by full path. More...
 
 isValid ()
 Checks if this is a valid Elgg plugin. More...
 
 getManifest ()
 Returns a parsed manifest file. More...
 
 getTextFilenames ()
 Returns an array of present and readable text files. More...
 
 checkDependencies ($full_report=false)
 Returns if the Elgg system meets the plugin's dependency requirements. More...
 
 getID ()
 Returns the Plugin ID. More...
 
 getError ()
 Returns the last error message. More...
 

Public Attributes

const STATIC_CONFIG_FILENAME = 'elgg-plugin.php'
 

Protected Attributes

 $manifest
 
 $path
 
 $valid = null
 
 $id
 

Detailed Description

Definition at line 19 of file ElggPluginPackage.php.

Constructor & Destructor Documentation

◆ __construct()

ElggPluginPackage::__construct (   $plugin,
  $validate = true 
)

Load a plugin package from mod/$id or by full path.

Parameters
string$pluginThe ID (directory name) or full path of the plugin.
bool$validateAutomatically run isValid()?
Exceptions
PluginException

Definition at line 102 of file ElggPluginPackage.php.

Member Function Documentation

◆ checkDependencies()

ElggPluginPackage::checkDependencies (   $full_report = false)

Returns if the Elgg system meets the plugin's dependency requirements.

This includes both requires and conflicts.

Full reports can be requested. The results are returned as an array of arrays in the form array( 'type' => requires|conflicts, 'dep' => array( dependency array ), 'status' => bool if depedency is met, 'comment' => optional comment to display to the user. )

Parameters
bool$full_reportReturn a full report.
Returns
bool|array

Definition at line 382 of file ElggPluginPackage.php.

◆ getError()

ElggPluginPackage::getError ( )

Returns the last error message.

Returns
string

Definition at line 727 of file ElggPluginPackage.php.

◆ getID()

ElggPluginPackage::getID ( )

Returns the Plugin ID.

Returns
string

Definition at line 718 of file ElggPluginPackage.php.

◆ getManifest()

ElggPluginPackage::getManifest ( )

Returns a parsed manifest file.

Returns
\ElggPluginManifest

Definition at line 316 of file ElggPluginPackage.php.

◆ getTextFilenames()

ElggPluginPackage::getTextFilenames ( )

Returns an array of present and readable text files.

Returns
array

Definition at line 359 of file ElggPluginPackage.php.

◆ isValid()

ElggPluginPackage::isValid ( )

Checks if this is a valid Elgg plugin.

Checks for requires files as defined at the start of this class. Will check require manifest fields via \ElggPluginManifest for Elgg 1.8 plugins.

Note
This doesn't check dependencies or conflicts. Use () or () for that.
Returns
bool

Definition at line 158 of file ElggPluginPackage.php.

Member Data Documentation

◆ $id

ElggPluginPackage::$id
protected

Definition at line 92 of file ElggPluginPackage.php.

◆ $manifest

ElggPluginPackage::$manifest
protected

Definition at line 71 of file ElggPluginPackage.php.

◆ $path

ElggPluginPackage::$path
protected

Definition at line 78 of file ElggPluginPackage.php.

◆ $valid

ElggPluginPackage::$valid = null
protected

Definition at line 85 of file ElggPluginPackage.php.

◆ STATIC_CONFIG_FILENAME

const ElggPluginPackage::STATIC_CONFIG_FILENAME = 'elgg-plugin.php'

Definition at line 21 of file ElggPluginPackage.php.


The documentation for this class was generated from the following file: