Jump to content

Recommended Posts

Posted

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) .

 

 

 

 

Posted

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.

Posted
  On 10/3/2016 at 4:04 PM, 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.

Expand  

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 .

 

 

 

 

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...