Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

catalyst::manual::internals(3pm) [debian man page]

Catalyst::Manual::Internals(3pm)			User Contributed Perl Documentation			  Catalyst::Manual::Internals(3pm)

NAME
Catalyst::Manual::Internals - Catalyst Internals DESCRIPTION
This document provides a brief overview of the internals of Catalyst. As Catalyst is still developing rapidly, details may become out of date: please treat this as a guide, and look at the source for the last word. The coverage is split into initialization and request lifecycle. Initialization Catalyst initializes itself in two stages: 1. When the Catalyst module is imported in the main application module, it stores any options. 2. When "__PACKAGE__->setup" is called, it evaluates any options stored ("-Debug"), and makes the application inherit from Catalyst (if that hasn't already been done with an explicit "use base 'Catalyst';" or "extends 'Catalyst';". Any specified plugins are then loaded, the application module is made to inherit from the plugin classes. It also sets up a default log object and ensures that the application module inherits from "Catalyst" and from the selected specialized Engine module. 3. Catalyst automatically loads all components it finds in the $class::Controller, $class::C, $class::Model, $class::M, $class::View and $class::V namespaces (using "Module::Pluggable"). As each is loaded, if it has a Catalyst::Component/COMPONENT method then this method will be called, and passed that component's configuration. It then returns an instance of the component, which becomes the $self when methods in that component are called later. 4. Each controller has it's "register_actions" method called. At this point, the subroutine attributes are retrieved from the MooseX::MethodAttributes::Role::Meta::Map, parsed, and used to build instances of Catalyst::Action, which are then registered with the dispatcher. Request Lifecycle For each request Catalyst builds a context object, which includes information about the request, and then searches the action table for matching actions. The handling of a request can be divided into three stages: preparation of the context, processing of the request, and finalization of the response. These are the steps of a Catalyst request in detail; every step can be overloaded to extend Catalyst. handle_request prepare prepare_request prepare_connection prepare_query_parameters prepare_headers prepare_cookies prepare_path prepare_body (unless parse_on_demand) prepare_body_parameters prepare_parameters prepare_uploads prepare_action dispatch finalize finalize_uploads finalize_error (if one happened) finalize_headers finalize_cookies finalize_body These steps are normally overloaded from engine classes, and may also be extended by plugins. For more on extending Catalyst, see Catalyst::Manual::ExtendingCatalyst. The engine class populate sthe Catalyst request object with information from the underlying layer (PSGI) during the prepare phase, then push the generated response information down to the underlying layer during the finalize phase. AUTHORS
Catalyst Contributors, see Catalyst.pm COPYRIGHT
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-20 Catalyst::Manual::Internals(3pm)

Check Out this Related Man Page

Catalyst::Engine::PSGI(3pm)				User Contributed Perl Documentation			       Catalyst::Engine::PSGI(3pm)

NAME
Catalyst::Engine::PSGI - PSGI engine for Catalyst SYNOPSIS
# app.psgi use strict; use MyApp; MyApp->setup_engine('PSGI'); my $app = sub { MyApp->run(@_) }; DESCRIPTION
Catalyst::Engine::PSGI is a Catalyst Engine that adapts Catalyst into the PSGI gateway protocol. COMPATIBILITY
o Currently this engine works with Catalyst 5.8 (Catamoose) or newer. o Your application is supposed to work with any PSGI servers without any code modifications, but if your application uses "$c->res->write" to do streaming write, this engine will buffer the output until your app finishes. To do real streaming with this engine, you should implement an IO::Handle-like object that responds to "getline" method that returns chunk or undef when done, and set that object to "$c->res->body". Alternatively, it is possible to set the body to a code reference, which will be used to stream content as documented in the PSGI spec. o When your application runs behind the frontend proxy like nginx or lighttpd, this Catalyst engine doesn't automatically recognize the incoming headers like "X-Forwarded-For", because respecting these headers by default causes a potential security issue. You have to enable Plack::Middleware::ReverseProxy or Plack::Middleware::ForwardedHeaders to automatically promote those forwarded headers into "REMOTE_ADDR" hence IP address of the request. ReverseProxy middleware is pretty simple and has no configuration while ForwardedHeaders allows you to configure which upstream host to trust, etc. AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net> Most of the code is taken and modified from Catalyst::Engine::CGI. LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Catalyst::Engine PSGI Plack perl v5.12.3 2011-06-11 Catalyst::Engine::PSGI(3pm)
Man Page