New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate redundant use of plugin getName() #1152
Comments
getName() isn't the same as the class name, e.g., 'CoreHome' vs 'Piwik_CoreHome' getName() is used in two places:
This is not used by CorePluginsAdmin where it displays the name of each plugin. Here it uses readPluginsDirectory(). Given the above, we could enforce this consistency by adding a check to CorePluginsAdmin/Controller.php's index() -- skip any plugins where these don't match up. |
Oh, I see what you mean. Yes, it would seem that getName() and getClassName() duplicate each other. Ok. Revised suggestion:
|
Sounds good |
actually, why do we need getClassName() if it must return the directory name? maybe we can get rid of it and parse it from the dir name. |
In http://dev.piwik.org/trac/wiki/Plugins/HowToWritePlugin?action=diff&version=15 - refs #1152, remove reference to "name" in getInformation() array |
(In [2263]) refs #1152 -deprecate "name" in getInformation() array;use getClassName() instead of getName(); remove unused getName() |
(In [2264]) fixes #1152 - remove deprecated "name" from getInformation() array |
(In [2272]) refs #1152 - add "final" keyword to getClassName() because we dont want subclasses (plugins) to redefine this; remove "name" from phpdocs |
Must it be the same as the class name?
Is it used anywhere?
let's clarify this and/or remove it if not useful (if we display the class name only, we don't need a human readable plugin name)
The text was updated successfully, but these errors were encountered: