diff options
Diffstat (limited to 'core/Plugin.php')
-rw-r--r-- | core/Plugin.php | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/core/Plugin.php b/core/Plugin.php index d0d118180a..82ac6c523f 100644 --- a/core/Plugin.php +++ b/core/Plugin.php @@ -20,14 +20,14 @@ abstract class Piwik_Plugin { /** * Returns the plugin details - * 'name' => string // plugin name - * 'description' => string // 1/2 sentences description of the plugin - * 'author' => string // plugin author - * 'author_homepage' => string // author homepage (or email "mailto:youremail@example.org") - * 'homepage' => string // plugin homepage - * 'version' => string // plugin version number + * 'description' => string // 1-2 sentence description of the plugin + * 'author' => string // plugin author + * 'author_homepage' => string // author homepage URL (or email "mailto:youremail@example.org") + * 'homepage' => string // plugin homepage URL + * 'version' => string // plugin version number; examples and 3rd party plugins must not use Piwik_Version::VERSION; + * // 3rd party plugins must increment the version number with each plugin release * 'translationAvailable' => bool // is there a translation file in plugins/your-plugin/lang/* ? - * 'TrackerPlugin' => bool // should we load this plugin during the stats logging process? + * 'TrackerPlugin' => bool // should we load this plugin during the stats logging process? */ abstract function getInformation(); @@ -69,17 +69,6 @@ abstract class Piwik_Plugin } /** - * Returns the plugin name - * - * @return string - */ - public function getName() - { - $info = $this->getInformation(); - return $info['name']; - } - - /** * Returns the plugin version number * * @return string @@ -91,12 +80,13 @@ abstract class Piwik_Plugin } /** - * Returns the UserCountry part when the plugin class is Piwik_UserCountry + * Returns the plugin's base name without the "Piwik_" prefix, + * e.g., "UserCountry" when the plugin class is "Piwik_UserCountry" * * @return string */ - public function getClassName() + final public function getClassName() { - return substr(get_class($this), strlen("Piwik_")); + return Piwik::unprefixClass(get_class($this)); } } |