Maypole::Plugin::Config::Apache

Read config settings from httpd.conf
Download

Maypole::Plugin::Config::Apache Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • David R. Baird
  • Publisher web site:
  • http://search.cpan.org/~davebaird/

Maypole::Plugin::Config::Apache Tags


Maypole::Plugin::Config::Apache Description

Read config settings from httpd.conf Anything starting with Maypole or MaypoleEval is taken to be a config setting for Maypole. Everything after the Maypole or MaypoleEval is the variable name, in StudlyCaps form.Values from MaypoleEval variables are run through an eval, allowing arbitrarily complex data structures to be set, including the coderefs, if anything needed that.Any value from a PerlAddVar that contains a => symbol is also run through an eval, so any valid perl expression for a hash value can be used.An attempt is made to intelligently merge hash entries in multiple PerlAddVar statements. Multiple entries with the same key are merged into a single hashref or arrayref value.Put Config::Apache at the front of the Maypole::Application call, so that later plugins have access to the configuration settings. If your httpd.conf contains all of your Maypole settings, you can add the -Setup flag, which calls __PACKAGE__->setup for you.SYNOPSIS use Maypole::Application qw( Config::Apache -Setup ); # in httpd.conf # same as $config->application_name( "The Beer Database" ) PerlSetVar MaypoleApplicationName "The Beer Database" PerlSetVar MaypoleDsn dbi:mysql:BeerDB PerlSetVar MaypoleUser username PerlSetVar MaypolePass password # same as $config->display_tables( ) PerlAddVar MaypoleDisplayTables beer PerlAddVar MaypoleDisplayTables brewery PerlAddVar MaypoleDisplayTables pub PerlAddVar MaypoleDisplayTables style # same as $config->masonx( { data_dir => '/home/beerdb/www/beerdb/mdata', # in_package => 'BeerDB::TestApp', # comp_root => ], # } ) PerlAddVar MaypoleMasonx "data_dir => '/home/beerdb/www/beerdb/mdata'" PerlAddVar MaypoleMasonx "in_package => 'BeerDB::TestApp'" PerlAddVar MaypoleMasonx "comp_root => ]" # set something from arbitrary Perl code PerlSetVar MaypoleEvalDisplayTables "" # merging a hash of hashes - # $config->session( { args => { Directory => '/tmp/sessions/beerdb', # LockDirectory => '/tmp/sessionlocks/beerdb', # } # } ) PerlAddVar MaypoleSession "args => { Directory => '/tmp/sessions/beerdb' }" PerlAddVar MaypoleSession "args => { LockDirectory => '/tmp/sessionlocks/beerdb' }" # merging a hash of arrayrefs involves a nasty hack... # $config->masonx->{comp_root} = , # , # ]; PerlAddVar MaypoleMasonx "comp_root => ]" PerlAddVar MaypoleMasonx "comp_root => " # ...more clearly shown here. To build up a hash of arrayrefs, the first value must # be an array ref (to set up the value as an arrayref), while subsequent items are scalars # and are pushed onto the arrayref: # $config->masonx->{plugins} = ; PerlAddVar MaypoleMasonx "plugins => " PerlAddVar MaypoleMasonx "plugins => MasonX::Plugin::Bar->new" PerlAddVar MaypoleMasonx "plugins => MasonX::Plugin::Baz->new" Requirements: · Perl


Maypole::Plugin::Config::Apache Related Software