Auto class loading
without singleton - called Auto-loaded classes
create subfolder includes in plugin abc
create there file with name xy
create there class with name plugin_abc_xy
use
new plugin_abc_xy();
See the example in the download plugin.
It works thanks to this in e107_class.php :
$tmp = explode('_', $className);
// Handler check
$tmp[0] .= '/includes'; //folder 'includes' is not part of the class name
$filename = e_PLUGIN.implode('/', $tmp).'.php';This is a reason why the plugin name shouldn't have underscores used! Autoload is not working then.
Last updated