Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Changes to Plugins - Install.pm

Quote Reply
Changes to Plugins - Install.pm
Alex....

A lot of changes...

First, it seems

$mgr->install_hooks ( 'Auth_WWWThreads', [
['auth_init', 'PRE', 'Plugins::Auth_WWWThreads::auth_init'],
['auth_add_user', 'PRE', 'Plugins::Auth_WWWThreads::auth_add_user'],
...

That the install_hooks function is looking for a single passed argument,
not individual lines (though that didn't seem to make much difference on install)

But......


Code:
sub uninstall {
# -------------------------------------------------------------------
# Not much to uninstall.
#
my $mgr = shift;

# Hooks get cleaned up automatically.
return "The plugin has been successfully removed.";
}
I still have a full uninstall naming each of the unistall options, and they are _NOT_ being un-installed.

If I uninstall, and then update any other plug-in, the _pre and _post hooks are removed when the file is saved back.

These are probably bugs... or at the very least, quirks :)


PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Changes to Plugins - Install.pm In reply to
Hi,

The install_* functions can take two arguments. The first is always the plugin name, and the second is either a single array ref, or an array ref of array refs like:

$install-> ('MyPLugin', [
['PRE', 'hook1', ..],
['PRE', 'hook2', ..],
..
]);

As for uninstall, have a look at plugin.cfg after you remove the plugin and see if you can spot your hooks there, they should be removed.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Changes to Plugins - Install.pm In reply to
They aren't.

My hooks are still there.... Until I update one of the other existing plugins.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ