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


Manual Reference Pages  -  CLASS::COMPONENT::COMPONENT::PLAGGERIZE (3)

.ds Aq ’

NAME

Class::Component::Component::Plaggerize - extend your module like from Plagger component

CONTENTS

SYNOPSIS

myapp.pl



  #!/usr/bin/perl
  use strict;
  use warnings;

  use MyApp;
  MyApp->new({ config => config.yaml })->run;



config.yaml



  plugins:
    - module: Test
      config: hello



MyApp.pm



  package MyApp;
  use strict;
  use warnings;
  use Class::Component;
  __PACKAGE__->load_components(qw/ Plaggerize /);

  sub run {
      my $self = shift;
      $self->log( debug => running start );
      $self->run_hook(test);
  }
  1;



MyApp/Plugin/Test.pm



  package MyApp::Plugin::Test;
  use strict;
  use warnings;
  use base Class::Component::Plugin;

  sub test : Hook(test) {
      my($self, $c) = @_;
      use Data::Dumper;
      $c->log( debug => testmethod: . Dumper($self->config) );
  }
  1;



METHODS

conf Returns a hash that has the application-wide configuration.
log


  $self->log( debug => debug log);



should_log

SETUP METHODS

setup_config
setup_plugins

AUTHOR

Kazuhiro Osawa <ko@yappo.ne.jp>

SEE ALSO

Class::Component

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CLASS::COMPONENT::COMPONENT::PLAGGERIZE (3) 2008-03-24

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