Classes got initialised regardless if it is needed or not
Issue #39
resolved
In mvc_admin_parent_factory.class.php, the following code initialise every class regardless if it is needed or not.
if ( $reflection->isSubclassOf( 'MVC_Admin_General' ) && $cla_str != $class ) {
// if extended by the general class and not the main one, run the class with init
new $class();
}
Suggestion: Add an Constant like INIT_ME to the class which requires initialisation, and then we can run the following code to initialise the class
if ( defined( $class . '::INIT_ME' ) ) {
new $class();
}
Comments (2)
-
reporter -
- changed status to resolved
Fixes
#39Added back the init class check→ <<cset 0beb60b9d0cd>>
- Log in to comment
@Andrew Palfrey @Luke Nelson @dhodgkiss0@gmail.com
I was thinking about this on my way home. I think we need a discussion to solve this problem. We now have three solutions:
I think the third one is the simplest way because what needed to be done is just creating a constant, no need to put effort into implementing the Interface class or find a place to apply the filter. It is easier for our users to understand and apply as well.
This is impacting our existing code and the future efficiency of coding. Could I have everyone’s opinions?
If the explanation is not clear, we can have a meeting next week.
Thanks
Jamin