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
Use Singleton parent class app-wide? #4208
Labels
Task
Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone
Comments
Doing this would prevent all these classes from extending another class. We should maybe also rethink some of these singletons: http://stackoverflow.com/questions/137975/what-is-so-bad-about-singletons |
sabl0r
pushed a commit
to sabl0r/piwik
that referenced
this issue
Sep 23, 2014
sabl0r
pushed a commit
to sabl0r/piwik
that referenced
this issue
Sep 23, 2014
sabl0r
pushed a commit
to sabl0r/piwik
that referenced
this issue
Sep 23, 2014
sabl0r
pushed a commit
to sabl0r/piwik
that referenced
this issue
Sep 23, 2014
…th custom getInstance() (some tests failing)
sabl0r
pushed a commit
to sabl0r/piwik
that referenced
this issue
Sep 23, 2014
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now that we use php 5.3, maybe it's possible to have all singletons inherit a clean Singleton abstract. Currently having to write the getInstance function is lengthy.
maybe this solution: http://stackoverflow.com/questions/3972628/creating-a-singleton-base-class-in-php-5-3?answertab=votes#tab-top
Note: we have 53 singletons in Piwik!! (because all API are singleton for example + 18 singleton in core...)
The text was updated successfully, but these errors were encountered: