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
Plagger::Plugin(3) User Contributed Perl Documentation Plagger::Plugin(3)

Plagger::Plugin - Base class for Plagger Plugins

  package Plagger::Plugin::Something;
  use base qw(Plagger::Plugin);

  # register hooks
  sub register {
    my ($self, $context) = @_;
    $context->register_hook( $self,
       'thingy.wosit'  => $self->can('doodad'),
    )
  }

  sub doodad { ... }

This is the base class for plagger plugins. Pretty much everything is done by plugins in Plagger.

To write a new plugin, simply inherit from Plagger::Plugin:

  package Plagger::Plugin;
  use base qw(Plagger::Plugin);

Then register some hooks:

  # register hooks
  sub register {
    my ($self, $context) = @_;
    $context->register_hook( $self,
       'thingy.wosit'  => $self->can('doodad'),
    )
  }

This means that the "doodad" method will be called at the "thingy.wosit" stage.

There is a handy "plugin-start.pl" in tools tool that creates the template of .pm file, dependency YAML file and test files for you.

  > ./tools/plugin-start.pl Foo::Bar

new
Standard constructor. Calls init.
init
Initializes the plugin
walk_config_encryption
do_walk
decrypt_config
conf
rule
rule_hook
cache
dispatch_rule_on
class_id
assets_dir
log
cookie_jar
Access the Plagger::Cookies object.
templatize
load_assets

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

See AUTHORS file for the name of all the contributors.

Except where otherwise noted, Plagger is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

<http://plagger.org/>
2006-12-05 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.