Blesta Addons Posted October 2, 2016 Report Share Posted October 2, 2016 I was thinking if Blesta can make the magic for Autoloading Pliugins and modules . as now only MassMailer (plugin) and Blesta License (Module) are autoloaded in Blesta . it will be wonderfull from blesta to add some tick to autoload any plugin or module (that is installed) . Quote Link to comment Share on other sites More sharing options...
Tyson Posted October 3, 2016 Report Share Posted October 3, 2016 This would be much easier if the plugins/modules were namespaced, which they are not. Until that is required (probably a version 5.0) this would not likely be available. Quote Link to comment Share on other sites More sharing options...
Blesta Addons Posted October 3, 2016 Author Report Share Posted October 3, 2016 6 hours ago, Tyson said: This would be much easier if the plugins/modules were namespaced, which they are not. Until that is required (probably a version 5.0) this would not likely be available. You talking about the core plugin ? i'm talking about the developed plugin . a solution now, is to use Composer\Autoload\ClassLoader() and then register the loader "$loader->register()" .but this solution is only working in the loaded module/plugin, i'm seeking to auto register all the plugin/module that are supporting namespace . as i see as solution (or maybe a small solution) is to search in every plugin/module for a autoload.php file, this file will contain the autoloader class and the register command , that way is possible to register the plugin/module globally . something like $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4('Blesta\\Module\\MyModuleOrMyPlugin\\', '/path/to/module_or_plugin/src'); $loader->register(); if we put a file called autoload.php and then the blesta core load all this files in the preAaction , we can use namespace in the available plugin/module . Michael 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.