Свойство | Type | Description | |
---|---|---|---|
$pluginName | string | Name of this plugin. |
Méthode | Description | |
---|---|---|
__construct ( string | boolean $pluginName = false ) | Constructor. | |
activate ( ) | Executed every time the plugin is enabled. | |
deactivate ( ) | Executed every time the plugin is disabled. | |
findComponent ( string $componentName, string $expectedSubclass ) : string | null | Tries to find a component such as a Menu or Tasks within this plugin. | |
findMultipleComponents ( $directoryWithinPlugin, $expectedSubclass ) | ||
getInformation ( ) : array | Returns plugin information, including: | |
getListHooksRegistered ( ) : array | ||
getMissingDependencies ( $piwikVersion = null ) | ||
getMissingDependenciesAsString ( string $piwikVersion = null ) : string | Returns a string (translated) describing the missing requirements for this plugin and the given Piwik version | |
getPluginName ( ) : string | Returns the plugin's base class name without the namespace, e.g., "UserCountry" when the plugin class is "Piwik\Plugins\UserCountry\UserCountry". | |
getPluginNameFromBacktrace ( array $backtrace ) : string | false | Extracts the plugin name from a backtrace array. Returns false if we can't find one. | |
getPluginNameFromNamespace ( string $namespaceOrClassName ) : string | false | Extracts the plugin name from a namespace name or a fully qualified class name. Returns false if we can't find one. | |
getVersion ( ) : string | Returns the plugin version number. | |
hasMissingDependencies ( null $piwikVersion = null ) : boolean | Detect whether there are any missing dependencies. | |
install ( ) | Installs the plugin. Derived classes should implement this class if the plugin needs to: | |
isTheme ( ) : boolean | Returns true if this plugin is a theme, false if otherwise. | |
isTrackerPlugin ( ) : boolean | Override this method in your plugin class if you want your plugin to be loaded during tracking. | |
postLoad ( ) | This method is executed after a plugin is loaded and translations are registered. | |
registerEvents ( ) : array | Returns a list of events with associated event observers. | |
reloadPluginInformation ( ) | ||
uninstall ( ) | Uninstalls the plugins. Derived classes should implement this method if the changes made in {@link install()} need to be undone during uninstallation. |
Méthode | Description | |
---|---|---|
createCacheIfNeeded ( ) | ||
doFindMultipleComponents ( $directoryWithinPlugin, $expectedSubclass ) : array | ||
hasDefinedPluginInformationInPluginClass ( ) | ||
includeComponents ( $components ) : boolean | ||
makeDependency ( $piwikVersion ) : |
public __construct ( string | boolean $pluginName = false ) | ||
$pluginName | string | boolean | A plugin name to force. If not supplied, it is set to the last part of the class name. |
public findComponent ( string $componentName, string $expectedSubclass ) : string | null | ||
$componentName | string | The name of the component you want to look for. In case you request a component named 'Menu' it'll look for a file named 'Menu.php' within the root of the plugin folder that implements a class named Piwik\Plugin\$PluginName\Menu . If such a file exists but does not implement this class it'll silently ignored. |
$expectedSubclass | string | If not empty, a check will be performed whether a found file extends the given subclass. If the requested file exists but does not extend this class a warning will be shown to advice a developer to extend this certain class. |
Résultat | string | null | Null if the requested component does not exist or an instance of the found component. |
public findMultipleComponents ( $directoryWithinPlugin, $expectedSubclass ) |
public getInformation ( ) : array | ||
Résultat | array |
public getMissingDependenciesAsString ( string $piwikVersion = null ) : string | ||
$piwikVersion | string | |
Résultat | string | "AnonymousPiwikUsageMeasurement requires PIWIK >=3.0.0" |
final public getPluginName ( ) : string | ||
Résultat | string |
public static getPluginNameFromBacktrace ( array $backtrace ) : string | false | ||
$backtrace | array | The result of {@link debug_backtrace()} or [Exception::getTrace()](http://www.php.net/manual/en/exception.gettrace.php). |
Résultat | string | false |
public static getPluginNameFromNamespace ( string $namespaceOrClassName ) : string | false | ||
$namespaceOrClassName | string | The namespace or class string. |
Résultat | string | false |
final public getVersion ( ) : string | ||
Résultat | string |
public hasMissingDependencies ( null $piwikVersion = null ) : boolean | ||
$piwikVersion | null | Defaults to the current Piwik version |
Résultat | boolean |
public isTrackerPlugin ( ) : boolean | ||
Résultat | boolean |
public postLoad ( ) |
public registerEvents ( ) : array | ||
Résultat | array | eg, array( 'API.getReportMetadata' => 'myPluginFunction', 'Another.event' => array( 'function' => 'myOtherPluginFunction', 'after' => true // execute after callbacks w/o ordering ) 'Yet.Another.event' => array( 'function' => 'myOtherPluginFunction', 'before' => true // execute before callbacks w/o ordering ) ) |
public uninstall ( ) |