Linux SoftwareProgrammingLibrariesModPerl::ParamBuilder 0.08

ModPerl::ParamBuilder 0.08


ModPerl::ParamBuilder is a Perl module that makes building custom Apache directives easy. SYNOPSIS package MyApp::Parameters
Developer:   Frank Wiles
      more software by author →
Price:  0.00
License:   Perl Artistic License
File size:   8K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


ModPerl::ParamBuilder is a Perl module that makes building custom Apache directives easy.

SYNOPSIS

package MyApp::Parameters;

use ModPerl::ParamBuilder;

use base qw( 'ModPerl::ParamBuilder' );

my $builder = ModPerl::ParamBuilder->new( __PACKAGE__ );

# Build simple one argument parameter
$builder->param( 'Template' );
$builder->param( 'PageTitle' );
$builder->param( 'ItemsPerPage' );

# Build an On/Off parameter
$builder->on_off( 'Caching' );

# Build a Yes/No parameter
$builder->yes_no( 'AutoCommit' );

# Build a no argument/flag parameter
$builder->no_arg( 'Active' );

# Build a one argument parameter with a custom error message
# and special configuration hash key
$builder->param( {
name => 'SMTPServer',
err => 'SMTPServer xx.xx.xx.xx',
key => 'smtp_server',
});

# Load the configuration into Apache
$builder->load;

################################################
# And elsewhere in your application
################################################
package MyApp::Main;

# Retrieve the configuration like so
my $params = MyApp::Parameters->new;
my $conf_ref = $params->get_config( $r );

# Or if you have PerlOptions +GlobalRequest on then you can just
# call
my $conf_ref = $params->get_config;

One of the neatest features of mod_perl 2.0 is the ability to easily create your own custom Apache directives. Not only are they more efficient to use compared to PerlSetEnv, PerlPassEnv, PerlAddVar, and PerlSetVar, but they give your application a more polished and professional look and feel..

Not to mention they're just plain cool. This module aims to make the already easy, even easier.
Note that you MUST load your parameter module with PerlLoadModule in your httpd.conf and not PerlModule. This is necessary because Apache needs to load your module earlier than usual in the startup to be able to read it's own configuration now.

LIMITATIONS

The biggest limitation is that this module ONLY works with mod_perl 2.0 and above. There are no plans to support mod_perl 1.x for this module, trust me you want to upgrade to mod_perl 2 as soon as you can.

This module's intent is not to replace the underlying mod_perl APIs nor is it intended to be used for complicated cases where special processing is needed. It is intended to make the simple things simple.

Some things to keep in mind when using ModPerl::ParamBuilder

This module does not restrict where the directives can be used in Apache's httpd.conf. To restrict directives to particular area ( only in main server conf, a VirtualHost, or a Location, etc ) you will need to use the mod_perl APIs to build your directives.

This also does not do, by default, any error checking or validation on the arguments passed to directives. If you create a directive 'NumberOfItemsPerPage' and then put:

NumberOfItemsPerPage rhubarb

Apache will not see this as an error and your configuration hash for the key 'NumberOfItemsPerPage' will contain the string 'rhubarb'. You can validate this data in three different ways:

1) Validate the configuration data in your application prior to
using it.

2) Instruct ModPerl::ParamBuilder to use a special function for
processing the arguments by passing the 'func' option.

3) Revert to using the mod_perl API where you have more control.

See the appropriate mod_perl 2.0 API modules for how to accomplish more in depth processing of directives and their data.

Requirements:
  • Perl
    tags mod perl  modperl parambuilder  this module  builder param  parameter builder  you can  your application  the configuration  the mod  the arguments  load your  does not  you have  

    Download ModPerl::ParamBuilder 0.08


     http://ftp.casaafacerilor.ro/mirrors/CPAN/authors/id/F/FW/FWILES/ModPerl-ParamBuilder-0.08.tar.gz


    Authors software

    Gantry 3.2.1 (by Frank Wiles)
    Gantry is a robust Perl-based Web application framework for Apache/mod_perl, CGI, and Fast-CGI.

    Object-oriented design allows for

    ModPerl::ParamBuilder 0.08 (by Frank Wiles)
    ModPerl::ParamBuilder is a Perl module that makes building custom Apache directives easy.

    SYNOPSIS

    package MyApp::Parameters


    Similar software

    ModPerl::ParamBuilder 0.08 (by Frank Wiles)
    ModPerl::ParamBuilder is a Perl module that makes building custom Apache directives easy.

    SYNOPSIS

    package MyApp::Parameters

    ModPerl::BuildMM 2.0.2 (by ModPerl::BuildMM Team)
    ModPerl::BuildMM is a "subclass" of ModPerl::MM used for building mod_perl 2.0.

    SYNOPSIS

    use ModPerl::BuildMM;

    # ModPe

    Bundle::CGI::Builder::Complete 1.36 (by Domizio Demichelis)
    Bundle::CGI::Builder::Complete is a bundle to install the complete CGI::Builder framework.

    SYNOPSIS

    perl -MCPAN -e 'install

    Apache::AuthPerLDAP 0.5 (by Henrik Strom)
    Apache::AuthPerLDAP is a mod_perl PerLDAP Authentication Module.

    SYNOPSIS

    < Directory /foo/bar >
    # Authentication Real

    Perl::Dist::Builder 0.0.5 (by David A. Golden)
    Perl::Dist::Builder is a Perl module to create win32 Perl installers.

    SYNOPSIS

    use Perl::Dist::Builder;
    my $pdb = Perl::Dist

    Data::CGIForm 0.4 (by Tim Wilde)
    Data::CGIForm is a Perl module with form data interface.

    Data::CGIForm is yet another way to parse and handle CGI form data

    PSA::Test::Builder 0.49_01 (by chromatic and Michael G Schwern)
    PSA::Test::Builder is a backend for building test libraries.

    SYNOPSIS

    package My::Test::Module;
    use PSA::Test::Builder;

    Test::Builder 0.64 (by chromatic and Michael G Schwern)
    Test::Builder is a backend for building test libraries.

    SYNOPSIS

    package My::Test::Module;
    use Test::Builder;
    require E

    Apache::PAR::tutorial 0.30 (by Nathan Byrd)
    Apache::PAR::tutorial is a Perl module with information on getting Apache::PAR up and running.

    Apache::PAR is a framework for incl

    mod_become 1.03 (by Anthony Howe)
    mod_become module enables the web server to take on the access rights of a user & group, so that ~users can make available files to t


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags