I like option 2 as well. It is backwards-compatible and seems to make more sense.
On Sep 8, 2008, at 1:36 AM, Matt Read wrote: > > Currently when a plugin is active Habari simply stores the file name > in the active_plugins option. This causes a problem: > > There is no correlation between the file and and the class name, thus > in order to obtain the class name for said file we must use a rather > large array_filter of _every_ single defined class to obtain only > those which are children of the Plugin class. Then, we must loop > through that array of plugin classes and, using reflection, determine > which class belongs to which file. This array_filtering (of a 200+ > element array) and reflection adds an absurd amount of overhead to > habari's initial loading, simply to instantiate plugins and register > their filter/actions. > > On a default install querying the home page, with only one plugin > active (Core Dash Modules), loading plugins takes about 5% of the > total load time for habari. That might not seem like a lot, but > remember that's 5% of total load time simply to instantiate and > register the filters/actions of _one_ plugin (the value increases with > number of active plugins), and the plugin hasn't even executed > anything yet. Eliminating above mentioned loops, will drop it to about > 1.4%. > > The other major culprit is using reflection to obtain the filter_ and > action_ methods, but i can live with that if we eliminate the above :) > > So I propose we do one of two things: > > 1) Require that the plugin file name MUST be of the form > classname.plugin.php, where "classname" is the actual value of the > plugin's class name. > > OR > > 2) Store the active plugins in the form: array( 'classname' => > '/user/plugins/foo/filename.plugin.php'); > > > I am +1 for option 2, to maintain the current way of naming the file > and class "separately". > > -- > Matt Read > http://mattread.com > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/habari-dev -~----------~----~----~----~------~----~------~--~---
