GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
WWWdb::Plugin(3) User Contributed Perl Documentation WWWdb::Plugin(3)

WWWdb::Plugin - Plugins for WWWdb

 use WWWdb::Plugin;

 $oPlugin   = Plugin->new($cName,
                          ["HasPrePost" => $bHasPrePost,]
                          ["HasMy"      => $bHasMy]);

 $cResult   = $oPlugin->Call(@lParams);

 $bResult   = $oPlugin->IsDefined($cType);

 $cName     = $oPlugin->getName();

Plugins are one of the base-technology, which makes WWWdb so flexible. It allows the user, to plug in his own modules before, after and/or instead of the system-routine.

An example demonstrates, how this works. Lets assume we have a subroutine named Plugin. If we want to add functionality, before this routine is called we need a own plugin called PrePlugin. For additional functionality after the call of the Routine we have to define a routine called PostPlugin.

But what, if we want to replace the default plugin completely? Ok, then we must define the subroutine MyPlugin. If it is defined, this subroutine instead of the original Plugin is called.

Currently the plugins are expected in the main:: name-space.

new
 $oPlugin   = Plugin->new($cName,
                          ["HasPrePost" => $bHasPrePost,]
                          ["HasMy"      => $bHasMy]);
    

With this method, a new plugin can be allocated. The Name-Parameter contains the base-name of the subroutines. The HasPrePost and HasMy-parameters control, what types of plugins are searched, the defaults are 0.

Call
 $cResult   = $oPlugin->Call(@lParams);
    

Calls the plugins, depending on the Has...-flags given at creation time and the availability of the subroutines. The results of the subroutines are concatenated and will be returned. The given parameters were evaluated and passed to the plugin-routines.

IsDefined
 $bResult   = $oPlugin->IsDefined($cType);
    

Checks for this plugin, if a subroutine for one of the specified types Pre, Post, My or Default is defined. If it is, 1 is returned; 0 if not. For any other types undef will be given back.

Name
 $cName = $oPlugin->getName();
    

The base-name of this Plugin. (Read-only)

HasPrePost
 $bHasPrePost = $oPlugin->getHasPrePost();
    

True, when this Plugin could have a Pre- or Post-Plugin. (Read-only, private)

HasMy
 $bHasMy = $oPlugin->getHasMy();
    

True, when this Plugin could be replaced by a My-Plugin. (Read-only, private)

2002-03-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.