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

 

 

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...