logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Plack::Middleware::Debug::Base - Base class for Debug panels

Authors

       Marcel Gruenauer, "<marcel@cpan.org>"

       Tatsuhiko Miyagawa, "<miyagawa@bulknews.net>"

Availability

       The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN).  Visit
       <http://www.perl.com/CPAN/>      to      find      a      CPAN      site     near     you.     Or     see
       <http://search.cpan.org/dist/Plack-Middleware-Debug/>.

       The  development  version  lives  at  <http://github.com/miyagawa/plack-middleware-debug/>.   Instead  of
       sending patches, please fork this project using the standard git and github infrastructure.

Bugs And Limitations

       No bugs have been reported.

       Please report any bugs or feature requests through the web interface at <http://rt.cpan.org>.

Description

       This is the base class for panels.

Installation

       See perlmodinstall for information and options on installing Perl modules.

Methods

       "run"
           This  method  is  called when a request has arrived, before the main application runs. The parameters
           are $env, the PSGI environment hash reference and $panel, a Plack::Middleware::Debug::Panel object.

           If your panel needs to do some response munging, you should return a callback  that  takes  $res  the
           response  object.  Because you can return a closure, the response filter can also use $env and $panel
           easily.

Name

       Plack::Middleware::Debug::Base - Base class for Debug panels

Synopsis

         package Plack::Middleware::Debug::YourPanel;
         use parent qw(Plack::Middleware::Debug::Base);

         sub run {
             my($self, $env, $panel) = @_;

             # Do something before the application runs

             return sub {
                 my $res = shift;

                 # Do something after the application returns

             };
         }

See Also