Jonathan Angliss said:
> On Thu, 2002-08-08 at 21:50, Erin Schnabel wrote:
>> Of the two, I think using the second is better, as the hook is less
>> likely to be renamed, but I'm not sure if either of these is just
>> plain bad. I checked plugin.php and some other places, but as I'm
>> fairly new at SquirrelMail and php, I wasn't sure if I missed a
>> function definition that tests for plugins.
> I'm pretty new to this as well, only today started looking at other
> plugins, and considering creating my own, and trying to create one to
> the specifications somebody requested. If you look at
> functions/plugin.php the section at the top reads the config, and then
> loads each plugin, can you not use a similar code structure to that?
> The section I mean is the bit with the comment:
> /* This function adds a plugin */
> Which is what I am assuming is the first section that loads each plugin
> that has been set in the config file.
> Jonathan Angliss
No, I can't. I thought so at first too, when I saw that. But there is a
difference between a plugin being present (meaning the file exists, as
use_plugin checks for), and a plugin being installed - meaning present in
the $plugins array, as currently modified by the configure script of
however. So, I need to check something else to see whether or not a plugin
is actively installed.
The first option I listed checks the $plugins array (as modified by any
config scripts, etc) directly, the other checks the menuline hook where
the particular plugin is installed.
The first is more generic, but I'm not sure if I should be accessing the
$plugins array directly, or if I'm breaking some fundamental rule.
The second requires me to know where the plugin I'm checking for likes to
hook itself in. Presumably, since I'm looking for the darn thing, I know
the answer to that question, so it's no biggie, but again, I don't know if
there is an easier, or better, way to do this.
'Waste of a good apple.' ~Samwise Gamgee