Ticket #115 (closed New Feature: invalid)

Opened 3 years ago

Last modified 3 years ago

Use PluginsPath for each plugin

Reported by: alfonsoml Owned by: alfonsoml
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Now the PluginsPath configuration setting is used only once at the end of the parsing, so if you want to load plugins from different sources you have to be sure that each one has specifed the path at load time:

FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;

FCKConfig.Plugins.Add( 'autogrow' ) ;

// Non standard plugins
FCKConfig.Plugins.Add( 'rtSpellCheck', '', '/customPlugins/' ) ;

but it would seem more logical to be able to change the PluginsPath and so the next plugins will load from that path:

FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;

FCKConfig.Plugins.Add( 'autogrow' ) ;


// Non standard plugins
FCKConfig.PluginsPath = '/customPlugins/' ;

FCKConfig.Plugins.Add( 'rtSpellCheck' ) ;

I've checked the code in [149] so it can be discussed and reviewed before it gets added to the trunk.

Change History

Changed 3 years ago by fredck

I'm not sure the proposal is still a clear solution. The fact is that PluginsPath is a configuration option. It is quite strange to change it many times in the configuration file, expecting it to change the behavior of subsequent calls to the Add method.

Actually, it is not possible to know how Add works behind the scene, so one can't be sure that PluginsPath will be used at the right moment of the Add call, or after the entire configuration file is processed.

In any case, you are right to say that the current plugin loading system has room for improvements. I think we could come with something for the 3.0. Maybe simply indicating the full path for the plugin folder would be enough, instead of using base paths and plugin names. It would be a simpler and clearer solution.

I would vote to close this ticket and write some documentation at wiki:Components/Plugins? regarding it, so we can work on the definitions first.

Changed 3 years ago by alfonsoml

  • status changed from new to closed
  • resolution set to invalid

I don't really know how to write the spec for the Plugins page, but now I see that this patch wasn't really needed (as each plugin can specify its path and that's probably a better long term solution), so I'm closing this bug and reverting the changes in my branch.

Note: See TracTickets for help on using tickets.